trigger-getting-started

Bootstrap Trigger.dev into an existing project with CLI setup, config, and first task.

1.1k|103|Updated Nov 28, 2024
One-click install
npx skills add https://github.com/VladSez/easy-invoice-pdf --skill trigger-getting-started
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trigger-getting-started
Source: https://github.com/VladSez/easy-invoice-pdf/tree/main/.cursor/skills/trigger-getting-started
Command: npx skills add https://github.com/VladSez/easy-invoice-pdf --skill trigger-getting-started

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trigger.dev/sdk, @trigger.dev/build.

What problem does it solve?

Setting up Trigger.dev from scratch involves many error-prone steps: authenticating the CLI, installing the right SDK versions, writing trigger.config.ts, scaffolding a tasks directory, wiring tsconfig and .gitignore, and setting the secret key. This Skill guides an AI agent through the entire bootstrap process so a project goes from zero to a running dev server with a registered task.

Core Features & Use Cases

  • Guided CLI or manual setup: Prefers npx trigger.dev init, with full manual fallback steps for monorepos, existing configs, or non-interactive environments.
  • Human handoff handling: Identifies the two steps only a person can do (CLI login and copying the DEV secret key / project ref from the dashboard) and pauses to request them.
  • First task scaffolding: Creates a /trigger directory with an exported task(), wires trigger.config.ts, tsconfig, .gitignore, and TRIGGER_SECRET_KEY, then runs trigger dev.
  • Use Case: A developer says "add Trigger.dev to my Next.js app" — the agent installs @trigger.dev/sdk and @trigger.dev/build, writes the config with the project ref, scaffolds a hello-world task, and starts the dev server so the task appears in the dashboard.

Quick Start

Ask the agent to set up Trigger.dev in this project and create a first task, then provide your dashboard project ref and DEV secret key when prompted.

Frequently Asked Questions about trigger-getting-started

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Trigger.dev in an existing project?

Run `npx trigger.dev init`, which authenticates the CLI, installs the SDK, writes trigger.config.ts, and scaffolds a first task. For monorepos or non-interactive environments, follow the manual steps: login, install @trigger.dev/sdk and @trigger.dev/build, write the config, add a task, and run `npx trigger.dev dev`.

How do I trigger a Trigger.dev task from my backend code?

Use `tasks.trigger()` from @trigger.dev/sdk with a type-only import of your task, passing the task id and payload. Set TRIGGER_SECRET_KEY to the DEV key from the dashboard's API Keys page wherever the triggering code runs.

Does Trigger.dev work in a monorepo?

Yes, two layouts are supported: tasks in a shared package with its own trigger.config.ts consumed via workspace dependencies, or Trigger.dev installed directly in the app that needs it. Run `trigger dev` from the directory containing trigger.config.ts.

Why is my Trigger.dev task not showing up in the dashboard?

Tasks must be named exports of `task()` inside a directory listed in the `dirs` field of trigger.config.ts, and the dev server must be running. Also check that the CLI and @trigger.dev/sdk versions match, since mismatches break dev and deploy.

Can Trigger.dev CLI login be automated by an agent?

No, `npx trigger.dev login` opens a browser for interactive sign-in and cannot be completed headlessly. The user must log in and manually copy the DEV secret key and project ref from the dashboard.