Skip to content
Reference

CLI reference

Every `stack` subcommand, every flag, every default — sourced from the citty `defineCommand` calls in `packages/cli/src/commands/`.

At a glance

stack ships with 47 top-level commands. The core loop is init → add → doctor — everything else is context, migration, or ops.

stack init Scaffold a .stack.toml in the current directory. stack import Import an existing .env into Phantom + .stack.toml. stack scan Detect providers used by this repo (package.json, config files, .env.example). stack clone Clone a GitHub repo and auto-detect its Stack services. stack add Provision a service and wire its secrets + MCP entry. stack remove Remove local service config and MCP wiring; attempt Phantom secret removal (headless runs may retain secrets). stack list List services configured in this stack. stack info Show everything Stack knows about a configured service. stack status Show stack health at a glance. stack env Inspect the effective env-var map for this stack. stack deps Show the service dependency graph for this stack. stack doctor Verify every service is reachable and credentials are valid. stack fleet-lanes Report lane targets, running and queued work, and dispatch idle reasons. stack fleet-supply Report hourly launches, observed lane idle minutes, restock errors and UTF-8 queue splits. stack fleet-latency Report per-repo median and p90 open-to-merge seconds for PRs merged in the last six hours. stack fleet-lag Report per-repo commits since latest tag, tag age and median time for the last 20 merged PRs. stack fleet-waste Report per-lane launches, empty finishes, precheck skips by code and unfinished jobs. stack fleet-reds List failed jobs and first failing tests in the latest completed schedule/push CI runs. stack fleet-silent Name silent fleet failures in author, dispatch and job logs (read-only JSON). stack fleet-collisions Rank touched files by open conflicting PR count from one repository's gh JSON. stack fleet-delivery-lag Report undeployed merged commits and merge wait from a read-only JSON fixture. stack fleet-stuck List open PRs by merge state, age and auto-merge status with server/ and lockfile path hints. stack fleet-slo Compare per-repo six-hour merges, open-to-merge latency and conflicting PRs with fleet SLO targets. stack fleet-act Preview fleet requests; --apply appends a v1 audit request for a dispatcher consumer. stack fleet-stream Translate fleet logs to typed NDJSON or localhost SSE. stack fleet-graph Emit schema-versioned fleet pool, job, and repository nodes and edges. stack worktree-disk Rank registered worktrees by disk usage (read-only). stack fleet-gc Dry-run report classifying fleet worktrees as preserved or collect-candidates (read-only). stack fleet-bets Score leader bets: join queue ledger ids with dispatch state and job outcomes for per-bet status and per-lane merged rate. stack fleet-match Map a job requirement to eligible fleet resources by capability, quota and availability. stack fleet-sheet-status Report per-sheet last successful sync and staleness, or reconcile one failed execution. stack fleet Show repository CI, open PR counts, and dispatcher lane status. stack exec Run a command with Phantom's secret proxy active. stack swap Migrate a project from one provider to an equivalent in the same category. stack sync Push secrets to a deployment platform (via phantom sync). stack onboard Detect Codex, Claude Code, Cursor and Gemini CLI and register the Phantom gateway in each (plan by default). stack open Open a service's dashboard in your browser. stack login Refresh OAuth / PAT credentials for a specific provider. stack telemetry Opt into / out of anonymous usage telemetry. See docs/PRIVACY.md. stack templates List or apply starter stack templates. stack providers List every curated provider Stack can wire up. stack recommend Pick the right providers for what you're building (AI-assisted). stack apply Apply a saved recipe: provision each provider, check its secrets in Phantom, and add webhook stubs. stack projects Manage the cross-project registry at ~/.stack/projects.json. stack ci CI workflow generation (unavailable; use `stack doctor` instead). stack completion Emit shell completion for bash, zsh, or fish. stack upgrade Check for a release or safely upgrade an npm global CLI install.

Global behaviour

  • Commands that mutate state (add, remove, import) refuse to run unless Phantom is on PATH.
  • Interactive commands auto-detect TTY. In non-interactive contexts (CI, an MCP tool call) they fall through to a sensible default or exit with a structured error instead of prompting.
  • All output honours NO_COLOR. Structured JSON is available on stack doctor --json for CI.
  • Exit codes: 0 on success, 1 on any failure that wasn't a cancellation, 127 if a required dependency (Phantom, git) isn't installed.

stack init

Scaffold a .stack.toml in the current directory.

Warns (but proceeds) if Phantom isn't on $PATH. `stack add` requires Phantom; `stack init` does not.

Synopsis

stack init [--template <template>] [--force] [--noInteractive] [--noProvision] [--dryRun] [--noRollback]

Flags

