Command line
Every command the hackagent executable offers. Run any of them with --help to see the same information in your terminal.
| Command | What it does |
|---|---|
hackagent campaign | ๐ฏ Run declarative campaign files (campaign.yaml). |
hackagent config | ๐ง Manage HackAgent CLI configuration |
hackagent datasets | ๐ Browse and sample dataset presets |
hackagent doctor | ๐ Diagnose common configuration issues |
hackagent examples | ๐งช Launch built-in examples from the CLI |
hackagent init | ๐ Initialize HackAgent CLI configuration |
hackagent results | ๐ View and manage attack results |
hackagent tui | ๐ฅ๏ธ Launch the campaign builder |
hackagent version | ๐ Show version information |
hackagent web | ๐ Launch the web dashboard. |
hackagent campaignโ
๐ฏ Run declarative campaign files (campaign.yaml).
hackagent campaign [OPTIONS] COMMAND [ARGS]...
hackagent campaign runโ
Run a campaign file against its (or overridden) model servers.
hackagent campaign run [OPTIONS] [FILE]
| Name | Kind | Required | Description |
|---|---|---|---|
FILE | argument | no | Defaults to campaign.yaml. |
--dry-run | flag | no | Resolve and report without attacking. |
--json | flag | no | Emit events and summary as JSON. |
--ollama-endpoint | option | no | Repoint every Ollama model. |
--openai-endpoint | option | no | Repoint the target and the judges sharing its endpoint. |
--judge-endpoint | option | no | Repoint the other OpenAI judges. |
--attacker-endpoint, --decorator-endpoint | option | no | Repoint attack role models. |
--output-directory | option | no | Override where result files are written. |
--concurrency | option | no | Set attack/target/judge concurrency alike. |
--wait-for-ollama | option | no | Defaults to 0.0. |
--ollama-pid | option | no | |
--wait-for-server | option | no | Defaults to 0.0. |
--server-pid | option | no | |
--judge-server-pid | option | no | |
--attacker-server-pid | option | no |
hackagent campaign schemaโ
Print the JSON Schema of campaign files, for editor autocompletion.
hackagent campaign schema [OPTIONS]
| Name | Kind | Required | Description |
|---|---|---|---|
-o, --output | option | no | Write the schema to this file instead of printing it. |
hackagent campaign validateโ
Resolve a campaign (goals, models, judges) without attacking it.
hackagent campaign validate [OPTIONS] [FILE]
| Name | Kind | Required | Description |
|---|---|---|---|
FILE | argument | no | Defaults to campaign.yaml. |
hackagent configโ
๐ง Manage HackAgent CLI configuration
hackagent config [OPTIONS] COMMAND [ARGS]...
hackagent config import-configโ
Import configuration from a file
hackagent config import-config [OPTIONS] CONFIG_FILE
| Name | Kind | Required | Description |
|---|---|---|---|
CONFIG_FILE | argument | yes |
hackagent config resetโ
Reset configuration to defaults
hackagent config reset [OPTIONS]
| Name | Kind | Required | Description |
|---|---|---|---|
--confirm | flag | no | Skip confirmation prompt |
hackagent config setโ
Set configuration values
hackagent config set [OPTIONS]
| Name | Kind | Required | Description |
|---|---|---|---|
--api-key | option | no | HackAgent API key |
--base-url | option | no | HackAgent API base URL |
--verbose | option | no | Default verbosity level: 0/error, 1/warning, 2/info, 3/debug |
hackagent config showโ
Show current configuration
hackagent config show [OPTIONS]
hackagent config validateโ
Validate current configuration
hackagent config validate [OPTIONS]
hackagent datasetsโ
๐ Browse and sample dataset presets
hackagent datasets [OPTIONS] COMMAND [ARGS]...
hackagent datasets listโ
List available dataset presets
hackagent datasets list [OPTIONS]
| Name | Kind | Required | Description |
|---|---|---|---|
--provider | option | no | Filter by provider type |
--query, -q | option | no | Filter by name or description substring |
--json | flag | no | Emit machine-readable JSON |
hackagent datasets sampleโ
Load and print sample goals from a dataset preset
hackagent datasets sample [OPTIONS] PRESET
| Name | Kind | Required | Description |
|---|---|---|---|
PRESET | argument | yes | |
--limit | option | no | Number of goals to load Defaults to 5. |
--shuffle | flag | no | Shuffle before selecting |
--seed | option | no | Random seed used with --shuffle |
--json | flag | no | Emit machine-readable JSON |
hackagent datasets showโ
Show details for a dataset preset
hackagent datasets show [OPTIONS] PRESET
| Name | Kind | Required | Description |
|---|---|---|---|
PRESET | argument | yes | |
--json | flag | no | Emit machine-readable JSON |
hackagent doctorโ
๐ Diagnose common configuration issues
hackagent doctor [OPTIONS]
hackagent examplesโ
๐งช Launch built-in examples from the CLI
hackagent examples [OPTIONS] COMMAND [ARGS]...
hackagent examples db-toolโ
Run the DB Tool sandbox example: start agent, then launch attack.
hackagent examples db-tool [OPTIONS]
hackagent examples listโ
๐ List every example campaign.
hackagent examples list [OPTIONS]
hackagent examples ollamaโ
Run the Ollama h4rm3l demo via CLI (no TUI).
hackagent examples ollama [OPTIONS]
hackagent examples pc-toolโ
Run the PC Tool sandbox example: start agent, then launch attack.
hackagent examples pc-tool [OPTIONS]
hackagent examples quick-evaluationโ
Run the OpenRouter quick evaluation example (h4rm3l).
hackagent examples quick-evaluation [OPTIONS]
hackagent examples ragโ
Run the RAG indirect-injection example.
hackagent examples rag [OPTIONS]
hackagent examples runโ
โถ Run one example by name, starting its target if it has one.
hackagent examples run [OPTIONS] NAME
| Name | Kind | Required | Description |
|---|---|---|---|
NAME | argument | yes |
hackagent examples webโ
Show how to red-team a website chatbot you are authorized to test.
hackagent examples web [OPTIONS]
hackagent initโ
๐ Initialize HackAgent CLI configuration
hackagent init [OPTIONS]
hackagent resultsโ
๐ View and manage attack results
hackagent results [OPTIONS] COMMAND [ARGS]...
hackagent results showโ
Show detailed information about a specific result
hackagent results show [OPTIONS] RESULT_ID
| Name | Kind | Required | Description |
|---|---|---|---|
RESULT_ID | argument | yes |
hackagent results summaryโ
Show summary statistics of attack results
hackagent results summary [OPTIONS]
| Name | Kind | Required | Description |
|---|---|---|---|
--status | option | no | Filter by status |
--agent | option | no | Filter by agent name |
--attack-type | option | no | Filter by attack type |
--days | option | no | Number of days to include (default: 7) Defaults to 7. |
hackagent tuiโ
๐ฅ๏ธ Launch the campaign builder
hackagent tui [OPTIONS]
hackagent versionโ
๐ Show version information
hackagent version [OPTIONS]
hackagent webโ
๐ Launch the web dashboard.
hackagent web [OPTIONS]
| Name | Kind | Required | Description |
|---|---|---|---|
--host | option | no | Host to bind the dashboard server. Defaults to 127.0.0.1. |
--port | option | no | Port to run the dashboard server on. Defaults to 7860. |
--db-path | option | no | SQLite database path (default: ~/.local/share/hackagent/hackagent.db). |
--local | flag | no | Read from the local database even when an API key is configured. |
--no-browser | flag | no | Do not auto-open a browser tab on start. |