Skip to main content

AI Orchestration - tmux-based interactive AI CLI wrapper and multi-agent orchestration system

Project description

Orchestration Library (jleechanorg-orchestration)

Python package and CLI for AI CLI task execution (passthrough and async tmux modes).

Table of Contents

Install from PyPI

python3 -m pip install jleechanorg-orchestration

Upgrade:

python3 -m pip install --upgrade jleechanorg-orchestration

Install a specific version:

python3 -m pip install "jleechanorg-orchestration==0.1.40"  # omit version for latest

Verify Install and Version

python3 -m pip show jleechanorg-orchestration
ai_orch --version

CLI Entry Points

Console scripts installed by the package:

  • ai_orch
  • orch (alias)

Both map to orchestration.runner:main.

Primary Usage: ai_orch

Passthrough (default)

Run the selected CLI directly and stream output to stdout:

ai_orch "explain this code"
ai_orch --agent-cli codex "print 1"
ai_orch --agent-cli gemini "fix the bug"

Async (detached tmux)

Spawn a detached tmux session and return immediately:

ai_orch --async "implement feature X"
ai_orch --async --resume "add error handling"   # resume existing session for this dir
ai_orch --async --worktree "refactor auth"      # create git worktree first, then async

Flags:

  • --agent-cli: CLI to use (claude, codex, gemini, minimax, cursor)
  • --model: model override for supported CLIs
  • --async: spawn detached tmux session
  • --resume: reuse existing session for this directory (requires --async)
  • --worktree: create git worktree before async (requires --async)

Task Dispatcher Python Interface

For programmatic multi-agent orchestration (used by automation/), use TaskDispatcher directly:

from orchestration.task_dispatcher import TaskDispatcher

dispatcher = TaskDispatcher()

agent_specs = dispatcher.analyze_task_and_create_agents(
    "Fix failing tests in PR #123 and push updates",
    forced_cli="claude",
)

for spec in agent_specs:
    ok = dispatcher.create_dynamic_agent(spec)
    print(spec["name"], ok)

Core methods

  • TaskDispatcher.analyze_task_and_create_agents(task_description: str, forced_cli: str | None = None) -> list[dict]
  • TaskDispatcher.create_dynamic_agent(agent_spec: dict) -> bool

Agent spec fields used by create_dynamic_agent

  • name: unique agent/session name
  • task: full task instructions
  • cli or cli_chain: selected CLI or fallback chain
  • workspace_config (optional): workspace placement/settings
  • model (optional): model override

Legacy: orchestrate_unified (deprecated)

orchestrate_unified.py is retained as a stub for import compatibility. Its orchestration logic has moved to runner.py. Use ai_orch for passthrough/async or TaskDispatcher for programmatic agent creation.

Design Summary

Full design details live in orchestration/design.md.

High-level design:

  • Entry point is ai_orch/orch (mapped to orchestration.runner:main).
  • Default flow is passthrough: invoke CLI directly, stream output.
  • Async flow (--async) spawns detached tmux sessions with resume and optional worktree support.
  • TaskDispatcher remains for programmatic multi-agent orchestration (automation, PR monitors).
  • Coordination uses file-backed A2A/task state under /tmp (no Redis dependency).

Tech Stack (Summary)

  • Runtime: Python 3.11+
  • Session/process isolation: tmux
  • VCS/PR operations: git, gh
  • Agent CLIs: claude, codex, gemini, minimax, cursor-agent
  • Coordination: file-backed A2A/task state under /tmp (no Redis requirement)

Detailed architecture and implementation docs:

  • orchestration/design.md
  • orchestration/A2A_DESIGN.md
  • orchestration/AGENT_SESSION_CONFIG.md

Local Development (Package Source)

cd orchestration
python3 -m pip install -e .
python3 -m pytest tests -q

Use editable installs only for local package development.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

jleechanorg_orchestration-0.1.96-py3-none-any.whl (156.0 kB view details)

Uploaded Python 3

File details

Details for the file jleechanorg_orchestration-0.1.96-py3-none-any.whl.

File metadata

File hashes

Hashes for jleechanorg_orchestration-0.1.96-py3-none-any.whl
Algorithm Hash digest
SHA256 bba57f9e8440fa698dd23cc548c9a5cd5890453cf7d132c11262deff6d8b7a4b
MD5 983eca5fdcfd58f763ce038f3bba5d3f
BLAKE2b-256 308ad2a613ea45874b327c9101996324ca97f62f8539057c343213c7413326bd

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