| cypilot | true | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| type | spec | |||||||||||||
| name | Cypilot CLI Specification | |||||||||||||
| version | 1.0 | |||||||||||||
| purpose | Complete CLI interface specification for the cypilot tool | |||||||||||||
| drivers |
|
- Overview
- Installation
- Invocation Model
- Global Conventions
- Core Commands
- Kit Commands
- Workspace Commands
- Output Format
- Exit Codes
- Environment Variables
- File System Layout
- Error Handling
- Version Negotiation
Cypilot provides a CLI tool invoked as cpt. The keyword cypilot is reserved for agent chat prompts. The tool follows a two-layer architecture:
- Global CLI Proxy — a thin shell installed globally via
pipx, containing zero business logic. It resolves the correct skill bundle and proxies all commands to it. - Skill Engine — the actual command executor, installed either in the project (
{cypilot_path}/) or in the global cache (~/.cypilot/cache/).
All CLI output is JSON to stdout. Human-readable messages go to stderr. This enables piping and programmatic consumption.
pipx install git+https://github.com/cyberfabric/cyber-pilot.gitAfter installation, cpt is available globally as the CLI command. The cypilot keyword is reserved for agent chat prompts.
Requirements:
- Python 3.11+ (requires
tomllibfrom stdlib) pipx(recommended) orpip
Optional:
git— enhanced project detection via.gitdirectory; not requiredghCLI v2.0+ — required only for PR review/status commands
On every invocation, the CLI Proxy executes the following sequence:
- Cache check — if
~/.cypilot/cache/does not exist or is empty, download the latest skill bundle from GitHub before proceeding. - Target resolution — if the current directory is inside a project with a Cypilot install directory (default:
cypilot/), proxy to the project-installed skill. Otherwise, proxy to the cached skill. - Background version check — start a non-blocking check for newer versions. The check MUST NOT delay the main command. Concurrent checks are prevented via a lock file. A newly available version becomes visible on the next invocation.
- Version notice — if the cached version is newer than the project-installed version, display a notice to stderr:
Cypilot {cached_version} available (project has {project_version}). Run 'cpt update' to upgrade. - Command execution — forward all arguments to the resolved skill engine.
cpt <command> [subcommand] [options] [arguments]
- stdout — JSON only. Every command outputs a JSON object or array.
- stderr — human-readable messages (progress, warnings, notices).
--quiet— suppress stderr output.--verbose— increase stderr detail level.
| Code | Meaning | When |
|---|---|---|
| 0 | PASS / Success | Command completed successfully |
| 1 | Error | Filesystem error, invalid arguments, runtime error |
| 2 | FAIL | Validation failed, check failed, item not found |
| Option | Description |
|---|---|
--version |
Show cache and project skill versions |
--help |
Show help for command |
--json |
Force JSON output (default, explicit for clarity) |
--quiet |
Suppress stderr |
--verbose |
Increase stderr detail |
Initialize Cypilot in a project.
cpt init [--dir DIR] [--agents AGENTS]
| Option | Default | Description |
|---|---|---|
--dir |
cypilot |
Installation directory |
--agents |
all | Comma-separated agent list: windsurf,cursor,claude,copilot,openai |
Behavior:
- Check if Cypilot is already installed. If yes → abort with message, suggest
cpt update. - If interactive terminal → prompt for installation directory and agent selection.
- Copy skill bundle from cache into the install directory.
- Define the root system — derive name and slug from the project directory name (e.g., directory
my-app/→name = "MyApp",slug = "my-app"). - Create
{cypilot_path}/config/core.tomlwith project root, root system definition, and kit registrations. - Create
{cypilot_path}/config/artifacts.tomlwith a fully populated root system entry including default SDLC autodetect rules:artifacts_dir = "architecture"(default artifact directory)- Autodetect rules for standard artifact kinds:
PRD.md,DESIGN.md,ADR/*.md,DECOMPOSITION.md,features/*.md— all with default traceability levels and glob patterns - Default codebase entry:
path = "src", common extensions - Default ignore patterns:
vendor/*,node_modules/*,.git/*
- Install all available kits by copying kit files into
{cypilot_path}/config/kits/<slug>/(constraints, artifacts, workflows, SKILL.md) and registering incore.toml. - Generate agent entry points for selected agents.
- Inject root
AGENTS.mdentry: insert managed<!-- @cpt:root-agents -->block at the beginning of{project_root}/AGENTS.md(create file if absent). - Create
{cypilot_path}/config/AGENTS.mdwith default WHEN rules for standard system prompts. - Output prompt suggestion:
cypilot onorcypilot help(these are agent chat prompts, not CLI commands).
Root AGENTS.md integrity: every CLI invocation (not just init) verifies the <!-- @cpt:root-agents --> block in root AGENTS.md exists and contains the correct path. If missing or stale, the block is silently re-injected. See sysprompts.md for full format.
Output (JSON):
{
"status": "ok",
"install_dir": "cypilot",
"kits_installed": ["sdlc"],
"agents_configured": ["windsurf", "cursor", "claude", "copilot", "openai"],
"systems": [{"name": "my-project", "slug": "my-project", "kit": "sdlc"}]
}Exit: 0 on success, 1 on error, 2 if already initialized.
Update project skill to the cached version.
cpt update [--project-root P] [--dry-run] [--no-interactive] [-y/--yes]
| Option | Description |
|---|---|
--project-root P |
Project root directory (default: auto-detect from cwd) |
--dry-run |
Show what would be done without writing |
--no-interactive |
Disable interactive prompts (auto-skip customized markers) |
-y, --yes |
Auto-approve all prompts (no interaction) |
Behavior:
- Resolve project root and cypilot directory.
- Replace
.core/from cache (always force-overwrite). - For each kit in cache: compare kit version (skip same, file-level diff if newer, copy on first install), update kit files in
config/kits/{slug}/via interactive diff prompts. - Write aggregate
.gen/AGENTS.mdand.gen/SKILL.mdfrom collected kit parts. - Ensure
config/scaffold files exist (create only if missing). - Re-inject root
AGENTS.mdandCLAUDE.mdmanaged blocks. - Auto-regenerate agent integration files if real changes happened.
- Run self-check to verify kit integrity; include result in report (WARN if failed).
- Return update report.
Output (JSON):
{
"status": "PASS",
"project_root": "/path/to/project",
"cypilot_dir": "/path/to/project/.bootstrap",
"dry_run": false,
"actions": {
"core_update": {"architecture": "updated", "skills": "updated", "...": "..."},
"kits": {"sdlc": {"kit": "sdlc", "version": {"status": "current"}, "gen": {"files_written": 25}}},
"gen_agents": "updated",
"gen_skill": "updated"
},
"self_check": {"status": "PASS", "kits_checked": 1, "templates_checked": 9}
}Exit: 0 on success, 1 on error.
Validate artifacts.
cpt validate [--artifact PATH] [--system SYSTEM] [--kind KIND] [--strict]
| Option | Description |
|---|---|
--artifact PATH |
Validate a single artifact file |
--system SYSTEM |
Validate all artifacts for a system |
--kind KIND |
Filter by artifact kind (PRD, DESIGN, etc.) |
--strict |
Enable strict validation (all checklist items) |
--local-only |
Skip cross-repo workspace validation (validate local repo only) |
--source SOURCE |
Target a specific workspace source for validation (uses that source's adapter context). Returns error when used outside workspace mode. |
Workspace flag interaction: --local-only and --source are independent and can be combined. --source narrows which artifacts are validated (a single source's artifacts using its own adapter context). --local-only controls whether cross-repo IDs from other workspace sources are included as reference context. Examples: cpt validate --source backend validates the backend source with cross-repo references; cpt validate --source backend --local-only validates the backend source without cross-repo references; cpt validate --local-only validates the primary repo only without cross-repo references.
Without arguments: validate all registered artifacts across all systems.
Behavior (artifact validation):
- Load config and resolve target artifacts via autodetect rules.
- For each artifact: a. Structural validation — template heading compliance, required sections. b. ID validation — format, uniqueness, priority markers. c. Placeholder detection — TODO, TBD, FIXME. d. Constraint enforcement — allowed ID kinds per artifact kind from constraints.toml.
- If multiple artifacts → cross-artifact validation:
a.
covered_byreference completeness. b. Checked-ref-implies-checked-def consistency. c. All ID references resolve to definitions. d. Duplicate ID detection: if the same artifact ID is defined in two or more different files (including cross-repo sources when--local-onlyis not set), report an error listing all conflicting files. - Output score breakdown with actionable issues (file path, line number, severity).
Output (JSON):
{
"status": "PASS",
"artifacts_validated": 3,
"error_count": 0,
"warning_count": 2,
"issues": [
{
"file": "architecture/PRD.md",
"line": 42,
"severity": "warning",
"rule": "PLACEHOLDER",
"message": "TODO marker detected"
}
],
"next_step": "Deterministic validation passed. Now perform semantic validation."
}Exit: 0=PASS, 2=FAIL.
List IDs matching criteria.
cpt list-ids [--kind KIND] [--pattern PATTERN] [--system SYSTEM] [--format FORMAT]
| Option | Description |
|---|---|
--kind KIND |
Filter by ID kind (fr, nfr, actor, component, etc.) |
--pattern PATTERN |
Glob or regex filter on ID slug |
--system SYSTEM |
Limit to a specific system |
--format FORMAT |
Output format: json (default), table, ids-only |
--source SOURCE |
Filter by workspace source name. Returns error when used outside workspace mode. |
Output (JSON):
{
"ids": [
{
"id": "cpt-cypilot-fr-core-init",
"kind": "fr",
"file": "architecture/PRD.md",
"line": 154,
"checked": false,
"priority": "p1"
}
],
"total": 42
}Exit: 0.
Find where an ID is defined.
cpt where-defined --id <id>
Output (JSON):
{
"id": "cpt-cypilot-fr-core-init",
"defined_in": {
"file": "architecture/PRD.md",
"line": 154,
"kind": "fr",
"checked": false,
"content_preview": "The system MUST provide an interactive `cpt init` command..."
}
}Exit: 0=found, 2=not found.
Find where an ID is referenced.
cpt where-used --id <id>
Output (JSON):
{
"id": "cpt-cypilot-fr-core-init",
"references": [
{
"file": "architecture/DESIGN.md",
"line": 62,
"context": "inline_reference"
}
],
"total": 3
}Exit: 0.
Get content block for an ID definition.
cpt get-content --id <id>
Output (JSON):
{
"id": "cpt-cypilot-fr-core-init",
"file": "architecture/PRD.md",
"line_start": 154,
"line_end": 159,
"content": "The system MUST provide an interactive `cpt init` command..."
}Exit: 0=found, 2=not found.
List all ID kinds known to the system.
cpt list-id-kinds [--system SYSTEM]
Output (JSON):
{
"kinds": [
{"kind": "fr", "artifact": "PRD", "kit": "sdlc", "count": 18},
{"kind": "nfr", "artifact": "PRD", "kit": "sdlc", "count": 6},
{"kind": "component", "artifact": "DESIGN", "kit": "sdlc", "count": 8}
]
}Exit: 0.
Show project status and registry information.
cpt info
Output (JSON):
{
"cypilot_dir": "cypilot",
"artifacts_toml": "cypilot/config/artifacts.toml",
"systems": [
{
"name": "Cypilot",
"slug": "cypilot",
"kit": "sdlc",
"artifacts_root": "architecture",
"artifacts_found": 3,
"codebase_paths": ["skills/cypilot/scripts/"]
}
],
"kits": [
{"slug": "sdlc", "version": "1.0", "path": "kits/sdlc"}
]
}Exit: 0.
Show generated agent integration files without writing anything.
cpt agents [--agent AGENT | --openai] [--root PATH] [--cypilot-root PATH] [--config PATH]
| Option | Description |
|---|---|
--agent AGENT |
Limit output to a specific agent: windsurf, cursor, claude, copilot, openai |
--openai |
Shortcut for --agent openai |
--root PATH |
Project root directory to search from (default: current directory) |
--cypilot-root PATH |
Explicit Cypilot core root (optional override) |
--config PATH |
Path to agents config JSON (optional; built-in defaults used when omitted) |
Behavior:
- Resolve project root and cypilot directory.
- Load agent config (or built-in defaults).
- Inspect generated workflow proxies, skill shims, and subagent files for the selected agents.
- Return a read-only per-agent listing; no files are written.
Exit: 0.
Generate or update agent integration files.
cpt generate-agents [--agent AGENT | --openai] [--root PATH] [--cypilot-root PATH] [--config PATH] [--dry-run]
| Option | Description |
|---|---|
--agent AGENT |
Generate for a specific agent only: windsurf, cursor, claude, copilot, openai |
--openai |
Shortcut for --agent openai |
--root PATH |
Project root directory to search from (default: current directory) |
--cypilot-root PATH |
Explicit Cypilot core root (optional override) |
--config PATH |
Path to agents config JSON (optional; built-in defaults used when omitted) |
--dry-run |
Compute planned changes without writing files |
Without --agent: regenerate for all agents.
Behavior:
- Collect
SKILL.mdextensions from all installed kits. - Compose the main SKILL.md from core commands + collected extensions.
- Generate workflow entry points in each agent's native format.
- Generate skill shims referencing the composed SKILL.md.
- Generate tool-specific subagent files where supported.
- Full overwrite on each invocation (no merge with existing files).
Generated surfaces:
| Agent | Generated files/directories |
|---|---|
| Windsurf | .windsurf/workflows/, .agents/skills/ (shared) |
| Cursor | .cursor/commands/, .cursor/agents/, .agents/skills/ (shared) |
| Claude | .claude/skills/, .claude/agents/ |
| Copilot | .github/prompts/, .github/copilot-instructions.md, .github/agents/, .agents/skills/ (shared) |
| OpenAI | .agents/skills/ (shared), .codex/.cypilot-installed (marker), .codex/agents/ |
Detection model (used by info and update --auto-regenerate):
Each agent is detected via Cypilot-specific generated files, not generic tool directories.
- Claude:
.claude/skills/cypilot/SKILL.md - Windsurf:
.windsurf/workflows/cypilot.md(primary) or legacy.windsurf/skills/cypilot/SKILL.mdwith{cypilot_path}/follow-link - Cursor:
.cursor/commands/cypilot.md(primary) or legacy.cursor/rules/cypilot.mdcwith{cypilot_path}/follow-link - Copilot:
.github/.cypilot-installed(primary),.github/prompts/cypilot.prompt.md, or.github/copilot-instructions.mdstarting with# Cypilot(legacy). User-authoredcopilot-instructions.mdfiles are never overwritten. - OpenAI:
.codex/.cypilot-installed(primary),.codex/agents/with Cypilot content (legacy mixed-install), or.agents/skills/cypilot/SKILL.mdonly when no other agent's primary or legacy Cypilot marker is present (legacy pure)
Skill file model:
- Kit workflow skills: Generated as shared
.agents/skills/{id}/SKILL.mdfor all non-Claude agents - Manifest skills: Generated to
.agents/skills/{id}/SKILL.mdwith agent targeting enforced via filtering logic — when a manifest skill is scoped to specific agents (e.g.agents=['cursor']), it is not generated for other agents
All non-Claude agents read from the shared .agents/skills/ directory, but agent-specific manifest skills are filtered at generation time. This prevents Cursor-only skills from being offered to Copilot or OpenAI.
Legacy per-tool manifest skill files are migrated away only when they match generated content or are pure generated stubs; customized legacy files are preserved.
Exit: 0.
DEPRECATED per
cpt-cypilot-adr-remove-blueprint-system: This command has been removed. Kit files are now authored directly and installed/updated viacpt kit install/cpt kit update. No generation step is needed.
Exit: 0 on success, 1 on error.
Environment health check.
cpt doctor
Checks performed:
| Check | Pass Condition |
|---|---|
| Python version | ≥ 3.10 |
| git available | git --version succeeds (optional, not required) |
| gh CLI | gh auth status succeeds (required only for PR commands) |
| Agent detection | at least one supported agent directory found |
| Config integrity | {cypilot_path}/config/core.toml exists and parses, schema valid |
| Skill version | project skill matches or is newer than cache |
| Kit structure | all registered kits have valid entry points |
| Kit file integrity | all kit files in {cypilot_path}/config/kits/<slug>/ present and valid (conf.toml, constraints.toml, artifacts/, SKILL.md) |
Output (JSON):
{
"status": "healthy",
"checks": [
{"name": "python_version", "status": "pass", "detail": "3.12.1"},
{"name": "git", "status": "pass", "detail": "2.43.0"},
{"name": "gh_cli", "status": "warn", "detail": "not authenticated", "remediation": "Run 'gh auth login'"}
]
}Exit: 0=healthy, 2=issues found.
Validate all example artifacts against their templates.
cpt self-check [--kit KIT] [--verbose]
| Option | Description |
|---|---|
--kit KIT |
Validate only a specific kit (e.g., cypilot-sdlc) |
--verbose |
Include full per-template error/warning lists |
Behavior:
- Load installed kits from artifacts registry.
- For each kit, load
constraints.tomland locate template/example files. - Validate each template against constraints (heading contract, ID placeholders, cross-artifact references).
- Validate each example artifact against its template structure and constraints.
- Report per-kit, per-kind PASS/FAIL with error details.
Note:
self-checkis also invoked automatically at the end ofcpt update. If it fails, the update status becomes WARN and the self-check report is included in the update output.
Exit: 0=PASS, 2=FAIL, 1=ERROR.
Manage project configuration.
cpt config <subcommand> [options]
cpt config show [--section SECTION]
Display current core configuration. Optional --section to show only a part (systems, kits, ignore).
cpt config system add --name NAME --slug SLUG --kit KIT
Add a system definition to {cypilot_path}/config/core.toml.
cpt config system remove --slug SLUG
Remove a system definition.
cpt config system rename --slug SLUG --new-name NAME [--new-slug SLUG]
cpt config ignore add --pattern PATTERN [--reason REASON]
Add a path pattern to the ignore list.
cpt config ignore remove --pattern PATTERN
cpt config kit install --slug SLUG --path PATH
Register and install a kit.
All config subcommands support --dry-run to preview changes without writing.
Exit: 0 on success, 1 on error.
Manage git pre-commit hooks.
cpt hook install
cpt hook uninstall
install: creates a git pre-commit hook that runs cpt lint on changed artifact files. The hook MUST complete in ≤ 5 seconds for typical changes.
uninstall: removes the Cypilot pre-commit hook.
Exit: 0 on success, 1 on error.
Manage shell completions.
cpt completions install [--shell SHELL]
| Option | Default | Description |
|---|---|---|
--shell |
auto-detect | bash, zsh, or fish |
Exit: 0 on success, 1 on error.
Kit plugins register their own CLI subcommands under the kit's slug namespace.
cpt sdlc autodetect show --system SYSTEM
Show autodetect rules (artifact patterns, traceability levels, codebase paths) for a system.
cpt sdlc autodetect add-artifact --system SYSTEM --kind KIND --pattern PATTERN [--traceability FULL|DOCS-ONLY] [--required]
cpt sdlc autodetect add-codebase --system SYSTEM --name NAME --path PATH --extensions EXTS
cpt sdlc pr-review <number> [--checklist CHECKLIST] [--prompt PROMPT]
Review a GitHub PR. Fetches diffs and metadata via gh CLI, analyzes against configured prompts and checklists. Read-only (no local modifications). Always re-fetches on each invocation.
cpt sdlc pr-status <number>
Check PR status: comment severity classification, CI status, merge conflict state, unreplied comment audit.
All SDLC commands: exit 0 on success, 1 on error.
Multi-repo workspace federation commands manage cross-repo artifact traceability without merging adapters.
Initialize a multi-repo workspace by scanning nested sub-directories for repos with Cypilot adapters.
cpt workspace-init [--root DIR] [--output PATH] [--inline] [--force] [--max-depth N] [--dry-run]
| Option | Description |
|---|---|
--root DIR |
Directory to scan for nested repo sub-dirs (default: current project root) |
--output PATH |
Where to write .cypilot-workspace.toml (default: scan root) |
--inline |
Write workspace config inline into current repo's config/core.toml instead of standalone file |
--force |
Force reinitialization when a workspace config already exists |
--max-depth N |
Maximum directory depth for nested repo scanning (default: 3). Limits filesystem traversal to prevent unbounded scanning. |
--dry-run |
Print what would be generated without writing files |
Behavior:
- Find project root (
.gitorAGENTS.mdwith@cpt:root-agentsmarker). - Scan nested sub-directories (up to
--max-depthlevels, default 3) for project directories with Cypilot adapters. Symlinks are not followed during scanning to prevent loops and traversal issues. - For each discovered repo: resolve adapter path, compute relative source path, infer role based on directory heuristics:
- Detect capabilities: source directories (
src/,lib/,app/,pkg/), documentation directories (docs/,architecture/,requirements/), kits directory (kits/) - If multiple capabilities present →
full - If only kits →
kits; only docs →artifacts; only source →codebase - If no recognized directories →
full(default)
- Detect capabilities: source directories (
- Build workspace config with version and discovered sources.
- Check for existing workspace — reject cross-type conflicts (inline vs standalone) and require
--forceto reinitialize. - Write config: standalone
.cypilot-workspace.tomlor inline[workspace]section inconfig/core.toml.
Constraints: --inline and --output are mutually exclusive. --inline always writes to config/core.toml.
Output (JSON):
{
"status": "CREATED",
"message": "Workspace config created at .cypilot-workspace.toml",
"config_path": ".cypilot-workspace.toml",
"sources_count": 3,
"sources": ["repo-a", "repo-b", "repo-c"]
}Exit: 0 on success, 1 on error.
Add a source to workspace config.
cpt workspace-add --name NAME (--path PATH | --url URL) [--branch BRANCH] [--role ROLE] [--adapter PATH] [--inline] [--force]
| Option | Description |
|---|---|
--name NAME |
Source name (human-readable key, required) |
--path PATH |
Path to the source repo (relative to workspace file or project root). Validated at add-time; returns error if directory not found. |
--url URL |
Git remote URL (HTTPS or SSH) for the source |
--branch BRANCH |
Git branch/ref to checkout |
--role ROLE |
Source role: artifacts, codebase, kits, full (default: full) |
--adapter PATH |
Path to Cypilot dir within the source (e.g., cypilot, .bootstrap) |
--inline |
Add source inline to config/core.toml instead of standalone workspace file |
--force |
Replace existing source with the same name instead of returning an error |
Behavior:
- Auto-detect workspace type (standalone vs inline) when
--inlinenot specified. - If no workspace config found and
--inlinenot specified, return JSON error directing the user to runworkspace-initfirst (exit 1). - If
--urlspecified, validate URL scheme: only HTTPS (https://) and SSH (git@host:path,ssh://) are accepted. Reject other schemes with JSON error (code: UNSUPPORTED_URL_SCHEME, exit 1). - If inline workspace detected, auto-route to inline add.
- If source name already exists and
--forcenot specified, return JSON error (code: SOURCE_ALREADY_EXISTS, exit 1). If--forcespecified, replace the existing entry. - Save updated config.
Constraints: --path and --url are mutually exclusive. Git URL sources are not supported in inline mode (--inline + --url is rejected) because inline config is embedded in config/core.toml which has no external workspace directory to clone into. URL scheme validation rejects file://, ftp://, and plain http:// URLs.
Output (JSON):
{
"status": "ADDED",
"message": "Source 'repo-a' added to workspace",
"config_path": ".cypilot-workspace.toml",
"source": {
"name": "repo-a",
"path": "../repo-a",
"role": "full",
"adapter": ".bootstrap"
}
}Exit: 0 on success, 1 on error.
Display workspace configuration and per-source status.
cpt workspace-info
Behavior:
- Find project root and locate workspace config (standalone or inline).
- For each source: resolve path, check reachability, probe for adapter directory.
- If adapter found: load artifact metadata, report artifact and system counts.
- If workspace context loaded: report reachable source count and total registered systems.
- Run config validation and report any warnings.
Output (JSON):
{
"status": "OK",
"version": "1.0",
"config_path": ".cypilot-workspace.toml",
"is_inline": false,
"project_root": "/path/to/project",
"sources_count": 2,
"sources": [
{
"name": "repo-a",
"path": "../repo-a",
"resolved_path": "/abs/path/to/repo-a",
"role": "full",
"adapter": ".bootstrap",
"reachable": true,
"adapter_found": true,
"artifact_count": 5,
"system_count": 1
},
{
"name": "repo-b",
"url": "https://github.com/org/repo-b.git",
"path": null,
"resolved_path": null,
"role": "codebase",
"adapter": null,
"branch": "main",
"reachable": false,
"warning": "Source not cloned — run 'workspace-sync' to fetch: https://github.com/org/repo-b.git"
}
],
"traceability": {
"cross_repo": true,
"resolve_remote_ids": true
},
"context_loaded": true,
"reachable_sources": 1,
"total_registered_systems": 2,
"config_warnings": ["Optional: config validation warnings, if any"]
}Output fields:
| Field | Type | Description |
|---|---|---|
status |
string | "OK" on success, "ERROR" on failure |
version |
string | Workspace config version |
config_path |
string | Path to workspace config file |
is_inline |
bool | Whether workspace is inline in core.toml |
sources[].url |
string? | Git remote URL (present only for Git URL sources) |
sources[].branch |
string? | Git branch/ref (present only when configured) |
sources[].warning |
string? | Warning message when source is unreachable |
sources[].metadata_error |
string? | Error loading artifact metadata from adapter |
traceability |
object | Cross-repo traceability settings (cross_repo, resolve_remote_ids) |
context_loaded |
bool | Whether full workspace context was loaded |
reachable_sources |
int? | Count of reachable sources (present when context_loaded is true) |
total_registered_systems |
int? | Total systems across reachable sources (present when context_loaded is true) |
config_warnings |
string[]? | Config validation warnings (present only when warnings exist) |
Exit: 0 on success (including when warnings are present), 1 on error (no workspace found, config broken).
Fetch and update worktrees for Git URL sources.
cpt workspace-sync [--source NAME] [--dry-run] [--force]
| Option | Description |
|---|---|
--source NAME |
Sync only the named source (default: all Git URL sources) |
--dry-run |
Show which sources would be synced without performing network operations |
--force |
WARNING: DESTRUCTIVE — skip dirty worktree check. Uncommitted changes will be discarded via git reset --hard and local commits may be lost via git checkout -B. |
Behavior:
- Find project root and locate workspace config.
- Collect Git URL sources: if
--sourceis set, look up the single named source; otherwise collect all sources withurlset. - If
--sourceset and source not found → JSON error (code: SOURCE_NOT_FOUND, exit 1) listing available source names. - If
--sourceset and source has no URL → JSON error (code: SOURCE_NOT_GIT_URL, exit 1). - If no Git URL sources found → status message "no git sources to sync".
- If
--dry-run→ list sources that would be synced without network operations. - For each Git URL source: check the local worktree for uncommitted changes via
git status --porcelain. If the worktree is dirty and--forceis not set → skip that source with per-result error (code: DIRTY_WORKTREE). - For each clean (or forced) source: run
git fetch origin [branch], then update worktree viagit checkout -B {branch} origin/{branch}(named branch) orgit reset --hard FETCH_HEAD(HEAD mode — when no branch is configured, tracks the remote's default branch). Both operations discard local commits and working-tree changes on the target branch. - Report per-source results.
Constraints: Only Git URL sources can be synced. Local path sources are skipped. Existing local worktrees are not automatically updated during command execution; use workspace-sync to explicitly fetch and update Git URL sources. URL scheme validation (HTTPS/SSH only) is enforced at add-time; sync inherits the same restrictions. Credentials in URLs are redacted in all output.
Output (JSON):
{
"status": "OK",
"synced": 2,
"failed": 0,
"results": [
{"name": "repo-a", "status": "synced"},
{"name": "repo-b", "status": "synced"}
]
}Exit: 0 on success (at least one synced or none to sync), 1 on error, 2 if all sources failed.
All commands produce JSON output to stdout. The structure varies per command but follows common patterns:
Success with status:
{"status": "ok", ...}Validation result:
{"status": "PASS|FAIL", "error_count": N, "warning_count": N, "issues": [...]}Item not found:
{"status": "not_found", "id": "cpt-..."}Error:
{"error": "description", "code": "ERROR_CODE"}Error codes are uppercase snake_case identifiers (e.g., CONFIG_NOT_FOUND, INVALID_ARTIFACT_PATH, KIT_NOT_REGISTERED).
| Code | Name | Description |
|---|---|---|
| 0 | SUCCESS | Command completed, validation passed, item found |
| 1 | ERROR | Runtime error, filesystem error, invalid arguments |
| 2 | FAIL | Validation failed, check failed, item not found |
CI pipelines should check for exit code 2 to detect validation failures.
| Variable | Description | Default |
|---|---|---|
CYPILOT_CACHE_DIR |
Override cache directory location | ~/.cypilot/cache/ |
CYPILOT_NO_VERSION_CHECK |
Disable background version check | unset |
CYPILOT_NO_COLOR |
Disable colored stderr output | unset |
NO_COLOR |
Standard no-color convention (respected) | unset |
~/.cypilot/
cache/ # Cached skill bundle (latest downloaded)
skills/
kits/
...
version-check.lock # Prevents concurrent version checks
{cypilot_path}/ # Install directory (default: cypilot/, configurable via --dir)
.core/ # Read-only core files (copied from cache)
skills/ # Skill bundle
workflows/ # Core workflows (generate.md, analyze.md)
requirements/ # Core requirement specs
schemas/ # JSON schemas
.gen/ # Auto-generated aggregate files (do not edit)
AGENTS.md # Generated WHEN rules + system prompt content
SKILL.md # Navigation hub routing to per-kit skills
README.md # Generated README
config/ # User-editable configuration
AGENTS.md # Project-level navigation (WHEN → sysprompt)
SKILL.md # User-editable skill extensions
core.toml # Core config (systems, kits, ignore)
artifacts.toml # Artifact registry
sysprompts/ # Project-specific system prompts
kits/
sdlc/
conf.toml # Kit version metadata
SKILL.md # Per-kit skill instructions
constraints.toml # Structural validation rules
artifacts/ # Per-artifact files (rules, template, checklist, examples)
codebase/ # Codebase review files
workflows/ # Workflow definitions
scripts/ # Kit-specific scripts
.windsurf/workflows/ # Windsurf workflow proxies
.cursor/rules/ # Cursor rule files
.claude/commands/ # Claude command files
.github/prompts/ # Copilot prompt files
| Error Code | Cause | Resolution |
|---|---|---|
NOT_INITIALIZED |
Command run outside a Cypilot project | Run cpt init |
CONFIG_NOT_FOUND |
{cypilot_path}/config/core.toml missing or corrupt |
Run cpt init or cpt doctor |
KIT_NOT_REGISTERED |
Referenced kit not in config | Run cpt config kit install |
ARTIFACT_NOT_FOUND |
Specified artifact path does not exist | Check path |
SCHEMA_VALIDATION |
Config file does not match schema | Run cpt doctor for details |
GH_CLI_NOT_FOUND |
gh CLI not installed (PR commands only) |
Install gh CLI |
GH_NOT_AUTHENTICATED |
gh CLI not authenticated |
Run gh auth login |
KIT_UPDATE_CONFLICT |
User declined all file updates during kit update | Re-run cpt kit update to review changes |
CACHE_EMPTY |
No cached skill and download failed | Check network, retry |
UNSUPPORTED_URL_SCHEME |
Git URL uses scheme other than HTTPS or SSH | Use https:// or git@ URL |
SOURCE_ALREADY_EXISTS |
Workspace source name already taken | Use --force to replace |
SOURCE_NOT_FOUND |
Named source not in workspace config | Check workspace-info for available sources |
SOURCE_NOT_GIT_URL |
Named source is a local path, not a Git URL | Only Git URL sources can be synced |
DIRTY_WORKTREE |
Workspace source has uncommitted changes | Commit/stash changes or use --force |
All errors produce JSON to stdout:
{
"error": "Human-readable description",
"code": "ERROR_CODE",
"details": {}
}Plus a human-readable message to stderr.
cpt --version
Output (JSON):
{
"proxy_version": "0.6.0",
"cache_version": "0.6.0",
"project_version": "0.5.0",
"update_available": true
}The proxy version is the version of the globally installed CLI proxy (pipx package). The cache version is the version of the skill bundle in ~/.cypilot/cache/. The project version is the version of the skill installed in the project's {cypilot_path}/ directory (null if not in a project).