Deploy
/hub:deploy has four modes: check, staging, production, and rollback. All HEAVY. All gated. All logged.
Modes
/hub:deploy check— pre-flight only. Lints, tests, env audit. No deploy./hub:deploy staging— runscheckthen deploys to staging./hub:deploy production— staging gate must have passed in this session./hub:deploy rollback— reverts to the previous release tag.
When NOT to use it
- No CI wired yet. Use your platform's native deploy first; add AgentHub once the pipeline is boring.
- You're just testing locally. Use
/hub:preview.
Invocation
/hub:deploy staging
/hub:deploy production
/hub:deploy rollback@hub deploy staging
@hub deploy production
@hub deploy rollbackWhat pre-flight actually checks
- Git: clean tree, branch is ahead of
mainonly by expected commits, no unresolved merge conflicts. - Tests: all green on latest commit; coverage hasn't regressed.
- Env: required variables present in the target environment's config.
- Dependencies: no known CVEs (via
vulnerability-scannerskill). - Migrations: any new schema change has a down path.
Example session
Shipping to staging then prod
user
/hub:deploy staging
gate
HEAVY · hub:devops-engineer · ~48k tokens · preflight + deploy-staging · [y/n/tweak]
user
y
hub:devops-engineer
Preflight: 124 tests green, coverage stable, no new CVEs. All env vars present for staging. Deploying…
hub:devops-engineer
Staging up at https://staging.example.com. Smoke checks pass. Release tagged v1.4.0-rc.1.
user
looks good. /hub:deploy production
gate
HEAVY · hub:devops-engineer · ~35k tokens · staging gate passed this session · [y/n/tweak]
user
y
hub:devops-engineer
Deploying v1.4.0. Rolling update, 3 instances at a time. Post-deploy /healthz and error-rate watch for 5 min. Green. Release v1.4.0 live.
Rollback
/hub:deploy rollbackreverts to the previous release tag, pauses, and asks for confirmation before flipping traffic. Use when a post-deploy alert fires — it's faster than fixing forward on a hot path.
Pro tips
- Always run
checkbefore staging if you haven't pushed in a while — it surfaces stale CI. - Use tags for rollback. If your deploys aren't tagged, rollback has nothing to target.
- Don't ship from a dirty tree. The pre-flight refuses anyway, but fix the habit.
Next steps
- Security auditor — review hardening before prod.
- Tiers & gates — HEAVY mechanics.
- Usage ledger — audit deploy spend over time.