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.3.1.tar.gz (318.3 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.3.1-py3-none-any.whl (163.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apex_ai-1.3.1.tar.gz
  • Upload date:
  • Size: 318.3 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.3.1.tar.gz
Algorithm Hash digest
SHA256 5a9012cf0fc151d81d0a767f7e619af675f490e3a3432b5b193cf76a55db644c
MD5 7df3fb369df772a2fb6dbe2f0af7ecea
BLAKE2b-256 9f9bc7993a1abdec9ef85f58cf8c0d3733f7d51f6feec86a883b2daaf00842a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apex_ai-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 163.4 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad28ac354da234f27bf013ac18c8b1a1ed23df2eb5606a653def7bcf61d24602
MD5 43ad16d24019b6e327729232bc812a10
BLAKE2b-256 05f5b7ac9cdeab08d50765c79dc01c2c6b78bf8fd91d198b4eb623fb5f1f8ab6

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