Skip to main content

Universal AI coding agent — every model, one terminal

Project description

◆ APEX

The universal AI coding agent. Every model. One terminal.

PyPI version Python 3.11+ License: Proprietary Docker Stars


Install · Docs · Security · Models · Sponsor


APEX runs any LLM in your terminal as a coding agent — Anthropic, OpenAI, Google, Groq, Mistral, DeepSeek, Ollama (local), and 170+ more via litellm. Switch models mid-session. Track costs live. Never leave your terminal.


✨ Why APEX?

APEX OpenCode Claude Code Aider
Every model (170+) ⚠️ ⚠️
Switch model mid-session
Works offline (Ollama)
Beautiful TUI
File tree + tool log
Command palette (⌘K)
Live token cost tracker
Session persistence
Shell security
OpenTUI + React TUI
6 themes (dracula, nord, etc.)
Permission system
Rate limiting
API key management
pip install
Built in Africa 🇬🇦

🎨 TUI

APEX features a modern terminal UI built with OpenTUI + React. The TUI connects to the APEX backend via HTTP SSE for real-time token streaming, live cost tracking, and context percentage monitoring.

# Launch the TUI (starts backend HTTP server + Bun frontend automatically)
apex tui                    # Subcommand style (v1.3.0+)
apex --tui                  # Flag style (same thing)

Keybindings

Key Action
Tab Switch agent
Ctrl+K Model selector
Ctrl+L Clear messages + reset metrics
Ctrl+O Toggle sidebar
Ctrl+T Toggle tools panel
? Help panel
Escape Close overlay
Ctrl+Q Quit APEX

Features

  • 5 Agents: Coder, Architect, Planner, Reviewer, Shell
  • 170+ Models: OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, xAI, etc.
  • Live Metrics: Token streaming (prompt/completion), per-message cost, total spent, context %
  • Agent Theming: Title bar, status bar, and borders change color per agent
  • 75+ Tools: File, Code, Shell, Git, Web, Database, Docker, K8s, Cloud, Security
  • MCP/LSP: Server status monitoring
  • HTTP Backend: Local SSE server on port 8080, error banners with auto-dismiss

🔒 Security

APEX includes comprehensive security features to protect your system:

Shell Command Analysis

APEX analyzes shell commands before execution and blocks dangerous patterns:

from apex.shell_security import shell_analyzer

analysis = shell_analyzer.analyze("rm -rf /tmp/test")
# safe: False, category: DANGEROUS, warnings: [...]

Blocked patterns:

  • rm -rf / — System-wide deletion
  • curl | sh — Download and execute
  • Fork bombs, direct disk writes

Permission System

Ruleset-based permission control for tool execution:

from apex.permission import permission_manager, PermissionAction

# Add custom rules
permission_manager.add_rule("run_command", PermissionAction.ASK)

# Check permission
can_execute, reason = permission_manager.can_execute_tool("run_command")

Rate Limiting & API Keys

Database-backed rate limiting with workspace-based API keys:

from apex.rate_limiter import create_rate_limiter
from apex.api_key import create_key_manager

limiter = create_rate_limiter(use_sqlite=True)
manager = create_key_manager()

# Create API key
workspace = manager.create_workspace("my-project", "user_123")
api_key, info = manager.create_key(workspace.workspace_id, "prod")

HTTP API Security

from apex.http_api import HTTPServer

server = HTTPServer(
    host="127.0.0.1",
    port=8080,
    require_auth=True,  # API key required
)

See SECURITY.md for full documentation.


⚡ Installation

One-line install (recommended)

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/Ggboykxz/APEX/main/install.sh | bash

Windows (PowerShell):

irm https://raw.githubusercontent.com/Ggboykxz/APEX/main/install.ps1 | iex

Package managers

Method Command
uv (fastest) uv tool install apex-ai
pipx (isolated) pipx install apex-ai
pip pip install apex-ai
Docker docker run -it -v $(pwd):/workspace ghcr.io/ggboykxz/apex

From source

git clone https://github.com/Ggboykxz/APEX
cd APEX
pip install -e ".[dev]"

GitHub Codespaces

APEX is pre-configured in .devcontainer.json — just open the repo in Codespaces!


🚀 Quick Start

# 1. Set your API key
export ANTHROPIC_API_KEY=sk-ant-...

