leadgrow-trigger-cli
v0.1.0
Published
Ops CLI for trigger.dev — wraps the Management API with multi-profile auth, agent-friendly YAML frontmatter output, and compound ops commands (health, failures, tail, replay-failed, diff-env, overview).
Maintainers
Readme
leadgrow-trigger-cli
Ops CLI for trigger.dev. Wraps the Management API so you can list runs, bulk-replay failures, diff env vars, and pause queues from the terminal — without writing one-off scripts or clicking around cloud.trigger.dev.
Pairs with the official trigger.dev CLI (which stays for init / dev / deploy). This one is for operators.
| | official trigger.dev | lg-trigger |
|--|:--:|:--:|
| init / dev / deploy | ✓ | — |
| List, replay, cancel runs | — | ✓ |
| Bulk-replay failed runs | — | ✓ |
| Manage schedules (CRUD + activate/deactivate) | — | ✓ |
| Manage env vars (CRUD + import from .env) | — | ✓ |
| Pause / resume queues, override concurrency | — | ✓ |
| Trigger tasks manually + batch-trigger | — | ✓ |
| Live tail of runs | — | ✓ |
| Health / overview / failures / diff-env | — | ✓ |
| Multi-profile (prod, staging, self-hosted) | Basic | ✓ |
| Agent-friendly YAML frontmatter output | — | ✓ |
Install
Not on npm yet — install from source.
macOS / Linux / WSL
git clone https://github.com/LeadGrowGTM/leadgrow-trigger.dev-cli.git
cd leadgrow-trigger.dev-cli && npm install && npm run build
npm link # makes `lg-trigger` available on your PATH
lg-trigger --helpWindows (PowerShell 5.1 or later)
PowerShell 5.1 doesn't support &&. Run each step on its own line:
git clone https://github.com/LeadGrowGTM/leadgrow-trigger.dev-cli.git
cd leadgrow-trigger.dev-cli
npm install
npm run build
npm link
lg-trigger --helpWindows (PowerShell 7+) / Git Bash / cmd
git clone https://github.com/LeadGrowGTM/leadgrow-trigger.dev-cli.git ; cd leadgrow-trigger.dev-cli ; npm install ; npm run build ; npm linkWithout npm link
If you prefer not to install globally, just run the built file directly:
node dist/index.js --helpInstall direct from Git (no clone)
npm install -g "git+https://github.com/LeadGrowGTM/leadgrow-trigger.dev-cli.git"Note: the repository URL contains a dot (
trigger.dev-cli). When pasting into PowerShell, quote any URL or path that contains a dot followed by a word character to avoid shell parsing surprises.
Quick start
# Interactive 5-step wizard — creates a profile, validates the PAT, links the Claude skill
lg-trigger setup
# Or skip the wizard
lg-trigger auth login --name prod \
--pat tr_pat_... \
--project-ref proj_apjuzrcpjamdlrayqcry
lg-trigger auth status # confirm you're wired up
lg-trigger overview # one-shot project summary
lg-trigger runs list --status FAILED --limit 10 # last 10 failures
lg-trigger docs # full referenceThe setup wizard walks through profile name → PAT → project ref → API URL → default env, tests the connection with a real runs.list call, saves to ~/.config/leadgrow-trigger-cli/config.json, and (optionally) symlinks the Claude Code skill into gtme-skills-mitch/skills/. Re-run it any time to add another profile (e.g. staging).
The seven commands you'll use most
lg-trigger overview # project summary
lg-trigger health # failures, paused queues, deactivated schedules
lg-trigger failures --since 24h # today's failures with first error line
lg-trigger tail --task webhook-sweep --status FAILED # live tail
lg-trigger replay-failed --task webhook-sweep --since 1h # bulk-replay (add --dry-run first!)
lg-trigger diff-env prod staging # env var diff between profiles
lg-trigger tasks trigger auto-ramp --payload '{}' # trigger a task manuallyAgent discovery (no MCP required)
One command gives any agent or script the full CLI surface in machine-readable form:
lg-trigger catalog --json # complete catalog
lg-trigger catalog --commands-only --group runs --json # filtered by groupEach command entry carries name, usage, description, args, options (with defaults), dangerous, needs_auth, examples, returns. The catalog also includes the global flag list, exit code map, and the envelope schema — enough for an LLM to plan a multi-step session without reading docs.
Agent-friendly output
Every command emits a YAML frontmatter envelope so LLMs and scripts can parse metadata without guessing:
---
tool: lg-trigger
command: runs list
status: ok
profile: prod
env: prod
project_ref: proj_apjuzrcpjamdlrayqcry
count: 10
next_cursor: run_abc123def
elapsed_ms: 412
ts: 2026-04-21T14:22:01Z
---
[{"id":"run_...","taskIdentifier":"auto-ramp","status":"COMPLETED","durationMs":12340,...}]Alternative output modes: -o json (raw JSON, no envelope), -o table (human view), -o yaml (full YAML doc), -o quiet (exit code only).
Full command surface
Run lg-trigger docs or lg-trigger docs <topic> for the full reference.
Resource groups (38 commands):
runs— list, get, replay, cancel, reschedule, poll, bulk-replay, bulk-cancelschedules— list, get, create, update, delete, activate, deactivate, timezonesenvvars— list, get, create, update, delete, importqueues— list, get, pause, resume, concurrency-override, concurrency-resettasks— trigger, batch-triggerauth— login, status, whoamiprofiles— list, use, remove
Compound ops (6 commands):
overview— project summaryhealth— failing runs + paused queues + deactivated schedulesfailures— recent failures with error messagestail— live poll-based tailreplay-failed— bulk-replay failed runs matching filtersdiff-env— env var diff between profiles
Authentication
Uses a trigger.dev Personal Access Token (tr_pat_*) for most operations. Create one at https://cloud.trigger.dev/account/tokens.
Resolution precedence:
- CLI flags (
--pat,--project-ref,--api-url) - Env vars (
TRIGGER_ACCESS_TOKEN,TRIGGER_PROJECT_REF,TRIGGER_API_URL) - Active profile from
~/.config/leadgrow-trigger-cli/config.json
Select a profile per-command with --profile <name> or set LG_TRIGGER_PROFILE.
Multi-profile
lg-trigger auth login --name prod --project-ref proj_prod...
lg-trigger auth login --name staging --project-ref proj_staging...
lg-trigger profiles list
lg-trigger runs list --profile staging --status FAILED
lg-trigger diff-env prod stagingExit codes
| Code | Meaning | |---|---| | 0 | Success | | 1 | Unknown error | | 2 | Auth / validation | | 3 | Not found | | 4 | Rate limited | | 5 | Server / network |
Development
npm install
npm run build # tsup
npm run test # vitest
npm run typecheck # tsc --noEmit
npm run dev # watch modeLicense
MIT © LeadGrow