Flag Type Description
--template <template> string Name of a starter template to apply (e.g. nextjs-supabase-posthog).
--force boolean
default: false
Overwrite an existing .stack.toml.
--noInteractive boolean
default: false
Skip template picker — always creates a blank .stack.toml.
--noProvision boolean
default: false
Write the .stack.toml shape from the template but skip provisioning services.
--dryRun boolean
default: false
Print what would be provisioned without doing it (implies --noProvision for real calls).
--noRollback boolean
default: false
On partial provisioning failure, keep successfully-added services instead of rolling them back.

Examples

stack init

# apply a starter template up front
stack init --template nextjs-supabase-posthog

# CI-safe blank init
stack init --noInteractive

stack import

Import an existing .env into Phantom + .stack.toml.

Routes every secret into Phantom, then best-guesses which provider each belongs to and writes matching service entries into .stack.toml.

Synopsis

stack import [--from <path>] [--dryRun] [--json]

Flags

Flag Type Description
--from <path> string
default: .env
Path to the .env file to import.
--dryRun boolean
default: false
Print what would happen without writing anything.
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.import/v1, names only): what was stored, skipped and wired.

Examples

stack import

stack import --from .env.local --dryRun

stack scan

Detect providers used by this repo (package.json, config files, .env.example).

Synopsis

stack scan [--path <path>] [--auto] [--yes] [--confidence <low|medium|high>] [--json]

Flags

Flag Type Description
--path <path> string
default: .
Directory to scan.
--auto boolean
default: false
After scanning, offer to run `stack add` for each detected provider.
--yes boolean
default: false
Non-interactive: accept all hits at/above --confidence threshold. Implies --auto.
--confidence <low|medium|high> string
default:
Minimum confidence to surface/act on: low | medium | high.
--json boolean
default: false
Output detection results as JSON and exit 0. No prompts, no add.

Examples

stack scan

# auto-wire only signals we're sure about
stack scan --auto --confidence high

stack clone

Clone a GitHub repo and auto-detect its Stack services.

After cloning, runs `stack scan` automatically. If the repo already ships a committed .stack.toml, it prints next-step guidance instead.

Synopsis

stack clone <url> [dir]

Flags

Flag Type Description
<url> req positional GitHub / git URL to clone.
[dir] positional Optional target directory.

Examples

stack clone https://github.com/acme/webapp

stack clone git@github.com:acme/webapp.git my-app

stack add

Provision a service and wire its secrets + MCP entry.

Requires Phantom to be on $PATH. Runs the provider's four-step lifecycle: login → provision → materialize → persist.

Synopsis

stack add [service] [--use <id>] [--region <region>] [--dryRun] [--install <mode>]

Flags

Flag Type Description
[service] positional Service name (e.g. supabase, neon, vercel). Omit for interactive picker.
--use <id> string Attach to an existing resource by id instead of creating a new one.
--region <region> string Region hint for providers that need one (e.g. us-east-1).
--dryRun boolean
default: false
Preview what would happen (no network calls, no vault writes, no MCP edits).
--install <mode> string
default: ask
SDK install behaviour after provisioning: ask (default), always, never.

Examples

stack add supabase

stack add neon --region us-east-2

# attach to an existing Vercel project
stack add vercel --use prj_abc123

stack add --dryRun

stack remove

Remove local service config and MCP wiring; attempt Phantom secret removal (headless runs may retain secrets).

Synopsis

stack remove [service] [--all] [--allOrphans] [--keepRemote] [--json]

Flags

Flag Type Description
[service] positional Service name. Omit with --all to remove every service.
--all boolean
default: false
Remove every local service entry; prompt for confirmation in a terminal.
--allOrphans boolean
default: false
Detect services in .stack.toml no longer present in source, then remove their local entries.
--keepRemote boolean
default: false
Compatibility flag; upstream resources are kept for every removal.
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.remove/v1) naming the secrets Phantom kept. Never prompts.

Examples

stack remove supabase

stack remove --all --keepRemote

stack list

List services configured in this stack.

Synopsis

stack list [--json]

Flags

Flag Type Description
--json boolean Emit machine-readable JSON (schema ashlr.stack.list/v1).

Examples

stack list

# ashlr.stack.list/v1 for agents
stack list --json

stack info

Show everything Stack knows about a configured service.

Prints provider, resource id, region, secret slots (with vault presence), MCP wiring, dashboard URL, and runs a fresh healthcheck.

Synopsis

stack info <service> [--json]

Flags

Flag Type Description
<service> req positional Service name.
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.info/v1, secret names only).

Examples

stack info supabase

stack status

Show stack health at a glance.

Synopsis

stack status [--json]

