Skip to main content

Config

The hackagent config command allows you to view and manage your HackAgent configuration.

Commands

Show Configuration

Display your current configuration:

hackagent config show

Example output:

                                HackAgent Configuration
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃ Setting ┃ Value ┃ Source ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
│ Storage │ ~/.local/share/hackagent/hackagent.db │ Local SQLite │
│ Verbosity │ 3 (DEBUG) │ Default/Config │
│ Config File │ /home/user/.config/hackagent/config.json │ Default location │
└───────────────┴────────────────────────────────────────────────────────────────┴───────────────────┘

Set Configuration

Update individual configuration values:

# Set verbosity level
hackagent config set --verbose 2

# Configure remote mode
hackagent config set --api-key YOUR_HACKAGENT_API_KEY
hackagent config set --base-url https://api.hackagent.dev

Storage and Backends

HackAgent supports two backend modes:

ModeStorage/EndpointActivation
Local SQLite~/.local/share/hackagent/hackagent.dbdefault (no API key)
Remote APIhttps://api.hackagent.dev (or custom base URL)set HACKAGENT_API_KEY or --api-key

The same CLI/TUI commands work in both modes.

Configuration Priority

Configuration is loaded in this order (highest to lowest priority):

  1. Command-line arguments — Override everything
  2. Config file~/.config/hackagent/config.json
  3. Environment variables — Fallback
  4. Default values — Built-in defaults

Environment Variables

You can configure HackAgent using environment variables:

VariableRequiredDescriptionExample
HACKAGENT_API_KEY❌ OptionalEnable remote backend and cloud syncexport HACKAGENT_API_KEY=...
HACKAGENT_BASE_URL❌ OptionalCustom API base URL for remote backendexport HACKAGENT_BASE_URL=https://api.hackagent.dev
HACKAGENT_DEBUG❌ OptionalEnable debug outputexport HACKAGENT_DEBUG=1

Example:

# Local mode (default)
hackagent eval advprefix --agent-name "my-agent" --agent-type "ollama" --endpoint "http://localhost:11434" --goals "Test"

# Remote mode
export HACKAGENT_API_KEY="your_api_key"
hackagent eval advprefix --agent-name "my-agent" --agent-type "ollama" --endpoint "http://localhost:11434" --goals "Test"

Configuration File

Default location: ~/.config/hackagent/config.json

{
"api_key": "your_api_key",
"base_url": "https://api.hackagent.dev",
"verbose": 0
}

Custom Configuration File

Use a different configuration file:

hackagent --config-file ./custom-config.json config show

Verbosity Levels

Control the amount of logging output:

LevelNameDescription
0ERROROnly show errors
1WARNINGShow warnings and errors
2INFOShow info, warnings, and errors
3DEBUGShow all messages including debug

Command-line override:

hackagent -v config show          # Verbose (INFO)
hackagent -vv config show # More verbose (DEBUG)
hackagent -vvv config show # Maximum verbosity

Debug Mode

Enable full error tracebacks for troubleshooting:

export HACKAGENT_DEBUG=1
hackagent config show