docs/snippets/step-cli-init.mdx
The easiest way to get started is to use the CLI. It will add Trigger.dev to your existing project, create a /trigger folder and give you an example task.
Run this command in the root of your project to get started:
<CodeGroup>npx trigger.dev@latest init
pnpm dlx trigger.dev@latest init
yarn dlx trigger.dev@latest init
It will do a few things:
<Tip title="MCP Server"> Our [Trigger.dev MCP server](/mcp-introduction) gives your AI assistant direct access to Trigger.dev tools; search docs, trigger tasks, deploy projects, and monitor runs. We recommend installing it for the best developer experience. </Tip>/trigger directory and create it with an example task.trigger.config.ts file in the root of your project.Install the "Hello World" example task when prompted. We'll use this task to test the setup.
</Step>