# 2. Launch APEX
apex

# 3. Ask anything
> fix the authentication bug in auth.py
> add TypeScript types to all functions
> write tests for the payment module

Switch models anytime:

apex --model gpt-4o        # Start with GPT-4o
apex --model gemini-2      # Start with Gemini 2
apex --model ollama-llama3 # Local, no API key needed
apex tui                   # Launch Terminal UI (subcommand)
apex models                # List available models
apex install-tui           # One-time TUI setup

🤖 Supported Models

Anthropic (Claude)
export ANTHROPIC_API_KEY=sk-ant-...
apex --model claude-sonnet   # Recommended
apex --model claude-opus     # Most powerful
apex --model claude-haiku    # Fastest
OpenAI
export OPENAI_API_KEY=sk-...
apex --model gpt-4o
apex --model o1
apex --model o3-mini
Google Gemini
export GEMINI_API_KEY=...
apex --model gemini-2
apex --model gemini-flash
Groq (Ultra-fast inference)
export GROQ_API_KEY=gsk_...
apex --model llama-groq
apex --model mixtral-groq
🔒 Ollama (100% local, no API key)
# Install Ollama first: https://ollama.com
ollama pull llama3
apex --model ollama-llama3   # No API key needed!
DeepSeek
export DEEPSEEK_API_KEY=...
apex --model deepseek-chat
apex --model deepseek-coder
Meta Llama
apex --model llama-3
apex --model llama-3.1
Mistral & Mixtral
export MISTRAL_API_KEY=...
apex --model mistral
apex --model mixtral
Qwen
apex --model qwen2
apex --model qwen2.5

🛠️ What APEX Can Do

  • Read & edit files — understands your whole codebase
  • Run commands — tests, builds, installs, git
  • Search code — grep-style across your project
  • Fix bugs — diagnoses, patches, and verifies
  • Write features — complete implementations
  • Refactor code — preserves your style
  • Write tests — pytest, jest, go test, and more
  • Explain code — line by line if needed

🎨 Configuration

# ~/.apex/config.json
{
  "model": "claude-sonnet",
  "theme": "apex-dark",
  "auto_commit": false,
  "max_tool_rounds": 20
}
# .env (project or ~/.apex/.env)
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...
GROQ_API_KEY=gsk_...

💖 Sponsors

APEX is free and open source. If it saves you time, consider sponsoring.

🥇 Gold Sponsors

Your logo here — become a sponsor

🥈 Silver Sponsors

Your logo here

🥉 Individual Backers

Sponsor APEX →


🤝 Contributing

git clone https://github.com/Ggboykxz/APEX
cd APEX
pip install -e ".[dev]"
pytest
bun run tui:dev    # Launch TUI in dev mode

See CONTRIBUTING.md for guidelines.


📄 License

Proprietary — All rights reserved by Ggboykxz.

See LICENSE for full terms. This software is not open source — plagiarism, repackaging, or claiming APEX code as your own is prohibited and may constitute copyright infringement.


If APEX helps you, please ⭐ the repo — it means everything to an indie developer.

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

apex_ai-1.4.0.tar.gz (319.5 kB view details)

Uploaded Source

Built Distribution

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

apex_ai-1.4.0-py3-none-any.whl (164.6 kB view details)

Uploaded Python 3

File details

Details for the file apex_ai-1.4.0.tar.gz.

File metadata

  • Download URL: apex_ai-1.4.0.tar.gz
  • Upload date:
  • Size: 319.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for apex_ai-1.4.0.tar.gz
Algorithm Hash digest
SHA256 942d91d4b897bc9d83e7b330beadf33bfc4590e6374a609ea6856f9646ca79b8
MD5 4d1c25bdf19cf432abb9a386aad98813
BLAKE2b-256 2d8cc0c96c0372102d8825c62fb8a5f0de89f76ae3ad92f81a925d2cb955f4c0

See more details on using hashes here.

File details

Details for the file apex_ai-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: apex_ai-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 164.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for apex_ai-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09676e6143bc77eeb173a998375d475261bebabf2753cd3db207976f19324a16
MD5 f18dea99c66a42ece3e21c4184e9fde6
BLAKE2b-256 7e6bb3aed00057c10d936502c7e96a894108adebd300798df2e4c435ed23585e

See more details on using hashes here.

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