Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 1.64 KB

File metadata and controls

69 lines (47 loc) · 1.64 KB
title CLI dev command
description The `trigger.dev dev` command is used to run your tasks locally.

This runs a server on your machine that can execute Trigger.dev tasks:

npx trigger.dev@beta dev
pnpm dlx trigger.dev@beta dev
yarn dlx trigger.dev@beta dev

It will first perform an update check to prevent version mismatches, failed deploys, and other errors. You will always be prompted first.

You will see in the terminal that the server is running and listening for requests. When you run a task, you will see it in the terminal along with a link to view it in the dashboard.

It is worth noting that each task runs in a separate Node process. This means that if you have a long-running task, it will not block other tasks from running.

Options

Attaching a local debugger

You can use the --debugger flag to run the server in debug mode. This will allow you to attach a debugger to the server and debug your tasks.

npx trigger.dev@beta dev --debugger
pnpm dlx trigger.dev@beta dev --debugger
yarn dlx trigger.dev@beta dev --debugger

Concurrently running the terminal

Install the concurrently package as a dev dependency:

concurrently --raw --kill-others npm:dev:remix npm:dev:trigger

Then add something like this in your package.json scripts. This assumes you're running Next.js so swap that bit out if you're not:

"scripts": {
  "dev": "concurrently --raw --kill-others npm:dev:*",
  "dev:next": "next dev",
  "dev:trigger": "npx trigger.dev@beta dev",
  //...
}