@aryanbhargav/codebridge 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +201 -0
- package/codebridge.config.example.yaml +62 -0
- package/dist/bin/codebridge.js +889 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aryan Bhargav
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# CodeBridge
|
|
2
|
+
|
|
3
|
+
> **Multi-Agent Coding Orchestrator CLI** — Coordinate multiple AI coding agents to collaborate on complex tasks
|
|
4
|
+
|
|
5
|
+
CodeBridge is a lightweight CLI orchestrator that enables multiple coding agents (Claude Code, Codex CLI, Qwen Code, Aider, Gemini CLI) to collaborate on tasks through a structured **planner → critic → executor → reviewer** loop.
|
|
6
|
+
|
|
7
|
+
## What is CodeBridge?
|
|
8
|
+
|
|
9
|
+
CodeBridge **does NOT replace** any coding agent — it sits above them, coordinating their work through their non-interactive/headless modes. The unique value proposition: **any coding CLI can talk to any other coding CLI to complete a task together**. One agent plans, another executes, a third reviews. The orchestrator manages the conversation between them.
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
┌──────────────────────────────────────────────────────────┐
|
|
15
|
+
│ CodeBridge CLI │
|
|
16
|
+
│ │
|
|
17
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
18
|
+
│ │ Orchestration Engine │ │
|
|
19
|
+
│ │ │ │
|
|
20
|
+
│ │ PLAN → CRITIQUE → EXECUTE → REVIEW → REPAIR │ │
|
|
21
|
+
│ │ │ │
|
|
22
|
+
│ │ State Machine + Run Manager + Config Loader │ │
|
|
23
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
24
|
+
│ │ │
|
|
25
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
26
|
+
│ │ Adapter Layer (Plugin System) │ │
|
|
27
|
+
│ │ │ │
|
|
28
|
+
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
|
|
29
|
+
│ │ │ Claude │ │ Codex │ │ Qwen │ │ │
|
|
30
|
+
│ │ │ Code │ │ CLI │ │ Code │ │ │
|
|
31
|
+
│ │ │ Adapter │ │ Adapter │ │ Adapter │ ... │ │
|
|
32
|
+
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
|
|
33
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
34
|
+
└──────────────────────────────────────────────────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
### Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Install globally from npm
|
|
43
|
+
npm install -g @aryanbhargav/codebridge
|
|
44
|
+
|
|
45
|
+
# Or run without installing
|
|
46
|
+
bunx @aryanbhargav/codebridge --help
|
|
47
|
+
|
|
48
|
+
# Install dependencies
|
|
49
|
+
bun install
|
|
50
|
+
|
|
51
|
+
# Build the project
|
|
52
|
+
bun run build
|
|
53
|
+
|
|
54
|
+
# Link for local development
|
|
55
|
+
bun link
|
|
56
|
+
|
|
57
|
+
# Or run directly
|
|
58
|
+
bun bin/codebridge.ts --help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Initialize Configuration
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Create codebridge.config.yaml in your project
|
|
65
|
+
codebridge init
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Check Available Adapters
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# See which coding agents are installed
|
|
72
|
+
codebridge adapters
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Run Your First Task
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Basic usage
|
|
79
|
+
codebridge run --task "Add error handling to src/api.ts" \
|
|
80
|
+
--planner claude-code \
|
|
81
|
+
--executor qwen-code
|
|
82
|
+
|
|
83
|
+
# With critic and reviewer
|
|
84
|
+
codebridge run --task "Refactor authentication module" \
|
|
85
|
+
--planner claude-code \
|
|
86
|
+
--executor qwen-code \
|
|
87
|
+
--critic claude-code \
|
|
88
|
+
--reviewer claude-code
|
|
89
|
+
|
|
90
|
+
# Auto-approve (skip human confirmation)
|
|
91
|
+
codebridge run --task "Fix bug in checkout flow" \
|
|
92
|
+
--planner claude-code \
|
|
93
|
+
--executor qwen-code \
|
|
94
|
+
--auto-approve
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Supported Agents
|
|
98
|
+
|
|
99
|
+
| Agent | Binary | Status | Notes |
|
|
100
|
+
|-------|--------|--------|-------|
|
|
101
|
+
| **Claude Code** | `claude` | ✅ Full Support | Best for planning and reviewing |
|
|
102
|
+
| **Qwen Code** | `qwen` | ✅ Full Support | Configure model in `~/.qwen/settings.json` |
|
|
103
|
+
| **Codex CLI** | `codex` | ✅ Full Support | OpenAI Codex integration |
|
|
104
|
+
| **Aider** | `aider` | ⚠️ Partial Support | Install: `pip install aider-chat` |
|
|
105
|
+
| **Gemini CLI** | `gemini` | ✅ Full Support | Google Gemini integration |
|
|
106
|
+
|
|
107
|
+
## Commands
|
|
108
|
+
|
|
109
|
+
### `codebridge run`
|
|
110
|
+
|
|
111
|
+
Run a complete multi-agent coding task.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
codebridge run [options]
|
|
115
|
+
|
|
116
|
+
Options:
|
|
117
|
+
-t, --task <task> Task description or @file.md
|
|
118
|
+
-p, --planner <adapter> Planner adapter name (default: claude-code)
|
|
119
|
+
-e, --executor <adapter> Executor adapter name (default: qwen-code)
|
|
120
|
+
--critic <adapter> Critic adapter name (optional)
|
|
121
|
+
--reviewer <adapter> Reviewer adapter name (optional)
|
|
122
|
+
--auto-approve Skip human approval step
|
|
123
|
+
--max-plan-rounds <n> Max plan-critique iterations (default: 3)
|
|
124
|
+
--max-repair-rounds <n> Max review-repair iterations (default: 2)
|
|
125
|
+
-c, --context <files...> Additional context files (glob patterns)
|
|
126
|
+
--config <path> Path to config file
|
|
127
|
+
-v, --verbose Show debug output
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Other Commands
|
|
131
|
+
|
|
132
|
+
- `codebridge plan` — Create a plan without executing
|
|
133
|
+
- `codebridge resume --run <id>` — Resume a paused/failed run
|
|
134
|
+
- `codebridge status [run-id]` — Show run status
|
|
135
|
+
- `codebridge list` — List all runs
|
|
136
|
+
- `codebridge adapters` — List available adapters
|
|
137
|
+
- `codebridge config` — Show current configuration
|
|
138
|
+
- `codebridge init` — Create config file
|
|
139
|
+
|
|
140
|
+
## Configuration
|
|
141
|
+
|
|
142
|
+
Configuration is loaded from (in priority order, later overrides earlier):
|
|
143
|
+
|
|
144
|
+
1. Built-in defaults
|
|
145
|
+
2. `~/.codebridge/config.yaml` (user-level)
|
|
146
|
+
3. `./codebridge.config.yaml` (project-level)
|
|
147
|
+
4. CLI flags
|
|
148
|
+
|
|
149
|
+
### Example Configuration
|
|
150
|
+
|
|
151
|
+
See `codebridge.config.example.yaml` for a complete example.
|
|
152
|
+
|
|
153
|
+
## How It Works
|
|
154
|
+
|
|
155
|
+
CodeBridge follows a structured workflow:
|
|
156
|
+
|
|
157
|
+
1. **PLANNING**: Planner agent creates a detailed implementation plan
|
|
158
|
+
2. **CRITIQUING** (optional): Critic agent reviews the plan for gaps and risks
|
|
159
|
+
3. **AWAITING_APPROVAL**: Human reviews and approves the plan (unless `--auto-approve`)
|
|
160
|
+
4. **EXECUTING**: Executor agent implements the approved plan
|
|
161
|
+
5. **REVIEWING**: Reviewer agent verifies the implementation
|
|
162
|
+
6. **REPAIRING** (if needed): Executor fixes issues identified by reviewer
|
|
163
|
+
7. **COMPLETED**: Task successfully finished
|
|
164
|
+
|
|
165
|
+
All interactions are logged in `.runs/<run-id>/`.
|
|
166
|
+
|
|
167
|
+
## Development
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Install dependencies
|
|
171
|
+
bun install
|
|
172
|
+
|
|
173
|
+
# Run in dev mode
|
|
174
|
+
bun run dev
|
|
175
|
+
|
|
176
|
+
# Build
|
|
177
|
+
bun run build
|
|
178
|
+
|
|
179
|
+
# Test
|
|
180
|
+
bun test
|
|
181
|
+
|
|
182
|
+
# Type check
|
|
183
|
+
bun run typecheck
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Design Principles
|
|
187
|
+
|
|
188
|
+
1. **Thin orchestrator** — CodeBridge is <2000 lines of TypeScript
|
|
189
|
+
2. **Adapters are dumb pipes** — Just CLI wrappers, no agent-specific logic
|
|
190
|
+
3. **Everything is a message** — Full auditability and debuggability
|
|
191
|
+
4. **Human in the loop by default** — Auto-approve is opt-in
|
|
192
|
+
5. **Fail gracefully** — Full error context captured
|
|
193
|
+
6. **No lock-in** — Swap agents with a single flag
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
MIT
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
Built with ❤️ using [Bun](https://bun.sh) and TypeScript.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# CodeBridge Configuration Example
|
|
2
|
+
# Copy this file to codebridge.config.yaml and customize for your project
|
|
3
|
+
|
|
4
|
+
# Default agent assignments for each role
|
|
5
|
+
defaults:
|
|
6
|
+
planner: claude-code # Agent responsible for creating plans
|
|
7
|
+
executor: qwen-code # Agent that executes the plan
|
|
8
|
+
critic: claude-code # Optional: Agent that critiques plans (defaults to planner)
|
|
9
|
+
reviewer: claude-code # Optional: Agent that reviews execution (defaults to planner)
|
|
10
|
+
maxPlanRounds: 3 # Maximum plan-critique iterations
|
|
11
|
+
maxRepairRounds: 2 # Maximum review-repair iterations
|
|
12
|
+
autoApprove: false # Skip human approval before execution
|
|
13
|
+
timeout: 300000 # Default timeout in ms (5 minutes)
|
|
14
|
+
|
|
15
|
+
# Per-adapter configuration overrides
|
|
16
|
+
adapters:
|
|
17
|
+
claude-code:
|
|
18
|
+
# binary: /custom/path/to/claude # Override binary path if not in PATH
|
|
19
|
+
timeout: 600000 # 10 minutes for complex planning tasks
|
|
20
|
+
# args: ["--verbose"] # Additional CLI arguments
|
|
21
|
+
# env: # Additional environment variables
|
|
22
|
+
# CLAUDE_API_KEY: "your-key"
|
|
23
|
+
|
|
24
|
+
qwen-code:
|
|
25
|
+
timeout: 300000 # 5 minutes for execution
|
|
26
|
+
# Note: Qwen Code model is configured in ~/.qwen/settings.json
|
|
27
|
+
|
|
28
|
+
codex:
|
|
29
|
+
args: ["--full-auto"] # Enable full automation mode
|
|
30
|
+
timeout: 300000
|
|
31
|
+
|
|
32
|
+
aider:
|
|
33
|
+
args: ["--yes", "--no-git"] # Auto-confirm, disable git integration
|
|
34
|
+
timeout: 300000
|
|
35
|
+
|
|
36
|
+
gemini:
|
|
37
|
+
timeout: 300000
|
|
38
|
+
|
|
39
|
+
# Context gathering configuration
|
|
40
|
+
context:
|
|
41
|
+
# Files to include as context (glob patterns)
|
|
42
|
+
include:
|
|
43
|
+
- "src/**/*.ts"
|
|
44
|
+
- "src/**/*.js"
|
|
45
|
+
- "package.json"
|
|
46
|
+
- "README.md"
|
|
47
|
+
- "tsconfig.json"
|
|
48
|
+
|
|
49
|
+
# Files to exclude from context
|
|
50
|
+
exclude:
|
|
51
|
+
- "node_modules"
|
|
52
|
+
- ".git"
|
|
53
|
+
- "dist"
|
|
54
|
+
- "*.lock"
|
|
55
|
+
- "*.log"
|
|
56
|
+
- ".runs"
|
|
57
|
+
|
|
58
|
+
# Maximum size for individual files (in bytes)
|
|
59
|
+
maxFileSize: 100000 # 100 KB
|
|
60
|
+
|
|
61
|
+
# Maximum total context size (in bytes)
|
|
62
|
+
maxTotalContext: 500000 # 500 KB
|