Flags

Flag Type Description
--json boolean Emit machine-readable JSON (schema ashlr.stack.status/v1).

Examples

stack status

stack env

Inspect the effective env-var map for this stack.

Synopsis

stack env <show|export|diff>

Flags

Flag Type Description
--env <env> string
default: dev
Environment overlay to preview.
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.env/v1, secret names only).

Subcommands

stack env show Show which secrets are present in Phantom.
stack env show [--env <env>] [--json]
Flag Type Description
--env <env> string
default: dev
Environment overlay to preview.
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.env/v1, secret names only).
stack env show

stack env show --env prod
stack env export Write a .env.example skeleton from the catalog secrets.
stack env export [--example] [--stdout] [--force]
Flag Type Description
--example boolean
default: false
Write .env.example (required flag to distinguish from future sub-verbs).
--stdout boolean
default: false
Print to stdout instead of writing a file.
--force boolean
default: false
Overwrite an existing .env.example without prompting.
stack env export --example

stack env export --stdout
stack env diff Which declared secrets are missing from the vault?
stack env diff [--json]
Flag Type Description
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.env-diff/v1, secret names only). Exits 1 when any are missing.
stack env diff

stack deps

Show the service dependency graph for this stack.

Renders an ASCII tree grouped by category, with every secret slot annotated beneath its service.

Synopsis

stack deps [--json]

Flags

Flag Type Description
--json boolean Emit machine-readable JSON (schema ashlr.stack.deps/v1).

Examples

stack deps

# ashlr.stack.deps/v1 for agents
stack deps --json

stack doctor

Verify every service is reachable and credentials are valid.

Synopsis

stack doctor [--fix] [--all] [--json] [--ecosystem] [--install] [--apply] [--repos] [--reconcile]

Flags

Flag Type Description
--fix boolean
default: false
Attempt to auto-remediate by re-running `stack add` for failing services.
--all boolean
default: false
Run doctor across every registered project on this machine.
--json boolean
default: false
Emit machine-readable JSON (exit 0/1 on pass/fail). CI-friendly.
--ecosystem boolean
default: false
Show installed and missing Ashlr tools, with a fix for each missing tool. Read-only; never fails.
--install boolean With --ecosystem: print install commands for missing or outdated companions (optional comma list: phantom, locus, lexicon, ashlr-md). Runs nothing without --apply.
--apply boolean With --ecosystem --fix or --install: run the step for these tools only (comma list, e.g. lexicon). Required per tool.
--repos boolean
default: false
Check default-branch CI and open PR counts across seven Ashlr repos via gh.
--reconcile boolean
default: false
Check whether .stack.toml services are still present in source code.

Examples

stack doctor

stack doctor --fix

# CI-friendly
stack doctor --json > report.json

# every Stack project on this box
stack doctor --all

stack fleet-lanes

Report lane targets, running and queued work, and dispatch idle reasons.

Synopsis

stack fleet-lanes [--json] [--queue <queue>]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON; null idleReason means ready to dispatch.
--queue <queue> string Fleet state directory (default: ~/.ashlr-runs/queue).

stack fleet-supply

Report hourly launches, observed lane idle minutes, restock errors and UTF-8 queue splits.

Synopsis

stack fleet-supply [--json] [--queue <queue>] [--log <log>]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON; unavailable metrics are null.
--queue <queue> string Queue directory (default: ~/.ashlr-runs/queue).
--log <log> string Dispatcher log (default: dispatchd.log beside queue directory).

stack fleet-latency

Report per-repo median and p90 open-to-merge seconds for PRs merged in the last six hours.

Synopsis

stack fleet-latency [--json]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON; missing percentiles are null.

stack fleet-lag

Report per-repo commits since latest tag, tag age and median time for the last 20 merged PRs.

Read-only via Locus. Latest tag is ordered by underlying commit date; age uses the annotated tagger date or lightweight commit date. Compares that tag to the default branch. Median seconds use the latest 20 merge timestamps across all base branches, or all merged PRs if fewer. No tags and unavailable repositories remain in the report; unknown metrics are null.

Synopsis

stack fleet-lag [--json]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON; unavailable metrics are null.

Examples

stack fleet-lag --json

stack fleet-waste

Report per-lane launches, empty finishes, precheck skips by code and unfinished jobs.

Read-only JSON, including empty files. Defaults to ~/.ashlr-runs/metrics/jobs.jsonl. Inclusive trailing window, default one hour. Events use ISO ts (or timestamp), event, lane and job; finish.empty must be true to count as empty. Launches and empties count events; precheckSkip groups skips by code (unknown if absent/invalid). neverFinished counts unique jobs launched in the window without a finish at or after their latest launch, as of windowEnd; unfinishedJobs lists their ids. File order does not matter. Malformed rows are skipped and counted; unrelated events and out-of-window rows are ignored. Missing/unreadable files fail without exposing raw input.

