CLI reference
Every command, flag, environment variable and exit code for capyshield v0.2.1 (watch, guard, vex, actions, init, presets).
Every command, flag and exit code in v0.2.1. Run capyshield <command> --help for the build you have installed. The wrapped command always follows --.
watch
Audit egress of a command without blocking anything — all outbound connections are logged for later use as policy input.
capyshield watch [--config <file>] [--tls sni|mitm] [--report <events.json>] [--emit-policy <file>] -- <command>Example output:
capyshield: audit mode, sni TLS, 1 sensitive ENV value(s) fingerprinted, proxy http://127.0.0.1:49407
npm warn deprecated [email protected]: use String.prototype.padStart()
added 1 package in 497ms
ACTION DESTINATION PROTOCOL CONNS SENT RULE
allowed registry.npmjs.org:443 https-sni 2 4.6 KB
capyshield: 2 connection(s) to 1 host(s)
note: HTTPS payloads were not decrypted; use --tls mitm to scan them for secrets
capyshield: wrote emitted-policy.yaml (review it, then: capyshield guard --config emitted-policy.yaml -- ...)- Zero-config egress audit: lists every outbound destination; nothing is blocked (
mode: audit). --emit-policy <file>writes an enforce-modecapyshield.yamlallowing exactly the hosts this run reached.--tls mitminspects HTTPS payloads (the default,sni, sees host names only);--reportwrites all connection events as JSON.
guard
Enforce egress policy on a command: block secret leaks and unapproved hosts.
capyshield guard [--config <file>] [--mode <mode>] [--fail-mode <mode>] [--tls sni|mitm] [--agent-id <id>] [--report <file>] [--sync] -- <command>--configdefaults to./capyshield.yaml; without one, guard still enforces the built-in secret, ENV and PII checks.--modeis one ofaudit,enforce,enforce_fail_open,enforce_fail_closed;--fail-modeisfail_openorfail_closed. Flags win over the config file.--tlsissni(default, no decryption) ormitm(inspect HTTPS with a local CA).--syncpulls the team egress policy (added to your local one) and reports blocked hosts to the Cloud. It needsCAPYSHIELD_TOKEN; if the Cloud can't be reached, guard only warns.--agent-idsets an agent identity for per-agent rules;--reportwrites events as JSON.- Exits 2 when a connection is blocked; otherwise it passes through the wrapped command's exit code.
vex
Triage a Trivy, Grype or OSV-Scanner report with local reachability, then write OpenVEX.
capyshield vex --input <report> [--scanner trivy|grype|osv] [--repo <dir>] [--output <file>] [--summary <file.md>] [--fail-on <severities>] [--redact-paths] [--sync] [--dry-run] [--config <file>] [--author <name>]- Reads a Trivy, Grype or OSV-Scanner report (auto-detected;
--scannerforces one) and checks local reachability under--repo(default: the current directory). - Writes OpenVEXOpenVEX — an open, machine-readable VEX format that CapyShield writes locally. to
--output(stdout when omitted);--summary <file.md>also writes a Markdown summary. --fail-onsets the severities (e.g.high,critical) whose affected findings exit 3.--syncpulls team rules, then uploads the results;--dry-runprints the exact payload instead, without pulling team rules or sending anything.--redact-paths(orvex.redact_paths: trueincapyshield.yaml, whichcapyshield initwrites) replaces file paths and the project name withsha256:hashes in the summary and the sync payload.--configdefaults to<repo>/capyshield.yaml;--authorsets the OpenVEX author (defaultcapyshield).
actions
Audit your GitHub Actions workflows offline: no network, no GitHub API.
capyshield actions [--repo <dir>] [--fail-on critical|high|medium] [--json]- Checks
.github/workflowsfor actions not pinned to a commit SHA, checkout credentials left on disk, missing orwrite-alltoken permissions, pull request code checked out bypull_request_target/workflow_run, and untrustedgithub.event.*input interpolated intorun:orgithub-script. --fail-onexits 4 when a finding is at or above that severity;--jsonprints findings as JSON on stdout.
init
Create starter config: capyshield.yaml, .capyshield/vex-rules.yaml, and a local CA for TLS inspection.
capyshield init [--force] [--no-ca]- Writes a documented
capyshield.yaml(withvex.redact_paths: true), a.capyshield/vex-rules.yamland a local root CA (in~/.capyshield). --forceoverwrites an existingcapyshield.yaml;--no-caskips creating the CA.
presets
List host presets usable in egress.allow_presets.
capyshield presetsEnvironment variables
None are required; the CLI runs fully offline unless you pass --sync.
| Variable | Purpose |
|---|---|
| CAPYSHIELD_TOKEN | API token for --sync (alias CAPYSHIELD_API_KEY). watch and guard remove both from the wrapped command's environment, so install scripts and agents never see it. |
| CAPYSHIELD_API_URL | Overrides the API endpoint for --sync. |
| CAPYSHIELD_LOG | Log filter for diagnostics on stderr, e.g. debug (default warn). |
| SOURCE_DATE_EPOCH | Fixes the OpenVEX timestamp for byte-for-byte reproducible output. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. watch and guard pass through the wrapped command's exit code when nothing was blocked. |
| 1 | Invalid config or flags, --sync without a token, or a refused upload. |
| 2 | Guard blocked a connection. |
| 3 | vex found an affected finding at a --fail-on severity. |
| 4 | actions found a workflow finding at or above --fail-on. |
vex --sync exits 1 when the upload is refused (401, 402, 403, 409, 413, 429) or the Cloud is unreachable. If pulling team rules fails, it warns and continues with local rules; guard --sync only warns. There is no --sync-strict flag. If an outage shouldn't fail your build, run the sync as its own CI step with continue-on-error.