CLI Reference¶
agentguard includes a backend-aware CLI for trace inspection, migration, reporting, generated tests, and the local dashboard.
Install¶
Trace Commands¶
agentguard traces init¶
Initialise a SQLite trace store:
agentguard traces list¶
List recorded sessions:
agentguard traces show¶
Inspect one session:
agentguard traces show agent_run_001 ./traces
agentguard traces show ./traces --session-id agent_run_001 --tool search_web --status failure --json
agentguard traces stats¶
Aggregate statistics:
agentguard traces report¶
Generate a JSON report:
agentguard traces report ./traces --output report.json
agentguard traces report ./traces --entries --session agent_run_001
agentguard traces import¶
Import legacy JSONL traces into SQLite:
agentguard traces export¶
Export traces to JSONL:
agentguard traces export ./traces --output-dir ./trace-export
agentguard traces export ./traces --session agent_run_001 --output-dir ./trace-export
agentguard traces serve¶
Launch the local SQLite dashboard:
agentguard traces serve ./traces
agentguard traces serve --db-path ./traces/agentguard_traces.db --port 9000
Backend Selection¶
Most trace commands accept:
--backend sqlite--backend jsonl--db-path PATH
If omitted, the CLI infers the backend from the storage path. SQLite is the default for newly initialised stores.
Test Generation¶
Generate pytest cases from traces:
agentguard generate ./traces --output tests/test_generated.py
agentguard generate ./traces --backend sqlite --session agent_run_001