Synopsis

stack fleet-waste [--metrics <metrics>] [--hours <hours>] [--json]

Flags

Flag Type Description
--metrics <metrics> string Job event JSONL (default: ~/.ashlr-runs/metrics/jobs.jsonl).
--hours <hours> string
default: 1
Positive trailing window in hours; fractional hours accepted.
--json boolean Emit schemaVersion 1 JSON (also the default).

Examples

stack fleet waste --json

stack fleet-waste --metrics ~/.ashlr-runs/metrics/jobs.jsonl --hours 6

stack fleet-reds

List failed jobs and first failing tests in the latest completed schedule/push CI runs.

Read-only via Locus. JSON is the default. For each of the seven fleet repositories, selects the latest completed workflow named CI on its default branch for each event (schedule and push), then lists failed jobs only when that run failed. A newer successful run clears older failures. no-runs means no completed run; unavailable and partial mean incomplete reads. firstFailingTest is null for unrecognized output or expired logs; logStatus distinguishes these cases. Parses Vitest, node:test TAP/spec and nextest text output. Raw logs and API errors are omitted.

Synopsis

stack fleet-reds [--json]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON (also the default).

Examples

stack fleet-reds --json

stack fleet-silent

Name silent fleet failures in author, dispatch and job logs (read-only JSON).

Read-only JSON. Reads top-level *author*.log files, dispatchd.log, dispatch-events.log and metrics/jobs.jsonl; missing/invalid sources are reported, never treated as healthy. Inputs are JSONL or timestamped key=value lines (naive timestamps are local). Fully dated logs use event order; legacy undated logs use append order. Author summaries use status=ok to clear older failures; lane summaries use lane (or pool), need and picked. Reports the latest positive need with zero picks per lane, ten explicit empty:true finish events per lane, and no fleet-wide launch for at least 20 minutes of observed dispatch/job history. Launch/tick timestamps are required; ticks use a nonnegative launched count. Malformed inputs suppress latest/absence claims. FIXUP reuse means the same job id launched on distinct UTC days; finishes crossing midnight do not count. Metrics use event, job, lane, empty and timestamp (or ts). Reads are capped at 16 MiB per regular file; symlink files and raw log bodies are excluded.

Synopsis

stack fleet-silent [--runs <runs>] [--json]

Flags

Flag Type Description
--runs <runs> string Runs directory (default: ~/.ashlr-runs).
--json boolean Emit schemaVersion 1 JSON (also the default).

Examples

stack fleet-silent --runs /path/to/runs --json

stack fleet-collisions

Rank touched files by open conflicting PR count from one repository's gh JSON.

Read-only JSON for one repository per snapshot. Includes only OPEN, CONFLICTING PRs; UNKNOWN mergeability is excluded. Files rank by distinct PR count, then path. Paths are touched files, not confirmed conflict hunks. Counts cover only the supplied snapshot; ensure the gh limit covers all PRs. Empty input arrays yield files: []; invalid input exits nonzero.

Synopsis

stack fleet-collisions [--file <file>] [--json]

Flags

Flag Type Description
--file <file> string Input JSON file; omit or use - for stdin.
--json boolean Emit schemaVersion 1 JSON (also the default).

Examples

locus exec -- gh pr list --state open --limit 1000 --json number,state,mergeable,files | stack fleet-collisions

stack fleet collisions --file prs.json

stack fleet-delivery-lag

Report undeployed merged commits and merge wait from a read-only JSON fixture.

Synopsis

stack fleet-delivery-lag --fixture <fixture> [--json]

Flags

Flag Type Description
--fixture <fixture> req string JSON snapshot: latestDeployed {version, commits: SHA[]}, commits {sha, createdAt, mergedAt: UTC ISO|null}[].
--json boolean Emit schemaVersion 1 JSON; unknown metrics are null.

stack fleet-stuck

List open PRs by merge state, age and auto-merge status with server/ and lockfile path hints.

Read-only via Locus. JSON is the default. Lists every open PR, sorted by merge state then descending age in days since creation. Auto-merge-off path reasons identify server/ directories and common lockfiles, including renamed paths; these are hints, not GitHub's explanation. Empty repositories have prs: []; unavailable or incomplete reads have prs: null.

Synopsis

stack fleet-stuck [--json]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON (also the default).

Examples

stack fleet-stuck --json

stack fleet-slo

Compare per-repo six-hour merges, open-to-merge latency and conflicting PRs with fleet SLO targets.

