CI Usage
The rules for scripts
- Pass
--json. Every client command prints raw JSON with it;doctor --jsonprints only the summary object. - Branch on exit codes, not text.
0success,2policy refusal,3authentication,4conflict,5not found,6timeout,7protocol mismatch — the full table is on Troubleshooting. - Provide credentials through the environment.
VAGARIS_API_URL,VAGARIS_API_KEYandVAGARIS_COMPANY_ID(legacyPAPERCLIP_*) replace--api-base,--api-keyand--company-id. An explicit API key also disables the interactive login recovery, so nothing tries to open a browser. - Nothing prompts. When stdin or stdout is not a terminal the CLI does not prompt:
doctor --repairneeds--yes,vagaris uninstallneeds--force,agent local-cli --install-skillsneeds--yes, andrunwill not onboard — runvagaris onboard --yesfirst. - Telemetry is off in CI automatically; set
VAGARIS_TELEMETRY_DISABLED=1if your runner is not detected as CI.
A GitHub Actions job
This mirrors the smoke matrix the project runs against each published version:
jobs:
vagaris-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g @vagarylabs/vagaris
- run: vagaris --version
- run: vagaris --help
- run: vagaris doctor --json || true
- run: vagaris version --json
doctor --json on a bare runner fails its first check (no config), which is why the step tolerates it; add vagaris onboard --yes before it to exercise a real instance.
Driving a company from a pipeline
export VAGARIS_API_URL=https://vagaris.example.com
export VAGARIS_API_KEY="$AGENT_API_KEY"
export VAGARIS_COMPANY_ID=<company-id>
vagaris issue create --title "Nightly dependency review" --json
vagaris heartbeat run --agent-id <agent-id> --timeout-ms 900000 --json
vagaris approval list --status pending --json
heartbeat run --timeout-ms bounds the wait; the default 0 waits until the run reaches a terminal status.
Pipe-friendly patterns:
vagaris issue list --status todo --json | jq -r '.[].identifier'
vagaris runctl history --json | jq '.[0]'
Governed work in CI
A CI runner can host a run like a developer laptop. Enrol the runner once (Node Enrolment), keep its ~/.vagris/node-identity.json in the runner's persistent home, and claim with --node-id:
vagaris dev --agent-id <agent-id> --run-id <run-id> --node-id <node-id> --json
The report is JSON; spawn.exitCode and closureGate are the fields to gate on. Use --no-spawn in a pre-flight step to confirm the claim would be allowed before spending runner time.
Backups from a schedule
vagaris db:backup --dir /backups --retention-days 30 --json
Version pinning
vagaris update --to <version> and vagaris rollback --to <version> pin an exact version; vagaris version --json tells you whether the runner is behind. A PROTOCOL_MISMATCH (exit 7) from any command means the server moved ahead — update the CLI in the runner image.