Complete reference for the agentqa command line interface.
agentqa [command] [options]
Options:
-V, --version Output version number
-h, --help Display help
Run test scenarios.
agentqa run <suite> [options]| Option | Description |
|---|---|
--id <id> |
Filter by scenario ID |
--tag <tag> |
Filter by tag |
--grep <pattern> |
Filter by name pattern |
--step <label> |
Run to specific step only |
-v, --verbose |
Verbose output |
--json |
Output results as JSON |
--no-teardown |
Keep infrastructure running after tests |
--skip-preflight |
Skip infrastructure checks |
--timeout <ms> |
Chat timeout (default: 120000) |
-c, --config <path> |
Path to config file |
--bail |
Stop after first failure |
--save-diagnostics |
Save diagnostics even on success |
--runs <count> |
Run scenario multiple times |
--continue-on-failure |
Continue after failures in multi-run |
--parallel <n> |
Number of parallel workers |
# Run all scenarios
agentqa run scenarios/suite.yaml
# Run specific scenario
agentqa run scenarios/suite.yaml --id task-001
# Run with tag filter
agentqa run scenarios/suite.yaml --tag smoke
# Run with pattern match
agentqa run scenarios/suite.yaml --grep "create task"
# Run to specific step
agentqa run scenarios/suite.yaml --id task-001 --step create-task
# Run multiple times for flakiness detection
agentqa run scenarios/suite.yaml --id task-001 --runs 5
# Run in parallel
agentqa run scenarios/suite.yaml --parallel 4
# Save diagnostics for token analysis
agentqa run scenarios/suite.yaml --id task-001 --save-diagnosticsInteractive chat with the agent.
agentqa chat [options]| Option | Description |
|---|---|
-m, --message <text> |
Message to send |
-u, --user <id> |
User ID |
-c, --conversation <id> |
Conversation ID |
--config <path> |
Path to config file |
# Send a single message
agentqa chat -m "Create a task called 'Test'" -u user_123
# Continue a conversation
agentqa chat -m "Mark it complete" -u user_123 -c conv_abcInspect database entities.
agentqa db <entity> [options]| Option | Description |
|---|---|
-u, --user <id> |
Filter by user ID |
--id <id> |
Lookup specific entity by ID |
--config <path> |
Path to config file |
# List all tasks for a user
agentqa db tasks -u user_123
# Get specific task
agentqa db tasks --id task_abc123Start infrastructure using globalSetup.
agentqa setup [options]| Option | Description |
|---|---|
-v, --verbose |
Verbose output |
-c, --config <path> |
Path to config file |
This runs your globalSetup file but does NOT run teardown, so infrastructure stays running for manual testing.
Stop running infrastructure.
agentqa teardown [options]| Option | Description |
|---|---|
-v, --verbose |
Verbose output |
Count tokens in text.
agentqa tokens [text] [options]| Option | Description |
|---|---|
-m, --model <name> |
Model for counting (default: claude-haiku-4-5) |
--json |
Output as JSON |
# Count tokens in text
agentqa tokens "Hello, world!"
# From stdin
echo "some text" | agentqa tokens
# With specific model
agentqa tokens "Hello" -m claude-sonnet-4-5
# JSON output
agentqa tokens "Hello" --jsonAnalyze token consumption of Zod schemas.
agentqa schema-tokens [path] [options]| Option | Description |
|---|---|
-m, --model <name> |
Model for counting (default: claude-haiku-4-5) |
-e, --export <name> |
Specific export to analyze |
-p, --pattern <regex> |
Filter exports by pattern |
-n, --name <name> |
Name for stdin schema |
--json |
Output as JSON |
--verbose |
Include full JSON schemas |
--sort <field> |
Sort by: tokens, name |
# Analyze all schemas in a file
agentqa schema-tokens ./src/types.ts
# Filter to specific schemas
agentqa schema-tokens ./types.ts --pattern "Schema$"
# Analyze specific export
agentqa schema-tokens ./types.ts --export TaskSchema
# From stdin
echo 'z.object({ name: z.string() })' | agentqa schema-tokensAnalyze token consumption from diagnostics output.
agentqa analyze-tokens <path> [options]| Option | Description |
|---|---|
-f, --format <format> |
Output: table, json, markdown |
--per-turn |
Show per-turn breakdown |
--per-agent |
Show per-agent breakdown |
--cache |
Focus on cache analysis |
--top <n> |
Show top N consumers |
# Analyze diagnostics
agentqa analyze-tokens ./diagnostics-output/test-001/*/http-responses.json
# With per-turn breakdown
agentqa analyze-tokens ./http-responses.json --per-turn
# Focus on cache metrics
agentqa analyze-tokens ./http-responses.json --cache| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
Required for token counting commands |
DEBUG_ANTHROPIC_CACHE |
Enable cache debugging |
| Code | Meaning |
|---|---|
| 0 | All tests passed |
| 1 | One or more tests failed |