Reference
CLI Reference
agentrust CLI commands — init, status, audit, queue, and more.
CLI Reference
Overview
The agentrust CLI provides onboarding, status checks, policy management, audit inspection, and queue operations.
Why It Matters
Operators use the CLI for day-to-day governance administration without writing code.
Prerequisites
pip install agentrust-sdkEntry point: agentrust = "agentrust_sdk.cli:main"
Step-by-Step Guide
Commands
| Command | Purpose |
|---|---|
agentrust init | Onboard — cloud auth or --local offline key |
agentrust whoami | Show auth identity and tier |
agentrust status | Tier, gateway reachability |
agentrust policy sync | Pull policy packs from gateway |
agentrust policy push | Push local policy to gateway |
agentrust policy list | List available policy packs |
agentrust audit tail | Stream local SQLite audit records |
agentrust queue replay | Drain queue buffer to gateway |
agentrust queue status | Show buffered validation count |
agentrust export [file] | Export local audit to JSONL |
agentrust purge --confirm | Delete local SQLite databases |
agentrust disable | Print kill-switch instructions |
agentrust uninstall | Remove config files |
agentrust upgrade | Open upgrade page |
Examples
# Onboard
agentrust init
agentrust init --local
# Check status
agentrust status
agentrust whoami
# Audit
agentrust audit tail
agentrust export ./audit.jsonl
# Queue (air-gap)
agentrust queue status
agentrust queue replay
# Cleanup
agentrust purge --confirm
# Rollback instructions
agentrust disableBest Practices
- Run
agentrust statusafter changing gateway URL - Use
exportbeforepurgeto backup audit data - Use
init --localfor air-gapped environments
Common Mistakes
- Running
purgewithout--confirm(safety guard) - Expecting
audit tailto show remote gateway records (local SQLite only)
Troubleshooting
| Issue | Fix |
|---|---|
| Command not found | Reinstall agentrust-sdk; check PATH |
| Init fails offline | Use --local flag |