Skip to main content

A multi-agent meta-harness for coding agents — drives Claude Code, Gemini CLI, and OpenCode in one calm full-screen TUI.

Project description

Aegis

A multi-agent meta-harness for coding agents — drives Claude Code, Gemini CLI, and OpenCode side by side in one calm full-screen TUI.

CI Docs PyPI Python License

Aegis sits above the harness. It drives existing coding-agent CLIs — claude (Anthropic), gemini (Google), opencode (open-source) — over their structured protocols (stream-json and ACP), parses the event streams, and re-renders them in a calm Textual TUI where many agents run side by side. It adds a routing + delegation plane on top: queues, workflows, an MCP server every spawned agent talks to, and an optional Telegram front-end.

┌ aegis ───────────────────────────────────────────────┐
│ ● 1 lucid-knuth ·opus·   ● 2 wry-hopper ·gemini·  *  │
│                                                       │
│ › explain the retry logic                             │
│                                                       │
│ ⠹ Thinking… (3.2s)                                    │
│ ⏺ Read(worker.py)                                     │
│   └ ok                                                 │
│ The retry path lives in _run_turn …                   │
│                                                       │
│ lucid-knuth ·opus· opus·full   ↑128k (94% cached) ↓1k │
│ ───────────────────────────────────────────────────── │
│ › ask something…                                      │
└───────────────────────────────────────────────────────┘

Install

pip install aegis-harness        # or: uv pip install aegis-harness

Requires Python 3.13+ and at least one of: claude, gemini, or opencode on your PATH, signed-in.

Quickstart

aegis init     # interactive wizard — detects installed CLIs, writes .aegis.py
aegis          # full-screen TUI

The wizard finds whichever agent CLIs you have installed and walks you through picking a model, permission mode, and optional queues. The generated .aegis.py is plain Python — edit it freely afterwards.

What you get

  • Multi-provider parity — Claude Code, Gemini, and OpenCode all speak through aegis with the same UX (multi-turn, streaming, cancellation, per-session MCP injection). Gemini and OpenCode use ACP; Claude uses its stream-json bidirectional protocol.
  • Multi-tab TUI — N independent agent sessions in one terminal. Per-tab profiles, generated alliterating handles (lucid-knuth, wry-hopper), per-block copy-to-clipboard, an inline spinner + rotating verb + timer while an agent works, cross-tab signalling (state dot + sticky * + bell when a backgrounded agent finishes).
  • Honest metrics — true input (incl. cache) with cached %, output, tool calls, per-turn and per-session timing. Provisional while streaming, exact at turn end.
  • Queues + workflows — first-class inter-agent delegation. Configure queues in .aegis.py; any agent can call aegis_enqueue(queue, payload) and get an automatic inbox callback when the worker finishes. Write Python workflows that orchestrate multiple agents (delegate / send / drain / spawn / close / bash) and run them via aegis workflow run.
  • MCP plane — every spawned agent gets injected with an aegis MCP server that exposes orientation (aegis_meta), session listing (aegis_list_sessions, aegis_list_agents), peer handoff (aegis_handoff), and queue dispatch (aegis_enqueue, aegis_task_status). No log scraping anywhere in the stack.
  • Headless + Telegramaegis serve runs the SessionManager and MCP plane without a TUI, with an optional Telegram front-end so you can drive agents from your phone.

Keys

Key Action
Enter Send
Ctrl+T / Ctrl+N New tab (default agent) / new tab (pick agent)
Ctrl+W Close tab (last → quit)
Ctrl+1..9 / Ctrl+Tab / Ctrl+←→ Switch tabs
Escape Interrupt the active turn
Click on a block Copy that message / tool result to clipboard
Ctrl+Q Quit

A backgrounded tab that finishes shows a * and rings the bell.

Configuration

.aegis.py is plain Python. The wizard writes one for you; here's the shape:

from aegis import Agent, ClaudeCode, GeminiCLI, OpenCode

agents = {
    "default": Agent(provider=ClaudeCode(model="opus", effort="high",
                                          permission="auto")),
    "fast":    Agent(provider=GeminiCLI(model="gemini-3-flash-preview",
                                         permission="full")),
    "oss":     Agent(provider=OpenCode(model="opencode/kimi-k2.6",
                                        permission="full")),
}
default_agent = "default"

queues = {
    "review": {"agent": "fast", "max_parallel": 2},
}

Full reference: Configuration.

Headless + Telegram

aegis serve runs the SessionManager and MCP plane without the TUI; add a Telegram token to drive it from your phone:

# .aegis.py
telegram_token = "…"        # or set AEGIS_TELEGRAM_TOKEN
telegram_chat_id = 123456   # the single allowed chat

Routing inside the chat:

  • /new [agent] — spawn a new session
  • /close [handle] — close a session
  • /interrupt — interrupt the active turn
  • /<handle> text… — one-shot to a specific session
  • bare text — sent to the active session

A systemd unit template lives at scripts/aegis-serve.service.

Docs

Full documentation: https://apiad.github.io/aegis/

Status

Beta. Personal-infrastructure-grade, evolves fast. Expect change before 1.0. See the roadmap for what's next.

License

MIT — see LICENSE.

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

aegis_harness-0.3.0.tar.gz (60.4 kB view details)

Uploaded Source

Built Distribution

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

aegis_harness-0.3.0-py3-none-any.whl (72.2 kB view details)

Uploaded Python 3

File details

Details for the file aegis_harness-0.3.0.tar.gz.

File metadata

  • Download URL: aegis_harness-0.3.0.tar.gz
  • Upload date:
  • Size: 60.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aegis_harness-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3718ca2bfa1253cbe97d19556367119e8211400244acb7793316ca2208b12d4e
MD5 cbfd78cfedf667875d28975ae4a66384
BLAKE2b-256 1f9319657f8e058d721b926de16f292ec3da6a7b0aa9838d41d99b94e2081359

See more details on using hashes here.

Provenance

The following attestation bundles were made for aegis_harness-0.3.0.tar.gz:

Publisher: release.yml on apiad/aegis

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

File details

Details for the file aegis_harness-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: aegis_harness-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 72.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aegis_harness-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 829fc0a2496e894702121209a35f8e0d34ce0eb59fa50866b95adbdf9cb825a0
MD5 f3ba2d6cc546dca0662073fc69fa2c76
BLAKE2b-256 57dcabb3b6a77030cc18aff41ef17e71315a2f6640a38807770dd5d799da4a15

See more details on using hashes here.

Provenance

The following attestation bundles were made for aegis_harness-0.3.0-py3-none-any.whl:

Publisher: release.yml on apiad/aegis

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