Skip to main content

A professional-grade, open-source CLI coding agent for local codebase interaction.

Project description

Hacxgent

PyPI Version Python Version License

██╗  ██╗ █████╗  ██████╗██╗  ██╗ ██████╗ ███████╗███╗   ██╗████████╗
██║  ██║██╔══██╗██╔════╝╚██╗██╔╝██╔════╝ ██╔════╝████╗  ██║╚══██╔══╝
███████║███████║██║      ╚███╔╝ ██║  ███╗█████╗  ██╔██╗ ██║   ██║   
██╔══██║██╔══██║██║      ██╔██╗ ██║   ██║██╔══╝  ██║╚██╗██║   ██║   
██║  ██║██║  ██║╚██████╗██╔╝ ██╗╚██████╔╝███████╗██║ ╚████║   ██║   
╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝╚═╝  ╚═══╝   ╚═╝   

The Professional CLI Coding Agent for Precision Engineering.

Hacxgent is a high-performance, open-source CLI coding assistant designed for deep interaction with local codebases. Built for precision and speed, it features industry-leading smart memory management, an expanded toolset, and zero provider lock-in (use any OpenAI-compatible API completely free).

Hacxgent goes beyond simple chat—it is an autonomous agent capable of structural analysis, surgical code modification, and long-horizon task execution with unmatched context efficiency.


🌟 Key Innovations

  1. Smart Context Compaction: Normal agents read a file and leave the massive output in the context window, quickly exhausting memory. Hacxgent intelligently compresses these histories. Heavy tool outputs are surgically replaced with tiny memory markers (e.g., "You read src/main.py. Key context extracted."). The agent never forgets its steps, but memory stays infinitely lean.
  2. Zero Provider Lock-In: Complete freedom. Connect to OpenAI, Anthropic, Ollama, Groq, or any OpenAI-compatible local/remote model via a lightweight JSON configuration.
  3. Advanced Matrix-Grade CLI: A professional terminal UI featuring auto-completion, collapsible tool outputs, persistent history, and surgical file patching tools.
  4. JSON-First Configuration: Streamlined, standard, and easy to parse. All configurations (settings.json, trusted_folders.json) are purely JSON.

Table of Contents


Installation

Using uv (Recommended)

First, install uv:

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

Then, install Hacxgent:

uv tool install hacxgent

Using pip

pip install hacxgent

Quick Start

  1. Navigate to your project's root directory:

    cd /path/to/your/project
    
  2. Launch Hacxgent:

    hacxgent
    
  3. First Run Setup: Hacxgent will create a default configuration at ~/.hacxgent/settings.json. It will prompt you to enter your preferred API provider and keys (saved securely to ~/.hacxgent/.env).

  4. Start Coding:

    > Find all instances of the word "TODO" and summarize what needs to be done.
    

Smart Memory Architecture

Hacxgent solves the "Context Exhaustion" problem that plagues standard coding agents.

The Problem

Agents perform actions like reading a 2,000-line file. That 8k+ token output sits in the chat history permanently. After 4-5 file reads, the LLM starts forgetting the original prompt, hallucinating, or hitting its token limit.

The Hacxgent Solution

Hacxgent utilizes a Rolling Compaction Middleware:

  • Execution: The agent reads the file and gets the full content to perform its immediate reasoning.
  • Compaction: As the conversation moves forward, Hacxgent identifies these stale, heavy tool outputs in the history.
  • Redaction: It strips out the massive text block and replaces it with a highly optimized marker: [REDACTED: Output of read_file (5,400 chars). Key context: src/core/loop.py.]
  • Result: The model retains the knowledge that it read the file and understands the project state, but thousands of tokens are recovered. This allows for essentially infinite context horizons.

Usage & CLI Features

Interactive Mode

Simply run hacxgent to enter the interactive chat loop. The CLI is heavily optimized for developers:

  • File Path Autocomplete: Type @ to get smart autocompletion for files in your project (e.g., > Read @src/agent.py).
  • Slash Commands: Type / to access meta-actions (/help, /clear, /compact, /status).
  • Shell Passthrough: Prefix with ! to run standard terminal commands (e.g., > !npm run build).
  • External Editor: Press Ctrl+G to write your prompt in Vim/VSCode.
  • Toggle Views:
    • Ctrl+O: Collapse/Expand raw tool outputs.
    • Ctrl+T: Toggle the internal Todo list view.
    • Shift+Tab: Toggle Auto-Approve mode on/off.

Programmatic Mode

Run Hacxgent non-interactively for scripting or CI/CD pipelines:

hacxgent --prompt "Refactor the main function in cli/main.py to be more modular." --max-turns 5 --output json

Trust Folder System

Safety first. When Hacxgent runs in a new directory containing a .hacxgent subfolder, it will ask for confirmation. Trusted folders are saved in ~/.hacxgent/trusted_folders.json.


Built-in Agents & Subagents

Hacxgent ships with specialized profiles tailored for different risk levels:

  • default: Standard agent. Requires manual approval for risky tool executions (writes, deletes, shell commands).
  • plan: Read-only exploration and architecture mapping.
  • accept-edits: Automatically approves code modifications (write_file, replace_lines), but asks for shell commands.
  • auto-approve: Full autonomy. Use only in trusted, version-controlled environments.

