Skip to Content

CLI reference

Complete matrix of pitafix CLI commands, flags, --json outputs, exit codes, and environment variables.

View .md~1.6k tokens

Binary paths live in Start here. Run pitafix help or pitafix help <command> for live usage from the installed binary.

Exit codes

CodeMeaning
0Success (or -h / --help)
1Runtime error (missing git root commit, store/IO error, capture or doctor failure)
2CLI usage error (unknown command, bad flag, missing positional argument)
3Tree-sitter parser library unavailable (pitafix index when libpitafix-ts cannot load)

Command matrix

CommandFlags--jsonPurpose
pitafix record run--project, --config, --commit, --diff-scoped, --no-replace, --timeout, --browser, --cef-host, --allow-host, --json, -- <command...>YesStarts authenticated localhost recorder, runs .pitafix/capture.json (or --config / -- <command>), and ingests traces.
pitafix record serve--project, --browser, --cef-host, --allow-host, --jsonYesStarts standalone recording daemon; --json prints one-line {url, token, attributionUrl}.
pitafix ingest <dir>...--project, --jsonYesIngests one or more Level-0 pitafix.trace/1 run folders into the project store.
pitafix affected--project, --from, --since, --to, --jsonYesMaps git changes onto affected journeys, screens, and newly dark files.
pitafix map--project, --section, --jsonYesShows behavioral areas, totals, freshness, and unreached routes.
pitafix ops--project, --category, --section, --query, --limit, --jsonYesLists canonical operations (op_<hex>).
pitafix op <id>--project, --tier, --include-ui, --limit, --jsonYesInspects one operation's outcomes, UI triggers, tiered code, and server effects.
pitafix components--project, --platform, --device, --kind, --finds, --limit, --read, --at, --since, --intend, --reason, --unintend, --jsonYesAnalyzes screenshots, lists UI components/finds, diffs commits, or marks finds intentional.
pitafix component <name>--project, --platform, --device, --kind, --read, --jsonYesInspects one component's call sites, undrawn calls, visual states, and state-specific code.
pitafix scale--project, --platform, --device, --measure, --limit, --jsonYesLists kept visual scale values (gap, corner, text, fill, ink) and departures.
pitafix hot--project, --tier, --repo, --sample, --limit, --jsonYesRanks non-accessor symbols by share of sampled steps.
pitafix dark--project, --prefix, --repo, --include-tests, --exact, --limit, --jsonYesLists tracked source files with zero captured execution plus unreached routes.
pitafix blueprint import <path>--jsonYesValidates and stores an immutable SHA-256 verified blueprint folder or archive.
pitafix blueprint list--jsonYesLists imported blueprints and versions.
pitafix blueprint attach <id>--project, --version, --stack, --module, --jsonYesAttaches a blueprint to a project (auto-detects stacks when --stack omitted).
pitafix blueprint show--project, --jsonYesPrints the project's attached blueprint, active stacks/modules, rules, and gates.
pitafix blueprint detach--project, --jsonYesDetaches the active blueprint from a project.
pitafix blueprint remove <id>--version, --jsonYesRemoves an imported blueprint version from the local library.
pitafix mcp--project, --agent, --run, --record, --browser, --cef-host, --allow-hostN/AServes the stdio MCP server for coding agents (--record adds live recording tools).
pitafix lsp--stdio, -vN/AServes the read-only stdio LSP 3.17 server for the VS Code and Zed extensions.
pitafix doctor--project, --scope, --jsonYesChecks local toolchains and prints fixes for missing tools.
pitafix index <dir>--db, --rebuild, --jobs, --max-file-size, --parse-timeout, --serve, --parse-worker, --jsonYesIndexes repository symbols with tree-sitter, reparsing only changed git blobs.
pitafix grants--jsonYesLists active and revoked trust grants and their keys.
pitafix revoke <key>(none)NoRevokes a trust grant by key while preserving its audit record.
pitafix gc--dry-run, --cache-only, --vacuum, --prune-empty-projects, --prune-grants, --all-cache, --jsonYesReports and reclaims obsolete PitaFix data and cache storage.

Environment variables

Store, cache & agent identity

VariableDefault / Meaning
PITAFIX_DATA_DIRDefault ~/Library/Application Support/PitaFix (stores, blobs, sidecars, blueprints)
PITAFIX_CACHE_DIRDefault ~/Library/Caches/pitafix (build/capture throwaway copies, CEF archive)
PITAFIX_AGENTFallback agent actor name for pitafix mcp when --agent is omitted (default "agent")
PITAFIX_TS_LIBRARYExplicit path to libpitafix-ts.dylib / libpitafix-ts.dll for tree-sitter indexing

Passed by pitafix record run to capture scripts

VariableMeaning
PITAFIX_RECORDER_URLLocalhost recorder base URL (for example http://127.0.0.1:54321)
PITAFIX_RECORDER_TOKENBearer token required on every recorder HTTP request
PITAFIX_ATTRIBUTION_URLEndpoint for backend execution probes ($PITAFIX_RECORDER_URL/v1/attribution)
PITAFIX_PROJECT_ROOTAbsolute path to the target repository
PITAFIX_TRACES_DIRPer-run directory where Level-0 pitafix.trace/1 folders are auto-ingested on script exit
PITAFIX_DIFF_SCOPED"1" on diff-scoped runs; empty on full captures
PITAFIX_AFFECTED_JOURNEYSComma-separated journey IDs impacted by the diff (may be empty)
PITAFIX_CHANGED_FILESComma-separated repo-relative changed file paths on diff-scoped runs
PITAFIX_COMMITCommit SHA being captured
PITAFIX_LIVE"1" when launched for a Live interactive hand-over (use POST /v1/sessions/{id}/hold)

On this page