Read-only via Locus. The window is the last six hours. Merge volume, median and p90 open-to-merge seconds come from the same source as stack fleet-latency; open and conflicting PR counts come from a paginated open-PR scan that counts only GitHub-reported CONFLICTING nodes. Targets: 20 merges per window in ashlrai/phantom and a median open-to-merge of 300 seconds; unavailable metrics and inapplicable targets are null.

Synopsis

stack fleet-slo [--json]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON; unavailable metrics and inapplicable targets are null.

Examples

stack fleet-slo --json

stack fleet slo --json

stack fleet-act

Preview fleet requests; --apply appends a v1 audit request for a dispatcher consumer.

Synopsis

stack fleet-act <verb> [--lane <lane>] [--job <job>] [--slots <slots>] [--message <message>] [--queue <queue>] [--apply] [--dryRun] [--json]

Flags

Flag Type Description
<verb> req positional pause, resume, kill, reassign, slots or steer.
--lane <lane> string Lane identifier (pause/resume/reassign/slots).
--job <job> string Job identifier (kill/reassign/steer).
--slots <slots> string Nonnegative integer target (slots).
--message <message> string Steering text; never include secrets (steer).
--queue <queue> string Queue directory (default: ~/.ashlr-runs/queue).
--apply boolean Append request to fleet-act.audit.jsonl; does not execute it.
--dryRun boolean Preview without writing (default).
--json boolean Emit schemaVersion 1 JSON.

stack fleet-stream

Translate fleet logs to typed NDJSON or localhost SSE.

Synopsis

stack fleet-stream [--dispatch <dispatch>] [--jobs <jobs>] [--follow] [--sse] [--port <port>]

Flags

Flag Type Description
--dispatch <dispatch> string Path to dispatch-events.log.
--jobs <jobs> string Path to metrics/jobs.jsonl.
--follow boolean Follow appended records (NDJSON).
--sse boolean Serve a live stream at http://127.0.0.1:8788/events.
--port <port> string
default: 8788
Local SSE port (0 selects a free port).

stack fleet-graph

Emit schema-versioned fleet pool, job, and repository nodes and edges.

Synopsis

stack fleet-graph [--json] [--queue <queue>] [--router <router>]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON (also the default).
--queue <queue> string Fleet state directory (default: ~/.ashlr-runs/queue).
--router <router> string Router JSON array or JSONL path (default: <queue>/queue.jsonl).

stack worktree-disk

Rank registered worktrees by disk usage (read-only).

Synopsis

stack worktree-disk [--repo <repo>] [--base <base>] [--json]

Flags

Flag Type Description
--repo <repo> string Repository path (default: current directory).
--base <base> string Merge target (default: origin/HEAD, or main).
--json boolean Emit schemaVersion 1 JSON.

stack fleet-gc

Dry-run report classifying fleet worktrees as preserved or collect-candidates (read-only).

Synopsis

stack fleet-gc [--json] [--root <root>] [--runs <runs>] [--queue <queue>] [--reapIdleHours <reapIdleHours>] [--emptyIdleHours <emptyIdleHours>] [--budgetSeconds <budgetSeconds>] [--ghBin <ghBin>] [--lsofBin <lsofBin>] [--ghMax <ghMax>] [--dryRun]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON.
--root <root> string Worktree root (default: ~/Projects/ashlrai/wt).
--runs <runs> string Fleet runs dir (default: ~/.ashlr-runs); queue defaults to <runs>/queue.
--queue <queue> string Queue dir override (default: <runs>/queue).
--reapIdleHours <reapIdleHours> string Idle hours before RESULT PR worktrees are candidates (default 2).
--emptyIdleHours <emptyIdleHours> string Idle hours before done/empty worktrees are candidates (default 6).
--budgetSeconds <budgetSeconds> string Seconds allowed for deep git/tree/gh inspection (default 120).
--ghBin <ghBin> string gh binary override (default: PATH/install paths).
--lsofBin <lsofBin> string lsof binary override (default: system lsof).
--ghMax <ghMax> string Cap on gh pr view calls (default 40).
--dryRun boolean Accepted for explicitness; this command is always a dry run.

stack fleet-bets

Score leader bets: join queue ledger ids with dispatch state and job outcomes for per-bet status and per-lane merged rate.

