|
| 1 | +--- |
| 2 | +title: "CLI runs commands" |
| 3 | +sidebarTitle: "runs" |
| 4 | +description: "Use these commands to list, inspect, replay and cancel runs from your terminal." |
| 5 | +--- |
| 6 | + |
| 7 | +import CommonOptions from "/snippets/cli-options-common.mdx"; |
| 8 | +import ConfigFileOptions from "/snippets/cli-options-config-file.mdx"; |
| 9 | +import ProjectRefOptions from "/snippets/cli-options-project-ref.mdx"; |
| 10 | +import BranchOptions from "/snippets/cli-options-branch.mdx"; |
| 11 | + |
| 12 | +## runs list |
| 13 | + |
| 14 | +Lists runs, newest first, in a table of ID, task, status, version, created time and duration. |
| 15 | + |
| 16 | +<CodeGroup> |
| 17 | + |
| 18 | +```bash npm |
| 19 | +npx trigger.dev@latest runs list |
| 20 | +``` |
| 21 | + |
| 22 | +```bash pnpm |
| 23 | +pnpm dlx trigger.dev@latest runs list |
| 24 | +``` |
| 25 | + |
| 26 | +```bash yarn |
| 27 | +yarn dlx trigger.dev@latest runs list |
| 28 | +``` |
| 29 | + |
| 30 | +</CodeGroup> |
| 31 | + |
| 32 | +<ParamField body="Limit" type="--limit"> |
| 33 | + The number of runs to list, up to 100. Defaults to 20. |
| 34 | +</ParamField> |
| 35 | + |
| 36 | +<ParamField body="Status" type="--status"> |
| 37 | + Only show runs with this status, e.g. `FAILED`. |
| 38 | +</ParamField> |
| 39 | + |
| 40 | +<ParamField body="Task" type="--task"> |
| 41 | + Only show runs for this task identifier. |
| 42 | +</ParamField> |
| 43 | + |
| 44 | +<ParamField body="Tag" type="--tag"> |
| 45 | + Only show runs with this tag. |
| 46 | +</ParamField> |
| 47 | + |
| 48 | +<ParamField body="Cursor" type="--cursor"> |
| 49 | + The pagination cursor printed at the end of the previous page. |
| 50 | +</ParamField> |
| 51 | + |
| 52 | +## runs get |
| 53 | + |
| 54 | +Prints the status, version, tags, timings, duration, cost and error of a single run. |
| 55 | + |
| 56 | +```bash |
| 57 | +npx trigger.dev@latest runs get run_abc123 |
| 58 | +``` |
| 59 | + |
| 60 | +## runs replay |
| 61 | + |
| 62 | +Triggers a new run with the same payload as an existing one, using the latest version of the task. |
| 63 | + |
| 64 | +```bash |
| 65 | +npx trigger.dev@latest runs replay run_abc123 |
| 66 | +``` |
| 67 | + |
| 68 | +## runs cancel |
| 69 | + |
| 70 | +Cancels a run that has not finished yet. |
| 71 | + |
| 72 | +```bash |
| 73 | +npx trigger.dev@latest runs cancel run_abc123 |
| 74 | +``` |
| 75 | + |
| 76 | +## Options |
| 77 | + |
| 78 | +<ParamField body="Environment" type="--env | -e"> |
| 79 | + The environment to use: `dev`, `prod`, `staging` or `preview`. Defaults to `prod`. |
| 80 | +</ParamField> |
| 81 | + |
| 82 | +<ConfigFileOptions /> |
| 83 | +<ProjectRefOptions /> |
| 84 | +<BranchOptions /> |
| 85 | + |
| 86 | +### Common options |
| 87 | + |
| 88 | +These options are available on most commands. |
| 89 | + |
| 90 | +<CommonOptions /> |
0 commit comments