@trigger.dev/sdk 4.5.0-rc.6 → 4.5.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/v3/ai.d.ts +171 -5
- package/dist/commonjs/v3/ai.js +309 -22
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/chat-server.d.ts +8 -0
- package/dist/commonjs/v3/chat-server.js +32 -10
- package/dist/commonjs/v3/chat-server.js.map +1 -1
- package/dist/commonjs/v3/chat-server.test.js +51 -0
- package/dist/commonjs/v3/chat-server.test.js.map +1 -1
- package/dist/commonjs/v3/createStartSessionAction.test.js +30 -0
- package/dist/commonjs/v3/createStartSessionAction.test.js.map +1 -1
- package/dist/commonjs/v3/sessions.d.ts +3 -2
- package/dist/commonjs/v3/sessions.js +3 -2
- package/dist/commonjs/v3/sessions.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +171 -5
- package/dist/esm/v3/ai.js +309 -22
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/chat-server.d.ts +8 -0
- package/dist/esm/v3/chat-server.js +32 -10
- package/dist/esm/v3/chat-server.js.map +1 -1
- package/dist/esm/v3/chat-server.test.js +51 -0
- package/dist/esm/v3/chat-server.test.js.map +1 -1
- package/dist/esm/v3/createStartSessionAction.test.js +30 -0
- package/dist/esm/v3/createStartSessionAction.test.js.map +1 -1
- package/dist/esm/v3/sessions.d.ts +3 -2
- package/dist/esm/v3/sessions.js +3 -2
- package/dist/esm/v3/sessions.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai/prompts.mdx +430 -0
- package/docs/ai-chat/actions.mdx +115 -0
- package/docs/ai-chat/anatomy.mdx +71 -0
- package/docs/ai-chat/backend.mdx +817 -0
- package/docs/ai-chat/background-injection.mdx +221 -0
- package/docs/ai-chat/changelog.mdx +850 -0
- package/docs/ai-chat/chat-local.mdx +174 -0
- package/docs/ai-chat/client-protocol.mdx +1081 -0
- package/docs/ai-chat/compaction.mdx +411 -0
- package/docs/ai-chat/custom-agents.mdx +364 -0
- package/docs/ai-chat/error-handling.mdx +415 -0
- package/docs/ai-chat/fast-starts.mdx +672 -0
- package/docs/ai-chat/frontend.mdx +580 -0
- package/docs/ai-chat/how-it-works.mdx +230 -0
- package/docs/ai-chat/lifecycle-hooks.mdx +530 -0
- package/docs/ai-chat/mcp.mdx +101 -0
- package/docs/ai-chat/overview.mdx +90 -0
- package/docs/ai-chat/patterns/branching-conversations.mdx +284 -0
- package/docs/ai-chat/patterns/code-sandbox.mdx +126 -0
- package/docs/ai-chat/patterns/database-persistence.mdx +414 -0
- package/docs/ai-chat/patterns/human-in-the-loop.mdx +275 -0
- package/docs/ai-chat/patterns/large-payloads.mdx +169 -0
- package/docs/ai-chat/patterns/oom-resilience.mdx +120 -0
- package/docs/ai-chat/patterns/persistence-and-replay.mdx +211 -0
- package/docs/ai-chat/patterns/recovery-boot.mdx +230 -0
- package/docs/ai-chat/patterns/skills.mdx +221 -0
- package/docs/ai-chat/patterns/sub-agents.mdx +383 -0
- package/docs/ai-chat/patterns/tool-result-auditing.mdx +148 -0
- package/docs/ai-chat/patterns/trusted-edge-signals.mdx +337 -0
- package/docs/ai-chat/patterns/version-upgrades.mdx +172 -0
- package/docs/ai-chat/pending-messages.mdx +343 -0
- package/docs/ai-chat/prompt-caching.mdx +206 -0
- package/docs/ai-chat/quick-start.mdx +161 -0
- package/docs/ai-chat/reference.mdx +909 -0
- package/docs/ai-chat/server-chat.mdx +263 -0
- package/docs/ai-chat/sessions.mdx +333 -0
- package/docs/ai-chat/testing.mdx +682 -0
- package/docs/ai-chat/tools.mdx +191 -0
- package/docs/ai-chat/types.mdx +242 -0
- package/docs/ai-chat/upgrade-guide.mdx +515 -0
- package/docs/apikeys.mdx +54 -0
- package/docs/building-with-ai.mdx +261 -0
- package/docs/bulk-actions.mdx +49 -0
- package/docs/changelog.mdx +6 -0
- package/docs/cli-deploy-commands.mdx +9 -0
- package/docs/cli-dev-commands.mdx +9 -0
- package/docs/cli-dev.mdx +8 -0
- package/docs/cli-init-commands.mdx +58 -0
- package/docs/cli-introduction.mdx +25 -0
- package/docs/cli-list-profiles-commands.mdx +42 -0
- package/docs/cli-login-commands.mdx +33 -0
- package/docs/cli-logout-commands.mdx +33 -0
- package/docs/cli-preview-archive.mdx +59 -0
- package/docs/cli-promote-commands.mdx +9 -0
- package/docs/cli-switch.mdx +43 -0
- package/docs/cli-update-commands.mdx +42 -0
- package/docs/cli-whoami-commands.mdx +33 -0
- package/docs/community.mdx +6 -0
- package/docs/config/config-file.mdx +602 -0
- package/docs/config/extensions/additionalFiles.mdx +38 -0
- package/docs/config/extensions/additionalPackages.mdx +40 -0
- package/docs/config/extensions/aptGet.mdx +34 -0
- package/docs/config/extensions/audioWaveform.mdx +20 -0
- package/docs/config/extensions/custom.mdx +380 -0
- package/docs/config/extensions/emitDecoratorMetadata.mdx +29 -0
- package/docs/config/extensions/esbuildPlugin.mdx +31 -0
- package/docs/config/extensions/ffmpeg.mdx +45 -0
- package/docs/config/extensions/lightpanda.mdx +56 -0
- package/docs/config/extensions/overview.mdx +67 -0
- package/docs/config/extensions/playwright.mdx +195 -0
- package/docs/config/extensions/prismaExtension.mdx +1014 -0
- package/docs/config/extensions/puppeteer.mdx +30 -0
- package/docs/config/extensions/pythonExtension.mdx +182 -0
- package/docs/config/extensions/syncEnvVars.mdx +291 -0
- package/docs/context.mdx +235 -0
- package/docs/database-connections.mdx +213 -0
- package/docs/deploy-environment-variables.mdx +435 -0
- package/docs/deployment/atomic-deployment.mdx +172 -0
- package/docs/deployment/overview.mdx +257 -0
- package/docs/deployment/preview-branches.mdx +224 -0
- package/docs/errors-retrying.mdx +379 -0
- package/docs/github-actions.mdx +222 -0
- package/docs/github-integration.mdx +136 -0
- package/docs/github-repo.mdx +8 -0
- package/docs/help-email.mdx +6 -0
- package/docs/help-slack.mdx +11 -0
- package/docs/hidden-tasks.mdx +56 -0
- package/docs/how-it-works.mdx +454 -0
- package/docs/how-to-reduce-your-spend.mdx +217 -0
- package/docs/idempotency.mdx +504 -0
- package/docs/introduction.mdx +223 -0
- package/docs/limits.mdx +241 -0
- package/docs/logging.mdx +195 -0
- package/docs/machines.mdx +952 -0
- package/docs/manual-setup.mdx +632 -0
- package/docs/mcp-agent-rules.mdx +41 -0
- package/docs/mcp-introduction.mdx +385 -0
- package/docs/mcp-tools.mdx +273 -0
- package/docs/migrating-from-v3.mdx +334 -0
- package/docs/observability/dashboards.mdx +102 -0
- package/docs/observability/query.mdx +585 -0
- package/docs/open-source-contributing.mdx +16 -0
- package/docs/open-source-self-hosting.mdx +541 -0
- package/docs/private-networking/aws-console-setup.mdx +304 -0
- package/docs/private-networking/overview.mdx +144 -0
- package/docs/private-networking/troubleshooting.mdx +78 -0
- package/docs/queue-concurrency.mdx +354 -0
- package/docs/quick-start.mdx +97 -0
- package/docs/realtime/auth.mdx +208 -0
- package/docs/realtime/backend/overview.mdx +45 -0
- package/docs/realtime/backend/streams.mdx +418 -0
- package/docs/realtime/backend/subscribe.mdx +225 -0
- package/docs/realtime/how-it-works.mdx +94 -0
- package/docs/realtime/overview.mdx +63 -0
- package/docs/realtime/react-hooks/overview.mdx +73 -0
- package/docs/realtime/react-hooks/streams.mdx +449 -0
- package/docs/realtime/react-hooks/subscribe.mdx +674 -0
- package/docs/realtime/react-hooks/swr.mdx +87 -0
- package/docs/realtime/react-hooks/triggering.mdx +194 -0
- package/docs/realtime/react-hooks/use-wait-token.mdx +34 -0
- package/docs/realtime/run-object.mdx +174 -0
- package/docs/replaying.mdx +72 -0
- package/docs/request-feature.mdx +6 -0
- package/docs/roadmap.mdx +6 -0
- package/docs/run-tests.mdx +20 -0
- package/docs/run-usage.mdx +113 -0
- package/docs/runs/heartbeats.mdx +38 -0
- package/docs/runs/max-duration.mdx +139 -0
- package/docs/runs/metadata.mdx +734 -0
- package/docs/runs/priority.mdx +31 -0
- package/docs/runs.mdx +396 -0
- package/docs/self-hosting/docker.mdx +458 -0
- package/docs/self-hosting/env/supervisor.mdx +74 -0
- package/docs/self-hosting/env/webapp.mdx +276 -0
- package/docs/self-hosting/kubernetes.mdx +601 -0
- package/docs/self-hosting/overview.mdx +108 -0
- package/docs/skills.mdx +85 -0
- package/docs/tags.mdx +120 -0
- package/docs/tasks/overview.mdx +697 -0
- package/docs/tasks/scheduled.mdx +382 -0
- package/docs/tasks/schemaTask.mdx +413 -0
- package/docs/tasks/streams.mdx +884 -0
- package/docs/triggering.mdx +1320 -0
- package/docs/troubleshooting-alerts.mdx +385 -0
- package/docs/troubleshooting-debugging-in-vscode.mdx +8 -0
- package/docs/troubleshooting-github-issues.mdx +6 -0
- package/docs/troubleshooting-uptime-status.mdx +6 -0
- package/docs/troubleshooting.mdx +398 -0
- package/docs/upgrading-packages.mdx +80 -0
- package/docs/vercel-integration.mdx +207 -0
- package/docs/versioning.mdx +56 -0
- package/docs/video-walkthrough.mdx +23 -0
- package/docs/wait-for-token.mdx +540 -0
- package/docs/wait-for.mdx +42 -0
- package/docs/wait-until.mdx +53 -0
- package/docs/wait.mdx +18 -0
- package/docs/writing-tasks-introduction.mdx +33 -0
- package/package.json +8 -5
- package/skills/trigger-authoring-chat-agent/SKILL.md +296 -0
- package/skills/trigger-authoring-tasks/SKILL.md +254 -0
- package/skills/trigger-chat-agent-advanced/SKILL.md +368 -0
- package/skills/trigger-cost-savings/SKILL.md +116 -0
- package/skills/trigger-realtime-and-frontend/SKILL.md +276 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Overview"
|
|
3
|
+
sidebarTitle: "Overview"
|
|
4
|
+
description: "Tools and resources for building Trigger.dev projects with AI coding assistants."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Quick setup
|
|
8
|
+
|
|
9
|
+
We provide multiple tools to help AI coding assistants write correct Trigger.dev code. Use one or all of them for the best developer experience.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<Steps>
|
|
13
|
+
|
|
14
|
+
<Step title="Install the MCP Server">
|
|
15
|
+
Give your AI assistant direct access to Trigger.dev tools — search docs, trigger tasks, deploy projects, and monitor runs. Works with Claude Code, Cursor, Windsurf, VS Code (Copilot), and Zed.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx trigger.dev@latest install-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
[Learn more →](/mcp-introduction)
|
|
22
|
+
</Step>
|
|
23
|
+
|
|
24
|
+
<Step title="Install Skills">
|
|
25
|
+
Portable instruction sets that teach any AI coding assistant Trigger.dev best practices: writing tasks, realtime frontends, and `chat.agent` AI agents. They install with the CLI into Claude Code, Cursor, VS Code (Copilot), and AGENTS-compatible tools such as Codex via `.agents/skills/`, and draw their API guidance from a version-pinned reference shipped in `@trigger.dev/sdk`.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx trigger.dev@latest skills
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
[Learn more →](/skills)
|
|
32
|
+
</Step>
|
|
33
|
+
|
|
34
|
+
</Steps>
|
|
35
|
+
|
|
36
|
+
## Skills and the MCP server
|
|
37
|
+
|
|
38
|
+
Skills and the MCP server do different jobs and work best together. Here's how they compare:
|
|
39
|
+
|
|
40
|
+
| | **Skills** | **MCP Server** |
|
|
41
|
+
|:--|:-----------|:---------------|
|
|
42
|
+
| **What it does** | Drops skill files into your project that teach Trigger.dev patterns | Runs a live server your AI connects to |
|
|
43
|
+
| **Installs to** | `.claude/skills/`, `.cursor/skills/`, `.github/skills/`, `.agents/skills/` | `mcp.json`, `~/.claude.json`, etc. |
|
|
44
|
+
| **Updates** | Re-run `npx trigger.dev@latest skills`, or auto-prompted on `trigger dev` | Always latest (uses `@latest`) |
|
|
45
|
+
| **Best for** | Teaching patterns and best practices | Live project interaction (deploy, trigger, monitor) |
|
|
46
|
+
| **Works offline** | Yes | No (calls Trigger.dev API) |
|
|
47
|
+
|
|
48
|
+
**Our recommendation:** Install both. Skills teach your AI *how* to write Trigger.dev code; the MCP Server lets it *do things* in your project.
|
|
49
|
+
|
|
50
|
+
## Project-level context snippet
|
|
51
|
+
|
|
52
|
+
If you prefer a lightweight/passive approach, paste the snippet below into a context file at the root of your project. Different AI tools read different files:
|
|
53
|
+
|
|
54
|
+
| File | Read by |
|
|
55
|
+
|:-----|:--------|
|
|
56
|
+
| `CLAUDE.md` | Claude Code |
|
|
57
|
+
| `AGENTS.md` | OpenAI Codex, Jules, OpenCode |
|
|
58
|
+
| `.cursor/rules/*.md` | Cursor |
|
|
59
|
+
| `.github/copilot-instructions.md` | GitHub Copilot |
|
|
60
|
+
| `CONVENTIONS.md` | Windsurf, Cline, and others |
|
|
61
|
+
|
|
62
|
+
Create the file that matches your AI tool (or multiple files if your team uses different tools) and paste the snippet below. This gives the AI essential Trigger.dev context without installing anything.
|
|
63
|
+
|
|
64
|
+
<Accordion title="Copy the snippet">
|
|
65
|
+
|
|
66
|
+
````markdown
|
|
67
|
+
# Trigger.dev rules
|
|
68
|
+
|
|
69
|
+
## Imports
|
|
70
|
+
|
|
71
|
+
Always import from `@trigger.dev/sdk` — never from `@trigger.dev/sdk/v3` or use the deprecated `client.defineJob` pattern.
|
|
72
|
+
|
|
73
|
+
## Task pattern
|
|
74
|
+
|
|
75
|
+
Every task must be exported. Use `task()` from `@trigger.dev/sdk`:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import { task } from "@trigger.dev/sdk";
|
|
79
|
+
|
|
80
|
+
export const myTask = task({
|
|
81
|
+
id: "my-task",
|
|
82
|
+
retry: {
|
|
83
|
+
maxAttempts: 3,
|
|
84
|
+
factor: 1.8,
|
|
85
|
+
minTimeoutInMs: 500,
|
|
86
|
+
maxTimeoutInMs: 30_000,
|
|
87
|
+
},
|
|
88
|
+
run: async (payload: { url: string }) => {
|
|
89
|
+
// No timeouts — runs can take as long as needed
|
|
90
|
+
return { success: true };
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Triggering tasks
|
|
96
|
+
|
|
97
|
+
From your backend (Next.js route, Express handler, etc.):
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import type { myTask } from "./trigger/my-task";
|
|
101
|
+
import { tasks } from "@trigger.dev/sdk";
|
|
102
|
+
|
|
103
|
+
// Fire and forget
|
|
104
|
+
const handle = await tasks.trigger<typeof myTask>("my-task", { url: "https://example.com" });
|
|
105
|
+
|
|
106
|
+
// Batch trigger (up to 1,000 items)
|
|
107
|
+
const batchHandle = await tasks.batchTrigger<typeof myTask>("my-task", [
|
|
108
|
+
{ payload: { url: "https://example.com/1" } },
|
|
109
|
+
{ payload: { url: "https://example.com/2" } },
|
|
110
|
+
]);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### From inside other tasks
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
export const parentTask = task({
|
|
117
|
+
id: "parent-task",
|
|
118
|
+
run: async (payload) => {
|
|
119
|
+
// Fire and forget
|
|
120
|
+
await childTask.trigger({ data: "value" });
|
|
121
|
+
|
|
122
|
+
// Wait for result — returns a Result object, NOT the output directly
|
|
123
|
+
const result = await childTask.triggerAndWait({ data: "value" });
|
|
124
|
+
if (result.ok) {
|
|
125
|
+
console.log(result.output); // The actual return value
|
|
126
|
+
} else {
|
|
127
|
+
console.error(result.error);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Or use .unwrap() to get output directly (throws on failure)
|
|
131
|
+
const output = await childTask.triggerAndWait({ data: "value" }).unwrap();
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
> Never wrap `triggerAndWait` or `batchTriggerAndWait` in `Promise.all` — this is not supported.
|
|
137
|
+
|
|
138
|
+
## Error handling
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
import { task, retry, AbortTaskRunError } from "@trigger.dev/sdk";
|
|
142
|
+
|
|
143
|
+
export const resilientTask = task({
|
|
144
|
+
id: "resilient-task",
|
|
145
|
+
retry: { maxAttempts: 5 },
|
|
146
|
+
run: async (payload) => {
|
|
147
|
+
// Permanent error — skip retrying
|
|
148
|
+
if (!payload.isValid) {
|
|
149
|
+
throw new AbortTaskRunError("Invalid payload, will not retry");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Retry a specific block (not the whole task)
|
|
153
|
+
const data = await retry.onThrow(
|
|
154
|
+
async () => await fetchExternalApi(payload),
|
|
155
|
+
{ maxAttempts: 3 }
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
return data;
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Schema validation
|
|
164
|
+
|
|
165
|
+
Use `schemaTask` with Zod for payload validation:
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
import { schemaTask } from "@trigger.dev/sdk";
|
|
169
|
+
import { z } from "zod";
|
|
170
|
+
|
|
171
|
+
export const processVideo = schemaTask({
|
|
172
|
+
id: "process-video",
|
|
173
|
+
schema: z.object({ videoUrl: z.string().url() }),
|
|
174
|
+
run: async (payload) => {
|
|
175
|
+
// payload is typed and validated
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Waits
|
|
181
|
+
|
|
182
|
+
Use `wait.for` for delays, `wait.until` for dates, and `wait.forToken` for external callbacks:
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
import { wait } from "@trigger.dev/sdk";
|
|
186
|
+
await wait.for({ seconds: 30 });
|
|
187
|
+
await wait.until({ date: new Date("2025-01-01") });
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Configuration
|
|
191
|
+
|
|
192
|
+
`trigger.config.ts` lives at the project root:
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
import { defineConfig } from "@trigger.dev/sdk/build";
|
|
196
|
+
|
|
197
|
+
export default defineConfig({
|
|
198
|
+
project: "<your-project-ref>",
|
|
199
|
+
dirs: ["./trigger"],
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Common mistakes
|
|
204
|
+
|
|
205
|
+
1. **Forgetting to export tasks** — every task must be a named export
|
|
206
|
+
2. **Importing from `@trigger.dev/sdk/v3`** — this is the old v3 path; always use `@trigger.dev/sdk`
|
|
207
|
+
3. **Using `client.defineJob()`** — this is the deprecated v2 API
|
|
208
|
+
4. **Calling `task.trigger()` directly** — use `tasks.trigger<typeof myTask>("task-id", payload)` from your backend
|
|
209
|
+
5. **Using `triggerAndWait` result as output** — it returns a `Result` object; check `result.ok` then access `result.output`, or use `.unwrap()`
|
|
210
|
+
6. **Wrapping waits/triggerAndWait in `Promise.all`** — not supported in Trigger.dev tasks
|
|
211
|
+
7. **Adding timeouts to tasks** — tasks have no built-in timeout; use `maxDuration` in config if needed
|
|
212
|
+
````
|
|
213
|
+
|
|
214
|
+
</Accordion>
|
|
215
|
+
|
|
216
|
+
## llms.txt
|
|
217
|
+
|
|
218
|
+
We also publish machine-readable documentation for LLM consumption:
|
|
219
|
+
|
|
220
|
+
- [trigger.dev/docs/llms.txt](https://trigger.dev/docs/llms.txt) — concise overview
|
|
221
|
+
- [trigger.dev/docs/llms-full.txt](https://trigger.dev/docs/llms-full.txt) — full documentation
|
|
222
|
+
|
|
223
|
+
These follow the [llms.txt standard](https://llmstxt.org) and can be fed directly into any LLM context window.
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## Troubleshooting
|
|
227
|
+
|
|
228
|
+
<AccordionGroup>
|
|
229
|
+
|
|
230
|
+
<Accordion title="AI keeps generating old v2/v3 code">
|
|
231
|
+
Install [Skills](/skills); they override the outdated patterns in the AI's training data. The [context snippet](#project-level-context-snippet) above is a quick alternative.
|
|
232
|
+
</Accordion>
|
|
233
|
+
|
|
234
|
+
<Accordion title="MCP server won't connect">
|
|
235
|
+
1. Make sure you've restarted your AI client after adding the config
|
|
236
|
+
2. Run `npx trigger.dev@latest install-mcp` again — it will detect and fix common issues
|
|
237
|
+
3. Check that `npx trigger.dev@latest mcp` runs without errors in your terminal
|
|
238
|
+
4. See the [MCP introduction](/mcp-introduction) for client-specific config details
|
|
239
|
+
</Accordion>
|
|
240
|
+
|
|
241
|
+
<Accordion title="Which tool should I install?">
|
|
242
|
+
Both if possible:
|
|
243
|
+
- **Skills** to teach your AI how to write Trigger.dev code (tasks, realtime, chat.agent)
|
|
244
|
+
- **MCP Server** if you need to trigger tasks, deploy, and search docs from your AI
|
|
245
|
+
</Accordion>
|
|
246
|
+
|
|
247
|
+
</AccordionGroup>
|
|
248
|
+
|
|
249
|
+
## Next steps
|
|
250
|
+
|
|
251
|
+
<CardGroup cols={2}>
|
|
252
|
+
<Card title="MCP Server" icon="sparkles" href="/mcp-introduction">
|
|
253
|
+
Install and configure the MCP Server for live project interaction.
|
|
254
|
+
</Card>
|
|
255
|
+
<Card title="Skills" icon="wand-magic-sparkles" href="/skills">
|
|
256
|
+
Install Trigger.dev agent skills into any AI coding assistant.
|
|
257
|
+
</Card>
|
|
258
|
+
<Card title="Writing tasks" icon="code" href="/tasks/overview">
|
|
259
|
+
Learn the task patterns your AI assistant will follow.
|
|
260
|
+
</Card>
|
|
261
|
+
</CardGroup>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Bulk actions"
|
|
3
|
+
description: "Perform actions like replay and cancel on multiple runs at once."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Bulk actions allow you to perform replaying and canceling on multiple runs at once. This is especially useful when you need to retry a batch of failed runs with a new version of your code, or when you need to cancel multiple in-progress runs.
|
|
7
|
+
|
|
8
|
+
<video
|
|
9
|
+
src="https://content.trigger.dev/bulk-actions.mp4"
|
|
10
|
+
preload="auto"
|
|
11
|
+
controls={true}
|
|
12
|
+
loop
|
|
13
|
+
muted
|
|
14
|
+
autoPlay={true}
|
|
15
|
+
width="100%"
|
|
16
|
+
height="100%"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
## How to create a new bulk action
|
|
20
|
+
|
|
21
|
+
<Icon icon="circle-1" iconType="solid" color="#FF2D6B" size="20" /> Open the bulk action panel from the top right of the runs page
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<Icon icon="circle-2" iconType="solid" color="#FF2D6B" size="20" /> Filter the runs table to show the runs you want to bulk action
|
|
27
|
+
|
|
28
|
+
<Icon icon="circle-3" iconType="solid" color="#FF2D6B" size="20" /> Alternatively, you can select individual runs
|
|
29
|
+
|
|
30
|
+
<Icon icon="circle-4" iconType="solid" color="#FF2D6B" size="20" /> Choose the runs you want to bulk action
|
|
31
|
+
|
|
32
|
+
<Icon icon="circle-5" iconType="solid" color="#FF2D6B" size="20" /> Name your bulk action (optional)
|
|
33
|
+
|
|
34
|
+
<Icon icon="circle-6" iconType="solid" color="#FF2D6B" size="20" /> Choose the action you want to perform, replay or cancel
|
|
35
|
+
|
|
36
|
+
<Icon icon="circle-7" iconType="solid" color="#FF2D6B" size="20" /> Click the "Replay" or "Cancel" button and confirm in the dialog
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
<Icon icon="circle-8" iconType="solid" color="#FF2D6B" size="20" /> You'll now view the bulk action processing from the bulk action page
|
|
41
|
+
|
|
42
|
+
<Icon icon="circle-9" iconType="solid" color="#FF2D6B" size="20" /> You can replay or view the runs from this page
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
<Note>
|
|
47
|
+
You can only cancel runs that are in states that allow cancellation (like QUEUED or EXECUTING).
|
|
48
|
+
Runs that are already completed, failed, or in other final states by the time the bulk action process gets to them, cannot be canceled.
|
|
49
|
+
</Note>
|
package/docs/cli-dev.mdx
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI init command"
|
|
3
|
+
sidebarTitle: "init"
|
|
4
|
+
description: "Use these options when running the CLI `init` command."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import CommonOptions from '/snippets/cli-options-common.mdx';
|
|
8
|
+
|
|
9
|
+
Run the command like this:
|
|
10
|
+
|
|
11
|
+
<CodeGroup>
|
|
12
|
+
|
|
13
|
+
```bash npm
|
|
14
|
+
npx trigger.dev@latest init
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash pnpm
|
|
18
|
+
pnpm dlx trigger.dev@latest init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash yarn
|
|
22
|
+
yarn dlx trigger.dev@latest init
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</CodeGroup>
|
|
26
|
+
|
|
27
|
+
## Options
|
|
28
|
+
|
|
29
|
+
<ParamField body="Javascript" type="--javascript">
|
|
30
|
+
By default, the init command assumes you are using TypeScript. Use this flag to initialize a
|
|
31
|
+
project that uses JavaScript.
|
|
32
|
+
</ParamField>
|
|
33
|
+
|
|
34
|
+
<ParamField body="Project ref" type="--project-ref | -p">
|
|
35
|
+
The project ref to use when initializing the project.
|
|
36
|
+
</ParamField>
|
|
37
|
+
|
|
38
|
+
<ParamField body="Package tag" type="--tag | -t">
|
|
39
|
+
The version of the `@trigger.dev/sdk` package to install. Defaults to `latest`.
|
|
40
|
+
</ParamField>
|
|
41
|
+
|
|
42
|
+
<ParamField body="Skip package install" type="--skip-package-install">
|
|
43
|
+
Skip installing the `@trigger.dev/sdk` package.
|
|
44
|
+
</ParamField>
|
|
45
|
+
|
|
46
|
+
<ParamField body="Override config" type="--override-config">
|
|
47
|
+
Override the existing config file if it exists.
|
|
48
|
+
</ParamField>
|
|
49
|
+
|
|
50
|
+
<ParamField body="Package arguments" type="--pkg-args">
|
|
51
|
+
Additional arguments to pass to the package manager. Accepts CSV for multiple args.
|
|
52
|
+
</ParamField>
|
|
53
|
+
|
|
54
|
+
### Common options
|
|
55
|
+
|
|
56
|
+
These options are available on most commands.
|
|
57
|
+
|
|
58
|
+
<CommonOptions />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Introduction"
|
|
3
|
+
description: "The Trigger.dev CLI has a number of options and commands to help you develop locally, self host, and deploy your tasks."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import HelpOption from '/snippets/cli-options-help.mdx';
|
|
7
|
+
import VersionOption from '/snippets/cli-options-version.mdx';
|
|
8
|
+
|
|
9
|
+
## Options
|
|
10
|
+
|
|
11
|
+
<HelpOption />
|
|
12
|
+
<VersionOption />
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
| Command | Description |
|
|
17
|
+
| :------------------------------------------- | :----------------------------------------------------------------- |
|
|
18
|
+
| [login](/cli-login-commands) | Login with Trigger.dev so you can perform authenticated actions. |
|
|
19
|
+
| [init](/cli-init-commands) | Initialize your existing project for development with Trigger.dev. |
|
|
20
|
+
| [dev](/cli-dev-commands) | Run your Trigger.dev tasks locally. |
|
|
21
|
+
| [deploy](/cli-deploy-commands) | Deploy your Trigger.dev v3 project to the cloud. |
|
|
22
|
+
| [whoami](/cli-whoami-commands) | Display the current logged in user and project details. |
|
|
23
|
+
| [logout](/cli-logout-commands) | Logout of Trigger.dev. |
|
|
24
|
+
| [list-profiles](/cli-list-profiles-commands) | List all of your CLI profiles. |
|
|
25
|
+
| [update](/cli-update-commands) | Updates all `@trigger.dev/*` packages to match the CLI version. |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI list-profiles command"
|
|
3
|
+
sidebarTitle: "list-profiles"
|
|
4
|
+
description: "Use these options when using the `list-profiles` CLI command."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import LogLevelOption from "/snippets/cli-options-log-level.mdx";
|
|
8
|
+
import SkipTelemetryOption from "/snippets/cli-options-skip-telemetry.mdx";
|
|
9
|
+
import HelpOption from "/snippets/cli-options-help.mdx";
|
|
10
|
+
import VersionOption from "/snippets/cli-options-version.mdx";
|
|
11
|
+
|
|
12
|
+
Run the command like this:
|
|
13
|
+
|
|
14
|
+
<CodeGroup>
|
|
15
|
+
|
|
16
|
+
```bash npm
|
|
17
|
+
npx trigger.dev@latest list-profiles
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```bash pnpm
|
|
21
|
+
pnpm dlx trigger.dev@latest list-profiles
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```bash yarn
|
|
25
|
+
yarn dlx trigger.dev@latest list-profiles
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
</CodeGroup>
|
|
29
|
+
|
|
30
|
+
## Options
|
|
31
|
+
|
|
32
|
+
### Common options
|
|
33
|
+
|
|
34
|
+
These options are available on most commands.
|
|
35
|
+
|
|
36
|
+
<LogLevelOption />
|
|
37
|
+
|
|
38
|
+
<SkipTelemetryOption />
|
|
39
|
+
|
|
40
|
+
<HelpOption />
|
|
41
|
+
|
|
42
|
+
<VersionOption />
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI login command"
|
|
3
|
+
sidebarTitle: "login"
|
|
4
|
+
description: "Use these options when logging in to Trigger.dev using the CLI."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import CommonOptions from '/snippets/cli-options-common.mdx';
|
|
8
|
+
|
|
9
|
+
Run the command like this:
|
|
10
|
+
|
|
11
|
+
<CodeGroup>
|
|
12
|
+
|
|
13
|
+
```bash npm
|
|
14
|
+
npx trigger.dev@latest login
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash pnpm
|
|
18
|
+
pnpm dlx trigger.dev@latest login
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash yarn
|
|
22
|
+
yarn dlx trigger.dev@latest login
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</CodeGroup>
|
|
26
|
+
|
|
27
|
+
## Options
|
|
28
|
+
|
|
29
|
+
### Common options
|
|
30
|
+
|
|
31
|
+
These options are available on most commands.
|
|
32
|
+
|
|
33
|
+
<CommonOptions />
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI logout command"
|
|
3
|
+
sidebarTitle: "logout"
|
|
4
|
+
description: "Use these options when using the `logout` CLI command."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import CommonOptions from '/snippets/cli-options-common.mdx';
|
|
8
|
+
|
|
9
|
+
Run the command like this:
|
|
10
|
+
|
|
11
|
+
<CodeGroup>
|
|
12
|
+
|
|
13
|
+
```bash npm
|
|
14
|
+
npx trigger.dev@latest logout
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```bash pnpm
|
|
18
|
+
pnpm dlx trigger.dev@latest logout
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash yarn
|
|
22
|
+
yarn dlx trigger.dev@latest logout
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</CodeGroup>
|
|
26
|
+
|
|
27
|
+
## Options
|
|
28
|
+
|
|
29
|
+
### Common options
|
|
30
|
+
|
|
31
|
+
These options are available on most commands.
|
|
32
|
+
|
|
33
|
+
<CommonOptions />
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI preview archive command"
|
|
3
|
+
sidebarTitle: "preview archive"
|
|
4
|
+
description: "The `trigger.dev preview archive` command can be used to archive a preview branch."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import ProjectPathArg from "/snippets/cli-args-project-path.mdx";
|
|
8
|
+
import CommonOptions from "/snippets/cli-options-common.mdx";
|
|
9
|
+
import ProjectRefOption from "/snippets/cli-options-project-ref.mdx";
|
|
10
|
+
import EnvFileOption from "/snippets/cli-options-env-file.mdx";
|
|
11
|
+
import ConfigFileOption from "/snippets/cli-options-config-file.mdx";
|
|
12
|
+
import SkipUpdateCheckOption from "/snippets/cli-options-skip-update-check.mdx";
|
|
13
|
+
import BranchOption from "/snippets/cli-options-branch.mdx";
|
|
14
|
+
|
|
15
|
+
Run the command like this:
|
|
16
|
+
|
|
17
|
+
<CodeGroup>
|
|
18
|
+
|
|
19
|
+
```bash npm
|
|
20
|
+
npx trigger.dev@latest preview archive
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash pnpm
|
|
24
|
+
pnpm dlx trigger.dev@latest preview archive
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```bash yarn
|
|
28
|
+
yarn dlx trigger.dev@latest preview archive
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
</CodeGroup>
|
|
32
|
+
|
|
33
|
+
It will archive the preview branch, automatically detecting the branch name from git. You can manually specify the branch using the `--branch` option.
|
|
34
|
+
|
|
35
|
+
## Arguments
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
npx trigger.dev@latest preview archive [path]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
<ProjectPathArg />
|
|
42
|
+
|
|
43
|
+
## Options
|
|
44
|
+
|
|
45
|
+
<BranchOption />
|
|
46
|
+
|
|
47
|
+
<ConfigFileOption />
|
|
48
|
+
|
|
49
|
+
<ProjectRefOption />
|
|
50
|
+
|
|
51
|
+
<EnvFileOption />
|
|
52
|
+
|
|
53
|
+
<SkipUpdateCheckOption />
|
|
54
|
+
|
|
55
|
+
### Common options
|
|
56
|
+
|
|
57
|
+
These options are available on most commands.
|
|
58
|
+
|
|
59
|
+
<CommonOptions />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI promote command"
|
|
3
|
+
sidebarTitle: "promote"
|
|
4
|
+
description: "Use the promote command to promote a previously deployed version to the current version."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import CliPromoteCommands from "/snippets/cli-commands-promote.mdx";
|
|
8
|
+
|
|
9
|
+
<CliPromoteCommands />
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "CLI switch command"
|
|
3
|
+
sidebarTitle: "switch"
|
|
4
|
+
description: "The `trigger.dev switch` command can be used to switch between profiles."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import ProjectPathArg from "/snippets/cli-args-project-path.mdx";
|
|
8
|
+
import CommonOptions from "/snippets/cli-options-common.mdx";
|
|
9
|
+
import ProjectRefOption from "/snippets/cli-options-project-ref.mdx";
|
|
10
|
+
import EnvFileOption from "/snippets/cli-options-env-file.mdx";
|
|
11
|
+
import ConfigFileOption from "/snippets/cli-options-config-file.mdx";
|
|
12
|
+
import SkipUpdateCheckOption from "/snippets/cli-options-skip-update-check.mdx";
|
|
13
|
+
import BranchOption from "/snippets/cli-options-branch.mdx";
|
|
14
|
+
|
|
15
|
+
Run the command like this:
|
|
16
|
+
|
|
17
|
+
<CodeGroup>
|
|
18
|
+
|
|
19
|
+
```bash npm
|
|
20
|
+
npx trigger.dev@latest switch [profile]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash pnpm
|
|
24
|
+
pnpm dlx trigger.dev@latest switch [profile]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```bash yarn
|
|
28
|
+
yarn dlx trigger.dev@latest switch [profile]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
</CodeGroup>
|
|
32
|
+
|
|
33
|
+
It will switch to the specified profile. If no profile is specified, it will list all available profiles and run interactively.
|
|
34
|
+
|
|
35
|
+
## Arguments
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
npx trigger.dev@latest switch [profile]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
<ParamField body="Profile" type="[profile]">
|
|
42
|
+
The profile to switch to. If not specified, it will list all available profiles and run interactively.
|
|
43
|
+
</ParamField>
|