Select an agent via CLI:

hacxgent --agent plan

Subagent Delegation

Hacxgent can parallelize work by delegating tasks to subagents without cluttering your main context window:

> Can you explore the codebase structure while I work on something else?
🤖 I'll delegate this to the explore subagent.
> task(task="Analyze the project architecture", agent="explore")

The Hacxgent Toolset

We expanded standard toolsets to focus on surgical precision:

  • File Operations: read_lines, write_file, replace_lines (1-indexed, surgical swapping instead of fragile search/replace), file_meta (Knowledge Map generation).
  • System: bash (stateful terminal), grep (recursive fast search).
  • Agentic:
    • todo: Allows the agent to self-manage complex, multi-step tasks.
    • ask_user_question: Pauses execution to render an interactive multi-choice question to the user for clarification.
    • impact_analyzer: Maps symbol dependencies project-wide before refactoring.

Configuration (JSON)

Hacxgent uses strictly standard .json files for all configurations. The main configuration is located at ~/.hacxgent/settings.json.

For a comprehensive, in-depth guide to all available settings, including provider setup, model parameters, tool management, and advanced features, please refer to the dedicated documentation:

👉 Configuration Reference (DOCS/SETTINGS.md)

Provider Agnosticism (Bring Your Own LLM)

Configure any OpenAI-compatible endpoint easily. Below is a brief example; full details are in the Configuration Reference.

~/.hacxgent/settings.json

{
  "system_prompt_id": "cli",
  "active_model": "llama3",
  "providers": [
    {
      "name": "LocalOpenAI",
      "api_base": "http://localhost:11434/v1",
      "api_key_env_var": "OLLAMA_API_KEY"
    },
    {
      "name": "Groq",
      "api_base": "https://api.groq.com/openai/v1",
      "api_key_env_var": "GROQ_API_KEY"
    }
  ],
  "enabled_tools": ["*"],
  "disabled_tools": ["dangerous_tool_*"],
  "enable_auto_update": true
}

API Keys

Store keys in your environment, or in ~/.hacxgent/.env:

OLLAMA_API_KEY=your_key_here
OPENAI_API_KEY=sk-....

Skills System

Extend Hacxgent with reusable capabilities. Skills conform to the Agent Skills specification.

  1. Create a skill directory: ~/.hacxgent/skills/code-review/
  2. Create a SKILL.md file with YAML frontmatter:
---
name: code-review
description: Perform automated code reviews
user-invocable: true
allowed-tools:
  - read_file
  - grep
---
# Code Review Skill
Instructions for the agent on how to review code...

Enable it in settings.json:

{
  "enabled_skills": ["code-review"]
}

MCP Server Integration

Hacxgent natively supports the Model Context Protocol (MCP) to connect to external tools and databases.

Configure MCP servers in your settings.json:

{
  "mcp_servers": [
    {
      "name": "postgres_db",
      "transport": "stdio",
      "command": "uvx",
      "args": ["mcp-server-postgres", "postgresql://localhost/mydb"],
      "startup_timeout_sec": 15
    },
    {
      "name": "weather_api",
      "transport": "http",
      "url": "http://localhost:8000",
      "headers": {
        "Authorization": "Bearer my_token"
      }
    }
  ],
  "tools": {
    "postgres_db_query": {
      "permission": "ask"
    }
  }
}

Custom Hacxgent Home Directory

Override the default ~/.hacxgent/ directory by setting an environment variable:

export HACXGENT_HOME="/path/to/custom/dir"

Documentation

For comprehensive information and detailed guides, please refer to the following:

Contributing & Telemetry

Hacxgent is built for privacy. All Telemetry Removed, No Telemetry, Nothing.

We welcome contributions! Please see CONTRIBUTING.md for guidelines on adding tools, improving memory management, or fixing bugs.

License

Hacxgent is released under the Apache-2.0 License. See LICENSE for the full text.

Core architecture inspired by Mistral Vibe. Re-engineered by BlackTechX for universal provider support and advanced memory management.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hacxgent-1.0.0.tar.gz (405.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hacxgent-1.0.0-py3-none-any.whl (253.9 kB view details)

Uploaded Python 3

File details

Details for the file hacxgent-1.0.0.tar.gz.

File metadata

  • Download URL: hacxgent-1.0.0.tar.gz
  • Upload date:
  • Size: 405.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hacxgent-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7d9c38aa3e0957993cd82ff687a3003b4a0aab6b184a8ab26eaf09a69ff619c7
MD5 4cf5d033109604997b604766d8ad6863
BLAKE2b-256 292afd4de15e26cdd80b054ef004243cae44a1f81980aeb8ad55829265d513cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for hacxgent-1.0.0.tar.gz:

Publisher: main.yml on BlackTechX011/Hacxgent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hacxgent-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: hacxgent-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 253.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hacxgent-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 305331e382770b768521a9687f77c24636e53db9053ab3317f90aaf1befab9e5
MD5 9a83d556f2c864397443849b71843494
BLAKE2b-256 1cb3dbf3de0fec6d67c6049c796da507c97b480f3c2c3a1851629571176f61c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for hacxgent-1.0.0-py3-none-any.whl:

Publisher: main.yml on BlackTechX011/Hacxgent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page