@triggery/cli
v0.10.0
Published
Command-line interface for Triggery — create, scaffold, graph, lint.
Maintainers
Readme
@triggery/cli
Command-line companion for Triggery. Scaffolds projects, generates trigger files, prints the trigger graph, and runs ESLint with @triggery/eslint-plugin baked in.
pnpm add -D @triggery/cli
# or one-shot:
npx @triggery/cli <command>Commands
triggery create <directory> [--template vite-react|next-app|react-native]
Downloads the corresponding starter template from templates/<name> in this repo (via giget) and writes it to <directory>. Defaults to vite-react.
triggery create my-chat --template vite-react
cd my-chat
pnpm install
pnpm devtriggery scaffold trigger <name>
Generates src/triggers/<name>.trigger.ts with a minimal createTrigger stub. Use --out-dir <path> to point at a different directory.
triggery graph [directory]
Statically walks <directory> for *.trigger.ts files, extracts each createTrigger({ id, events, required }) call, and prints a graph. Format selection:
triggery graph . --format md > docs/triggers.md
triggery graph . --format dot --out triggery.dot && dot -Tsvg triggery.dot -o triggery.svg
triggery graph . --format jsontriggery lint [...paths]
Thin wrapper around the local eslint binary. Install eslint and @triggery/eslint-plugin alongside, set up the flat config (see @triggery/eslint-plugin README), then triggery lint src. Adds --fix for auto-fixable suggestions.
Programmatic API
import { buildTriggerGraph, renderGraph, scaffoldTrigger, createProject } from '@triggery/cli';
const nodes = buildTriggerGraph({ cwd: process.cwd() });
console.log(renderGraph(nodes, 'md'));Documentation
Full documentation, recipes and API reference at https://triggeryjs.github.io/packages/cli/.
Related packages
@triggery/eslint-plugin— Lint rules invoked bytriggery lint.@triggery/codemod— Migration codemods invoked by the CLI.@triggery/vite— Vite plugin for auto-discovery.
See the full package list in the repo README.
License
MIT © Aleksey Skhomenko
