<p align="center">
  <img src="https://raw.githubusercontent.com/moazbuilds/CodeMachine-CLI/main/images/banner.png" alt="CodeMachine Banner" width="100%">
</p>

<p align="center">
  <code>npm i -g codemachine</code>
</p>


<p align="center">
  <strong>CodeMachine is an open-source tool that orchestrates AI coding agents into repeatable, long-running workflows. ⚡️<br></p></strong>

---

Every time you use an AI coding agent, you're running a workflow. Fix a bug? You ask questions, reproduce, analyze, plan, implement, test. Build a feature? You research, design, code, review.

**The workflow lives in your head.** You guide the agent through it, step by step, session by session. But every time you start, you rebuild it from scratch. You re-explain the process. You remember to ask the right questions. You manage when to clear context, when to push forward, when to loop back.

<p align="center"><strong>CodeMachine lets you capture that workflow and run it again.</strong></p>

<p align="center">
  <a href="https://www.youtube.com/watch?v=G7OTG9iSvYw" target="_blank">
    <img src="https://raw.githubusercontent.com/moazbuilds/CodeMachine-CLI/main/images/video-thumbnail.png" alt="Watch CodeMachine Demo">
  </a>
</p>

## How It Works

CodeMachine is an orchestration layer that runs AI coding CLIs through structured workflows. You define the workflow once, and CodeMachine handles execution, context passing, and agent coordination.


It uses the headless scripting mode that AI coding engines provide for automation (Claude Code, Codex, Cursor, and others). It spawns engines via CLI, passes the right arguments and flags, and controls agents through its infrastructure.

**Build workflows from fully interactive to fully autonomous - and anything in between. <a href="https://docs.codemachine.co/core-concepts/workflow/orchestration-patterns" target="_blank">Learn about orchestration patterns →</a>**

## Why CodeMachine?

CM introduces innovative agent communication styles that have never existed for coding agents before - enabling you to build any complex workflow you can imagine. Start with the **Ali Workflow Builder** default workflow to create your first workflow interactively.

*   **Build Once, Run Forever:** Define complex workflows once and execute them reliably on every project - stop rebuilding the same patterns manually.
*   **Multi-Agent Orchestration:** Assign different agents to different tasks, enable them to communicate with each other, and collaborate on complex decisions.
*   **Parallel Execution:** Run multiple agents simultaneously on different parts of your workflow for faster results.
*   **Long-Running Workflows:** Execute workflows for hours or days - CodeMachine handles persistence so you don't have to babysit.
*   **Context Engineering:** Centralize prompts, manage dynamic context, and control what each agent sees at each step.

<p align="center"><strong>Ready to build your first workflow? <a href="https://docs.codemachine.co/getting-started/quickstart" target="_blank">Get started →</a></strong></p>

<p align="center">
  <a href="https://docs.codemachine.co" target="_blank">
    <img src="https://raw.githubusercontent.com/moazbuilds/CodeMachine-CLI/main/images/docs-badge.png" alt="Read the Docs">
  </a>
</p>

---

<p align="center">
  Developers are already building with CodeMachine - reducing time and effort on complex, repetitive workflows.<br/>
  <strong>Want to see what they're creating? Join us.</strong>
</p>

<p align="center">
  <a href="https://discord.gg/vS3A5UDNSq" target="_blank">
    <img src="https://raw.githubusercontent.com/moazbuilds/CodeMachine-CLI/main/images/discord-badge.png" alt="Join our Discord" width="200">
  </a>
  &nbsp;&nbsp;
  <a href="https://www.reddit.com/r/CodeMachine/" target="_blank">
    <img src="https://raw.githubusercontent.com/moazbuilds/CodeMachine-CLI/main/images/reddit-badge.png" alt="Join our Reddit" width="200">
  </a>
</p>