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 100+ more via litellm. Switch models mid-session. Track costs live. Never leave your terminal.


✨ Why APEX?

APEX OpenCode Claude Code Aider
Every model (100+) ⚠️ ⚠️
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

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, Reviewer, DevOps, Analyst
  • 100+ 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 with Terminal UI

🤖 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.1.0.tar.gz (228.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.1.0-py3-none-any.whl (159.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apex_ai-1.1.0.tar.gz
  • Upload date:
  • Size: 228.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.1.0.tar.gz
Algorithm Hash digest
SHA256 540f0825e804e5f0ab4b689555e7d98fc890ea428e708543110818f2ef21bc47
MD5 3d2e34eb6a13a6919f7d8162007db314
BLAKE2b-256 1b60d7b747bd42be293df30b58dbc4e736e49bb219aa5d3b751951edc68823f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apex_ai-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 159.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b36b0cd95f115cc23a9afd09a16361c8738bf5eac872209979f0462caf57cc37
MD5 bad660352f7bbb7000df4324f54a06a2
BLAKE2b-256 6c3f69c3006500aaf90d04c922af08cda8a286c98da6fe54ce26039441beec59

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