Official CLI
Trigger a registry check, stream rollout events, and wait until services settle — or fail the process when Castellan rolls back.
Castellan CLI is the command-line companion to Castellan — the compose deploy controller with health checks, rollback, and a dashboard.
Use the dashboard for day-to-day ops. Use this CLI in automation (GitHub Actions, scripts) when you need a hard gate after pushing a new image digest.
export CASTELLAN_URL=http://castellan.example:8443
export CASTELLAN_AUTH_TOKEN=…
castellan watch api-service🔎 Watching api-service
✓ api STABLE myorg/api-service:staging a1b2c3d4e5f6
🔄 Checking registry for updates…
✓ Check started — waiting for rollout
📥 api pulling sha256:f6e5d4…
🚀 api UPDATING a1b2c3d4e5f6 → f6e5d4c3b2a1
· waiting. UPDATING — 12s elapsed, 14m 48s left
· waiting.. UPDATING — 17s elapsed, 14m 43s left
✓ api STABLE f6e5d4c3b2a1
✅ Healthy in 42s
api a1b2c3d4e5f6 → f6e5d4c3b2a1
Quiet polls rewrite the · waiting… line in a TTY; CI logs print each heartbeat on its own line. Colors and STATE pills show in a real terminal / GitHub Actions log.
Castellan’s own health wait (CASTELLAN_ROLLBACK_HEALTH_TIMEOUT_MS, default 2m) is separate from this CLI --timeout-ms. Docker healthcheck timeout is only per probe, not the overall wait.
npm install -g castellan-cliFrom a local checkout:
git clone https://github.com/logfoxai/castellan-cli.git && cd castellan-cli
npm install
npm link| Command | What it does |
|---|---|
watch <services…> |
Stream status/history until settle (runs forceCheck first by default) |
status [services…] |
One-shot status snapshot |
check |
POST /v1/forceCheck only — ask Castellan to check registries / roll out |
export CASTELLAN_URL=http://castellan.example:8443
export CASTELLAN_AUTH_TOKEN=…
# Force a registry check, then stream until settle
castellan watch api-service
# Watch only (something else already called check)
castellan watch api-service --no-force-check
# Multiple services
castellan watch api ingest-worker issue-worker
# Snapshot
castellan status
castellan status api-service
# Kick Castellan without waiting
castellan checkService args match Castellan’s managed service name, or the image repository basename (e.g. api-service resolves to Castellan service api when that service’s repository ends in api-service).
| Flag | Env | Meaning |
|---|---|---|
--url |
CASTELLAN_URL |
Castellan base URL (required) |
--token |
CASTELLAN_AUTH_TOKEN |
Bearer token (required) |
| Flag | Default | Meaning |
|---|---|---|
--no-force-check |
check on | Skip asking Castellan to check the registry |
--poll-ms |
5000 |
Poll interval |
--timeout-ms |
900000 (15m) |
CLI wait for rollout to settle (not Docker/Castellan health timeouts) |
| Code | Meaning |
|---|---|
0 |
Watched services settled stable on a new digest |
1 |
Unreachable API, unknown service, forceCheck error, failed/rollback, or timeout |
130 |
SIGINT |
Castellan-native:
- Capture baseline digests from
/v1/status - Optionally
forceCheck - Stream new
/v1/historyevents and state transitions (checking→updating→stable/rollback/failed) - Success when every watched service saw deploy activity and settled
stable/idlewithcurrentDigest ≠ baseline - Failure on
failedstate, failure events, or rollback that ends on the baseline digest
Emits GitHub Actions annotations (::error::, ::notice::) when running in Actions.
- name: Connect Tailscale
uses: tailscale/github-action@v3
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Deploy + watch
env:
CASTELLAN_URL: http://castellan.prime.logfox.ai:8443
CASTELLAN_AUTH_TOKEN: ${{ /* from Secrets Manager or env */ }}
run: |
deploy-compose-service api-service "$VERSION" "$PWD"
castellan watch api-serviceReleases use npm trusted publishing (OIDC) from .github/workflows/release.yml. There is no NPM_TOKEN secret.
npm cannot create a new package name via OIDC alone. Bootstrap once as the npm owner:
npm loginand publish an initial version (or a0.0.0stub) socastellan-cliexists on the registry.- On npm package access, add a Trusted Publisher:
- Organization / user:
logfoxai - Repository:
castellan-cli - Workflow:
release.yml
- Organization / user:
- Re-run the Release workflow on
main(or merge a release-triggering commit).
npm run validate # lint + typecheck + build + test
npm run dev # esbuild watchMIT
Related: for ECS rollouts, see ecswatch.