Metadata-Version: 2.4
Name: apex-agent
Version: 0.1.0
Summary: Resilient & Context-Aware Coding CLI Agent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.28.1
Requires-Dist: orjson>=3.11.8
Requires-Dist: pydantic>=2.13.3
Requires-Dist: python-dotenv>=1.2.2
Requires-Dist: rich>=15.0.0
Requires-Dist: typer>=0.25.1
Dynamic: license-file

# Apex-Agent: Resilient & Context-Aware Coding CLI

Apex-Agent is a sophisticated Command Line Interface (CLI) framework designed to enhance developer productivity by providing deep context awareness, secure tool execution, and multi-provider LLM resilience.

## 🚀 Key Features (MVP)

### 🧠 Intelligence & Context
*   **Advanced Context Engine**: Automatically manages relevant project context, including pinned files and repository structure.
*   **Symbol-Aware Search**: Precisely locate class and function definitions using AST parsing (`search_symbol`).
*   **Semantic Mapping**: Built-in repository mapper to provide the LLM with a structural overview of the codebase.

### 🛠️ Resilient Architecture
*   **Multi-Provider Support**: Seamlessly switch between **Groq** (high-speed) and **Ollama** (local/privacy).
*   **Human-in-the-Loop Safety**: Mandatory planning and approval workflow. Every change is previewed with a colorized Diff UI.
*   **Undo System**: Instant filesystem reverts using Git-based snapshots (`/undo`).
*   **Circuit Breaker & Fallback**: Automatic failover logic with latency tracking for maximum uptime.

### 🧰 Comprehensive Toolset
*   **File Ops**: `read_file` (with selective truncation), `write_file`, `replace_in_file`, `open_file_range`.
*   **Analysis**: `find_references`, `list_files`, `search`, `get_repo_map`.
*   **Execution**: `run_command` (with security classification), `run_tests` (pytest integration).

---

## 🛠️ Setup & Installation

### Prerequisites
*   Python 3.12+
*   Git (required for the Undo system)
*   [Ollama](https://ollama.ai/) (for local execution)
*   Groq API Key (optional, for cloud execution)

### Installation
1.  **Clone the repository**:
    ```bash
    git clone https://github.com/yourusername/apex-agent.git
    cd apex-agent
    ```

2.  **Install globally** (using `uv` or `pip`):
    ```bash
    # Using uv (recommended)
    uv tool install .
    
    # Or using pip
    pip install .
    ```

3.  **Initialize Global Configuration**:
    Run the following from anywhere:
    ```bash
    apex init
    ```
    This creates a configuration file at `~/.apex-agent/.env`. Open it to add your API keys.

---

## 🖥️ Usage

You can now run the agent from **any** repository directory by simply typing:
```bash
apex chat start
```

### Commands
*   `apex init`: Initialize global settings.
*   `apex chat start`: Start an interactive session in the current directory.
*   `/undo`: (Inside chat) Revert the last filesystem change.
*   `/trace`: (Inside chat) View raw LLM interaction data.

---

## 📜 License
Distributed under the MIT License. See `LICENSE` for more information.