Read-only. Bets are job ids on `- STATUS <id> (attrs)` lines of the leader queue ledger whose attrs carry src=leader (`--src` selects another marker). Queue state comes from ready.tsv; launch, finish, publish and outcome events come from metrics/jobs.jsonl (tail-read at 32 MiB). Statuses: vanished (no trace), waiting (queued), running (launched), empty (resolved with no merge: empty finish, empty publish, precheck skip or a terminal non-merge outcome), open (PR open or unresolved non-empty work) and merged (outcome state MERGED). Ledger MERGED/LANDED/DONE/PR-OPEN statuses are fallbacks when local evidence is absent. mergedRate is merged over resolved (merged + empty) bets per lane; null when nothing resolved.

Synopsis

stack fleet-bets [--json] [--queue <queue>] [--router <router>] [--ready <ready>] [--metrics <metrics>] [--src <src>]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON; open covers unresolved work, mergedRate uses resolved bets.
--queue <queue> string Fleet state directory (default: ~/.ashlr-runs/queue).
--router <router> string Leader queue ledger path (default: <queue>/router-queue.md).
--ready <ready> string Dispatch queue TSV (default: <queue>/ready.tsv).
--metrics <metrics> string Job outcomes JSONL (default: <runs>/metrics/jobs.jsonl).
--src <src> string Source marker selecting bets (default: leader).

Examples

stack fleet-bets --json

stack fleet-match

Map a job requirement to eligible fleet resources by capability, quota and availability.

Read-only. Joins slots.json quota, journal running/queued counts, capabilities.json role/capability/tier declarations and models.json into one capability matrix, then reports which resources are eligible for a requirement and why the rest are not. Matching never branches on a provider or lane name; undeclared resources serve the implementer role on every tier, the same contract dispatchd applies today. It does not change dispatchd lane admission. Declare resources in capabilities.json beside the queue directory ({ "schema": "fleet.capabilities.v1", "resources": { "<id>": { "roles": [...], "capabilities": [...], "tiers": [...] } } }); absent or invalid declarations fall back to the implementer default and are counted in capabilitiesDropped.

Synopsis

stack fleet-match [--json] [--queue <queue>] [--role <role>] [--capability <capability>] [--tier <tier>] [--job <job>] [--capabilitiesFile <capabilitiesFile>] [--modelsFile <modelsFile>]

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON.
--queue <queue> string Fleet queue directory (default: ~/.ashlr-runs/queue).
--role <role> string Required role: planner, implementer, reviewer, release-verifier.
--capability <capability> string Comma-separated capability tags the resource must declare.
--tier <tier> string Required tier (e.g. frontier, work, mid, fast).
--job <job> string Derive the requirement from a queued job id (ready.tsv + journals).
--capabilitiesFile <capabilitiesFile> string Capabilities file (default: capabilities.json beside the queue directory).
--modelsFile <modelsFile> string Models file (default: models.json beside the queue directory).

Examples

stack fleet-match --json

stack fleet-match --role reviewer --json

stack fleet-match --job RQ-123 --json

stack fleet-sheet-status

Report per-sheet last successful sync and staleness, or reconcile one failed execution.

Read-only. Reads the stacksync job-run JSONL table (fleet.job-run.v1 records; default ~/.ashlr-runs/stacksync/job-runs.jsonl) and reports one row per sheet: last successful write, its age, attempts since, and a state of ok, overdue (past --expect cadence), failing or never-ok, worst first. With --execution it reconciles one run: recovered when a later execution wrote that sheet, still-stale otherwise, not-found when no record carries the id, unknown when the table itself cannot be read. A run only counts as a write when it is ok and a write_sheet* stage is ok. Reads are capped, malformed lines flag the source but keep good rows, and raw row contents are never echoed.

Synopsis

stack fleet-sheet-status [--runs <runs>] [--sheet <sheet>] [--execution <execution>] [--expect <expect>] [--json]

Flags

Flag Type Description
--runs <runs> string Job-run JSONL table (default: ~/.ashlr-runs/stacksync/job-runs.jsonl).
--sheet <sheet> string Restrict the report to one sheet name.
--execution <execution> string Reconcile one execution id: did a later sync write its sheet, or is it still stale?
--expect <expect> string Expected sync cadence in ms; an ok sheet whose last write is older is reported overdue.
--json boolean Emit schemaVersion 1 JSON.

Examples

stack fleet-sheet-status --json

stack fleet sheet-status --execution 5d2b848b

stack fleet

Show repository CI, open PR counts, and dispatcher lane status.

Synopsis

stack fleet <slo|collisions|waste|sheet-status>

Flags

Flag Type Description
--json boolean Emit schemaVersion 1 JSON.
--log <log> string Dispatcher log path (default: ~/.ashlr-runs/dispatchd.log).
--queue <queue> string Dispatcher queue directory (default: ~/.ashlr-runs/queue).

Subcommands

