Files
triggerdotdev--trigger.dev/docs/cli-dev.mdx
T
James Ritchie d6786002b2 Full Next.js guide (#1259)
* tasks no longer inside a group in the side menu (and added “cron”)

* Delay using a timezone

* Added React Not Defined error to the troubleshooting page

* Improved the React common problem

* Link to v2 docs

* New Development section and entry in Common Problems

* Concurrently running the terminal

* Fixed the .env weirdness

* Added section on creating PATs for Github actions

* Improved the Machine spec and limits page

* Quick start steps now have nice images

* Added a diagram for the lifecycle functions

* Added note about onFailure

* CRON -> cron/Cron

* WIP adding more steps to the next.js guide

* WIP next.js

* WIP adding tabbed steps for pages/app router

* References to Infisical links to their homepage so it’s clearer

* WIP updating the nextjs guide

* WIP nextjs guide

* More nextjs guide steps

* More copy

* Added rate limit trouble shooting

* Removed old prisma error title

* Added secret key step

* Added a note for logging in using a specified domain if self hosting

* typo

* App router docs copy

* Deploy copy update

* Added a favicon.png to fix a docs build error

* Removed unused snippet

* Server actions now inside a tab

* Server actions + restructured the triggering section

* Added troubleshooting snippet for react event handlers

* Added a new troubleshooting snippet for ESM

* Updated old replaying image to reflect the new UI

* Removed references to reattempting

* Updated replaying from the run page

* Added a bulk replay section

* Updated the writing tasks intro page

* Removed edge runtime code for now

* Added edge runtime – it seems to just work!

* import type
2024-08-20 14:50:39 +01:00

70 lines
1.6 KiB
Plaintext

---
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:
<CodeGroup>
```bash npm
npx trigger.dev@beta dev
```
```bash pnpm
pnpm dlx trigger.dev@beta dev
```
```bash yarn
yarn dlx trigger.dev@beta dev
```
</CodeGroup>
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.
<CodeGroup>
```bash npm
npx trigger.dev@beta dev --debugger
```
```bash pnpm
pnpm dlx trigger.dev@beta dev --debugger
```
```bash yarn
yarn dlx trigger.dev@beta dev --debugger
```
</CodeGroup>
### Concurrently running the terminal
Install the concurrently package as a dev dependency:
```ts
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:
```json
"scripts": {
"dev": "concurrently --raw --kill-others npm:dev:*",
"dev:next": "next dev",
"dev:trigger": "npx trigger.dev@beta dev",
//...
}
```