Skip to main content

Command line

Every command the hackagent executable offers. Run any of them with --help to see the same information in your terminal.

CommandWhat 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]
NameKindRequiredDescription
FILEargumentnoDefaults to campaign.yaml.
--dry-runflagnoResolve and report without attacking.
--jsonflagnoEmit events and summary as JSON.
--ollama-endpointoptionnoRepoint every Ollama model.
--openai-endpointoptionnoRepoint the target and the judges sharing its endpoint.
--judge-endpointoptionnoRepoint the other OpenAI judges.
--attacker-endpoint, --decorator-endpointoptionnoRepoint attack role models.
--output-directoryoptionnoOverride where result files are written.
--concurrencyoptionnoSet attack/target/judge concurrency alike.
--wait-for-ollamaoptionnoDefaults to 0.0.
--ollama-pidoptionno
--wait-for-serveroptionnoDefaults to 0.0.
--server-pidoptionno
--judge-server-pidoptionno
--attacker-server-pidoptionno

hackagent campaign schemaโ€‹

Print the JSON Schema of campaign files, for editor autocompletion.

hackagent campaign schema [OPTIONS]
NameKindRequiredDescription
-o, --outputoptionnoWrite 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]
NameKindRequiredDescription
FILEargumentnoDefaults 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
NameKindRequiredDescription
CONFIG_FILEargumentyes

hackagent config resetโ€‹

Reset configuration to defaults

hackagent config reset [OPTIONS]
NameKindRequiredDescription
--confirmflagnoSkip confirmation prompt

hackagent config setโ€‹

Set configuration values

hackagent config set [OPTIONS]
NameKindRequiredDescription
--api-keyoptionnoHackAgent API key
--base-urloptionnoHackAgent API base URL
--verboseoptionnoDefault 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]
NameKindRequiredDescription
--provideroptionnoFilter by provider type
--query, -qoptionnoFilter by name or description substring
--jsonflagnoEmit machine-readable JSON

hackagent datasets sampleโ€‹

Load and print sample goals from a dataset preset

hackagent datasets sample [OPTIONS] PRESET
NameKindRequiredDescription
PRESETargumentyes
--limitoptionnoNumber of goals to load Defaults to 5.
--shuffleflagnoShuffle before selecting
--seedoptionnoRandom seed used with --shuffle
--jsonflagnoEmit machine-readable JSON

hackagent datasets showโ€‹

Show details for a dataset preset

hackagent datasets show [OPTIONS] PRESET
NameKindRequiredDescription
PRESETargumentyes
--jsonflagnoEmit 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
NameKindRequiredDescription
NAMEargumentyes

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
NameKindRequiredDescription
RESULT_IDargumentyes

hackagent results summaryโ€‹

Show summary statistics of attack results

hackagent results summary [OPTIONS]
NameKindRequiredDescription
--statusoptionnoFilter by status
--agentoptionnoFilter by agent name
--attack-typeoptionnoFilter by attack type
--daysoptionnoNumber 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]
NameKindRequiredDescription
--hostoptionnoHost to bind the dashboard server. Defaults to 127.0.0.1.
--portoptionnoPort to run the dashboard server on. Defaults to 7860.
--db-pathoptionnoSQLite database path (default: ~/.local/share/hackagent/hackagent.db).
--localflagnoRead from the local database even when an API key is configured.
--no-browserflagnoDo not auto-open a browser tab on start.