stack fleet slo Compare per-repo six-hour merges, open-to-merge latency and conflicting PRs with fleet SLO targets.
stack fleet slo [--json]
Flag Type Description
--json boolean Emit schemaVersion 1 JSON; unavailable metrics and inapplicable targets are null.
stack fleet slo --json
stack fleet collisions Rank touched files by open conflicting PR count from one repository's gh JSON.
stack fleet collisions [--file <file>] [--json]
Flag Type Description
--file <file> string Input JSON file; omit or use - for stdin.
--json boolean Emit schemaVersion 1 JSON (also the default).
stack fleet waste Report per-lane launches, empty finishes, precheck skips by code and unfinished jobs.
stack fleet waste [--metrics <metrics>] [--hours <hours>] [--json]
Flag Type Description
--metrics <metrics> string Job event JSONL (default: ~/.ashlr-runs/metrics/jobs.jsonl).
--hours <hours> string
default: 1
Positive trailing window in hours; fractional hours accepted.
--json boolean Emit schemaVersion 1 JSON (also the default).
stack fleet waste --json
stack fleet sheet-status Report per-sheet last successful sync and staleness, or reconcile one failed execution.
stack fleet sheet-status [--runs <runs>] [--sheet <sheet>] [--execution <execution>] [--expect <expect>] [--json]
Flag Type Description
--runs <runs> string Job-run JSONL table (default: ~/.ashlr-runs/stacksync/job-runs.jsonl).
--sheet <sheet> string Restrict the report to one sheet name.
--execution <execution> string Reconcile one execution id: did a later sync write its sheet, or is it still stale?
--expect <expect> string Expected sync cadence in ms; an ok sheet whose last write is older is reported overdue.
--json boolean Emit schemaVersion 1 JSON.
stack fleet sheet-status --json

stack exec

Run a command with Phantom's secret proxy active.

Thin wrapper over `phantom exec` so env vars with phm_ tokens get swapped for real secrets at the network layer.

Synopsis

stack exec [--as <as>]

Flags

Flag Type Description
--as <as> string Refuse (exit 1, nothing starts) unless this Locus binding alias is pinned (needs `--`)

Examples

stack exec -- bun dev

stack exec -- npm test

stack swap

Migrate a project from one provider to an equivalent in the same category.

Synopsis

stack swap <from> <to> [--dryRun] [--noRollback] [--keepFrom]

Flags

Flag Type Description
<from> req positional Provider to remove (e.g. clerk).
<to> req positional Provider to provision (e.g. auth0).
--dryRun boolean
default: false
Print the plan without executing any steps.
--noRollback boolean
default: false
On failure, leave partial state in place instead of rolling back.
--keepFrom boolean
default: false
Provision `to` without removing `from` (side-by-side migration).

stack sync

Push secrets to a deployment platform (via phantom sync).

Synopsis

stack sync --platform <name>

Flags

Flag Type Description
--platform <name> req string One of: vercel, railway, fly

Examples

stack sync --platform vercel

stack onboard

Detect Codex, Claude Code, Cursor and Gemini CLI and register the Phantom gateway in each (plan by default).

Synopsis

stack onboard [--apply] [--undo] [--client <client>] [--all] [--home <home>] [--json]

Flags

Flag Type Description
--apply boolean Write the changes. Without this flag nothing is written.
--undo boolean Restore the files saved by the last --apply.
--client <client> string Comma list: claude,codex,cursor,gemini. Default: all.
--all boolean Also wire clients that are not detected.
--home <home> string Home directory to use (default: your home).
--json boolean Emit JSON.

Examples

plan only, nothing is written
stack onboard

stack onboard --apply

stack onboard --undo

stack open

Open a service's dashboard in your browser.

Synopsis

stack open <service>

Flags

Flag Type Description
<service> req positional Service name.

Examples

stack open supabase

stack open vercel

stack login

Refresh OAuth / PAT credentials for a specific provider.

Synopsis

stack login <service>

Flags

Flag Type Description
<service> req positional Provider name.

Examples

stack login github

stack login supabase

stack telemetry

Opt into / out of anonymous usage telemetry. See docs/PRIVACY.md.

Synopsis

stack telemetry <status|enable|disable>

Subcommands

stack telemetry status Show telemetry opt-in status.
stack telemetry status
stack telemetry enable Opt in to anonymous usage telemetry.
stack telemetry enable
stack telemetry disable Opt out of telemetry.
stack telemetry disable

stack templates

List or apply starter stack templates.

Synopsis

stack templates <list|apply>

Flags

Flag Type Description
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.templates/v1).

Subcommands

