Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (codemachine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Multi-Agent Workflow Orchestration
โจ CodeMachine Built Itself
90% of this entire codebase was generated by CodeMachine from a single specification file. This isn't a demoโit's proof. CodeMachine orchestrated its own architecture, planning, implementation, and testing.
What is CodeMachine CLI?
CodeMachine CLI is a multi-agent workflow orchestration framework that transforms project specifications into production-ready codebases. You feed it a spec, and CodeMachine orchestrates top-tier agents like Claude CLI and Codex CLI end-to-end to deliver complex builds while you define the workflow. It also coordinates additional providers (Gemini CLI, Qwen Coder) in parallel so each agent tackles the slice it does best.
Why CodeMachine?
- ๐ Custom Workflows: Design orchestration workflows for any complexityโfrom simple scripts to multi-day development cycles
- ๐ค Multi-Agent Collaboration: Mix AI providers strategically (Gemini plans, Claude builds, Codex reviews)
- โก Parallel Execution: Sub-agents work simultaneously for 10x faster output
- ๐ฏ Endless Orchestration: Workflows run for hours or days to achieve complex goals automatically
๐ Quick Start
Get CodeMachine up and running in minutes:
1. Install CodeMachine
npm install -g codemachine2. Run CodeMachine
Navigate to your project directory and run:
cd ~/your-project-directory
codemachineOn first run, CodeMachine creates a .codemachine/ folder. Write your project requirements in .codemachine/inputs/specifications.md, choose a workflow template, and watch as CodeMachine orchestrates specialized agents to:
- Design your system architecture
- Generate implementation plans
- Write production-ready code
- Create automation scripts
- Validate outputs against your specs
Supported AI Engines
| CLI Engine | Status | Main Agents | Sub Agents | Orchestrate |
|---|---|---|---|---|
| Codex CLI | โ Supported | โ | โ | โ |
| Claude Code | โ Supported | โ | โ | โ |
| Gemini CLI | ๐ง Coming Soon | ๐ง | ๐ง | ๐ง |
| Qwen Coder | ๐ง Coming Soon | ๐ง | ๐ง | ๐ง |
Requirements
- Node.js โฅ 20.10.0 and npm โฅ 9 (pnpm works too)
- From source:
pnpm install && pnpm build(trypnpm testto verify the workspace)
Core CLI Commands
(codemachine --help for options)
codemachine templatesโ list and activate workflow templatescodemachine agent <id> "prompt"โ run a specific agent once; supports--profileand--model
Workflow & Specs
- Specs live in
.codemachine/inputs/specifications.mdonce you bootstrap - Workflow templates reside in
templates/workflows/; pick or extend them withcodemachine templates - Generated agents and run state land in
.codemachine/; inspect logs under.codemachine/runtime - Deep dives: docs/CLI-ENGINES.md, docs/operations, and docs/architecture
That's it! Your complete codebase will be generated and ready to ship.
๐ฎ Example: Snake Game
CodeMachine handles complex, large-scale projects. We created this simple showcase to demonstrate the workflow.
We wrote a simple specification for a classic snake game:
# Snake Game Specification
## Goal
Create a classic snake game that runs in the terminal or browser.
## Core Features
- Snake moves continuously in a direction (up, down, left, right)
- Player controls direction using arrow keys or WASD
- Snake grows longer when eating food
- Food spawns randomly on the grid
- Game ends when snake hits wall or itself
- Display current score (length of snake)
## Technical Requirements
- Game grid: 20x20 cells
- Initial snake length: 3 segments
- Game speed: 100-200ms per frame
The comparison speaks for itself: GPT-5 Codex (High) alone vs. CodeMachine's default workflow powered by GPT-5 Codex (Low). The quality gap is massive. Multi-agent workflow orchestration delivers production-ready results that far exceed what single-agent generation can achieveโeven with a more powerful model.
See the full Snake Game implementation โ Explore the complete project structure, git commit history showing CodeMachine's step-by-step workflow, and both stunning terminal and web versions generated from a single specification.
๐ ๏ธ How It Works
CodeMachine orchestrates workflows through sequential main agent steps and parallel sub-agent execution. After selecting a workflow template, the main agent processes each step in order. When sub-agents are triggered, they work simultaneously on specialized tasks (e.g., frontend, backend, database), then results flow back into the main workflow. Conditional loops allow workflows to iterate until completion criteria are met.
Example Workflow:
export default {
name: 'E-Commerce Platform Builder',
steps: [
resolveStep('arch-agent', { engine: 'claude' }), // Claude designs system architecture
resolveStep('plan-agent', { engine: 'claude' }), // Claude creates detailed implementation plan
resolveStep('code-generation', { engine: 'codex' }), // Codex generates implementation
resolveStep('runtime-prep', { engine: 'codex' }), // Codex creates automation scripts
resolveStep('quality-check', { engine: 'codex' }), // Codex reviews code quality and runtime
resolveModule('check-task', { // Loop until all tasks complete
loopTrigger: 'TASKS_COMPLETED=FALSE',
loopMaxIterations: 15
}),
],
subAgentIds: ['payment-agent', 'inventory-agent', 'auth-agent'], // Sub-agents work in parallel
};