AI-driven multi-terminal task orchestration platform enabling cross-CLI multi-agent collaboration, automatic Git branch management, and complex task loop execution
GitCortex is an AI-driven multi-terminal task orchestration platform enabling cross-CLI multi-agent collaboration, automatic Git branch management, and complex task loop execution.
When collaborating across multiple CLI tools (Claude Code, Gemini CLI, Codex, etc.) in AI programming workflows, challenges include difficult task orchestration, hard-to-track progress, chaotic branch management, and complex result merging. GitCortex coordinates multiple Terminal execution units through a unified Orchestrator (Main Agent), achieving monitorable, replayable, and recoverable closed-loop task management.
- Supported Range: Multiple AI CLI tools (Claude Code, Gemini CLI, Codex, Amp, Cursor Agent, Qwen Code, GitHub Copilot, Droid, Opencode)
- Data Model: Three-layer complete persistence (Workflow → WorkflowTask → Terminal)
- Execution Mode: Multi-Task parallel, Terminal serial within Task
- Event Mechanism: Git commits and message bus event-driven, non-polling
| Feature | Description |
|---|
| Main Agent Coordination | AI-driven central controller for task distribution, progress monitoring, result review |
| Multi-task Parallelism | Multiple Tasks execute simultaneously, each with independent Git branch |
| In-task Serial Execution | Terminals execute in sequence (coding → review → fix) |
| Event-driven | Progress via Git commits and message bus events, reducing polling |
| Feature | Description |
|---|
| Automatic Branch Management | Each Task corresponds to an independent Git branch |
| Merge Management | Global Merge Terminal unifies merging to target branch |
| GitWatcher Service | Monitors .git/refs/heads changes, triggers events |
| Feature | Description |
|---|
| Multi-CLI Support | Claude Code, Gemini CLI, Codex, Amp, Cursor Agent, Qwen Code, GitHub Copilot, Droid, Opencode |
| cc-switch Integration | One-click model configuration switch for any CLI |
| Multi-model Support | Claude, Gemini, OpenAI, etc. |
╔═══════════════════════════════════════════════════════════════════╗
║ Orchestrator (Main Agent) ║
║ User Config: API Type + Base URL + API Key + Model ║
╚═══════════════════════════════════════════════════════════════════╝
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Task 1 │ │ Task 2 │ │ Task 3 │
│ branch:login│ │ branch:i18n │ │ branch:theme│
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
[ Global Merge Terminal ]
│
▼
[ main ]
| Service | Responsibility |
|---|
| OrchestratorAgent | Main Agent for task distribution, progress monitoring, result review |
| MessageBus | Cross-terminal message routing |
| TerminalLauncher | Terminal process startup and management |
| GitWatcher | Monitors Git events |
| CCSwitchService | Model configuration switching |
| Layer | Description |
|---|
| Workflow | Top-level container with multiple Tasks, Orchestrator and Merge Terminal config |
| WorkflowTask | Mid-level unit, each Task has one Git branch with multiple Terminals |
| Terminal | Bottom-level execution unit, bound to specific CLI type and model config |
| Scenario | Description |
|---|
| Cross-CLI Multi-Agent Collaboration | Claude Code main dev + Codex audit/fix + Gemini CLI docs/testing |
| Same CLI Multi-Model Collaboration | Frontend with glm-4.7, backend with claude-opus-4.6, review with gpt-5.3-codex-xhigh |
| Complex Task Loop | Terminal A implement → Terminal B review/test → Terminal C audit → Merge Terminal combine |
| Tool | Version Requirement |
|---|
| Rust | nightly-2025-12-04 |
| Node.js | >= 18 (20 recommended) |
| pnpm | 10.13.1 |
| SQLite | 3.x |
# Clone repository
git clone https://github.com/huanchong-99/GitCortex
cd GitCortex
# Install dependencies
pnpm install
# Set encryption key (required, 32 characters)
export GITCORTEX_ENCRYPTION_KEY="12345678901234567890123456789012"
# Build backend
cargo build --release
# Start development server
pnpm run dev
Access: Frontend http://localhost:23457, Backend API http://localhost:23456/api
| Variable | Required | Description |
|---|
| GITCORTEX_ENCRYPTION_KEY | ✅ | 32-character encryption key |
| BACKEND_PORT | ❌ | Backend port (default 23456) |
| HOST | ❌ | Listen address (default 127.0.0.1) |
| GITCORTEX_API_TOKEN | ❌ | API Bearer authentication |