stack templates list List available templates.
stack templates list [--json]
Flag Type Description
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.templates/v1).
stack templates list
stack templates apply Apply a template — runs `stack add` for each service listed.
stack templates apply <name> [--continueOnError]
Flag Type Description
<name> req positional Template name.
--continueOnError boolean
default: true
Keep going when a single service fails (default: true).
stack templates apply nextjs-supabase-posthog

stack providers

List every curated provider Stack can wire up.

Synopsis

stack providers [--category <category>] [--json]

Flags

Flag Type Description
--category <category> string Only this category, any case (database, deploy, cloud, ai, analytics, observability, errors, payments, code, tickets, email, auth, featureflags).
--json boolean Emit machine-readable JSON (schema ashlr.stack.providers/v1).

Examples

stack providers

# ashlr.stack.providers/v1 for agents
stack providers --json

stack recommend

Pick the right providers for what you're building (AI-assisted).

Synopsis

stack recommend [query] [--k <n>] [--category <category>] [--json] [--save] [--synth]

Flags

Flag Type Description
[query] positional Free-text description of the project (in quotes).
--k <n> string Max results to return (default 6).
--category <category> string Restrict to a single category, any case (Database, Deploy, Cloud, AI, Analytics, Observability, Errors, Payments, Code, Tickets, Email, Auth, FeatureFlags).
--json boolean Machine-readable JSON output.
--save boolean Persist the result as .stack/recipes/<id>.toml so you can run `stack apply <id>`.
--synth boolean Call the local SLM (LM Studio / Ollama) to synthesize rationales. Silently falls back to retrieval-only when no endpoint is reachable.

Examples

stack recommend "next.js app with auth and postgres"

stack recommend --json "realtime websockets"

stack apply

Apply a saved recipe: provision each provider, check its secrets in Phantom, and add webhook stubs.

The golden path is `stack recommend --save && stack apply <id>`. Auto-inits a blank .stack.toml if none exists.

Synopsis

stack apply [id] [--noWire] [--noRollback] [--dryRun]

Flags

Flag Type Description
[id] positional Recipe id (filename stem in .stack/recipes). Omit for picker.
--noWire boolean
default: false
Skip the Phantom vault check and webhook stubs.
--noRollback boolean
default: false
On partial failure, leave successfully-added services in .stack.toml instead of rolling them back.
--dryRun boolean
default: false
Preview provisioning and wiring without making changes.

Examples

stack apply

stack apply my-recipe

stack projects

Manage the cross-project registry at ~/.stack/projects.json.

Synopsis

stack projects <list|register|remove|where>

Flags

Flag Type Description
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.projects/v1).

Subcommands

stack projects list List every Stack-enabled project on this machine.
stack projects list [--json]
Flag Type Description
--json boolean
default: false
Emit machine-readable JSON (schema ashlr.stack.projects/v1).
stack projects list
stack projects register Register the current directory in the registry.
stack projects register
stack projects register
stack projects remove Remove a project from the registry (does not delete files).
stack projects remove <name|path>
Flag Type Description
<name|path> req positional Project name or absolute path.
stack projects remove my-app
stack projects where Print the path of a registered project.
stack projects where <name>
Flag Type Description
<name> req positional Project name.
# jump into a project by name
cd $(stack projects where my-app)

stack ci

CI workflow generation (unavailable; use `stack doctor` instead).

Synopsis

stack ci <init>

Flags

Flag Type Description
--json boolean
default: false
Emit the refusal as JSON ({ error }) on stdout.

Subcommands

stack ci init Unavailable: refuses with what to run instead (stack doctor). Never writes a workflow.
stack ci init [--force] [--json]
Flag Type Description
--force boolean
default: false
Compatibility flag; generation is unavailable and no workflow is overwritten.
--json boolean
default: false
Emit the refusal as JSON ({ error }) on stdout.
stack ci init

stack completion

Emit shell completion for bash, zsh, or fish.

Synopsis

stack completion <shell>

Flags

Flag Type Description
<shell> req positional One of: bash, zsh, fish.

Examples

stack completion zsh > ~/.local/share/zsh/site-functions/_stack

stack completion bash | sudo tee /etc/bash_completion.d/stack

stack completion fish > ~/.config/fish/completions/stack.fish

stack upgrade

Check for a release or safely upgrade an npm global CLI install.

Checks npm by default. --apply upgrades an npm global CLI install with local rollback on failed health checks; --dryRun never installs.

Synopsis

stack upgrade [--apply] [--dryRun] [--json]

Flags

Flag Type Description
--apply boolean
default: false
Upgrade the npm global CLI, restoring the previous install on failed health checks.
--dryRun boolean Print what would be installed without changing the installation.
--json boolean
default: false
Emit a machine-readable upgrade report without a banner.

Examples

stack upgrade

stack upgrade --apply