<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex</title>
    <description>The latest articles on DEV Community by Alex (@oxgeneral).</description>
    <link>https://dev.to/oxgeneral</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3822984%2Fdb8cdae6-1689-4b0f-8455-336f33211fc9.jpeg</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/oxgeneral</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oxgeneral"/>
    <language>en</language>
    <item>
      <title>Orchestrating a Team of AI Agents from a Single CLI</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Fri, 13 Mar 2026 19:38:09 +0000</pubDate>
      <link>https://dev.to/oxgeneral/orchestrating-a-team-of-ai-agents-from-a-single-cli-4h6</link>
      <guid>https://dev.to/oxgeneral/orchestrating-a-team-of-ai-agents-from-a-single-cli-4h6</guid>
      <description>&lt;p&gt;&lt;em&gt;Published: 2026-03-13 | Target: Dev.to / Hashnode | Audience: Senior devs, DevOps engineers, ML engineers&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: You've Become a Human Message Bus
&lt;/h2&gt;

&lt;p&gt;Picture this: you're running a feature sprint with three AI agents. Claude Code is implementing an OAuth2 flow in one terminal. OpenAI Codex is writing integration tests in another. A shell script is running database migrations somewhere else.&lt;/p&gt;

&lt;p&gt;You're copy-pasting context between terminals, manually checking whether each agent is done, restarting the one that crashed, and deciding which task should go next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You haven't automated your workflow. You've automated individual steps and manually stitched them together.&lt;/strong&gt; The coordination overhead — tracking state, routing context, handling failures — still lands on you.&lt;/p&gt;

&lt;p&gt;This is the core problem when running 3+ AI agents: the agents themselves are capable, but there's nothing managing them as a team. You fill that gap.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before ORCH:
  You → Claude ("implement auth")
  You → Codex ("write tests for auth")
  You → Claude ("auth failed, retry with this context...")
  You → Codex ("actually, auth changed, update tests")
  You → You ("why am I doing this manually")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Solution: A CLI Orchestrator with a Real State Machine
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/oxgeneral/ORCH" rel="noopener noreferrer"&gt;ORCH&lt;/a&gt; is a CLI tool that manages your AI agents as a team. You define agents once, add tasks, and let the orchestrator handle dispatch, retries, and coordination.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;orch run &lt;span class="nt"&gt;--all&lt;/span&gt;

  orch · watching · 3 running · 0 queued

  14:32  ▶ Backend A    → &lt;span class="s2"&gt;"Implement OAuth2 flow"&lt;/span&gt;
  14:32  ▶ Backend B    → &lt;span class="s2"&gt;"Write API integration tests"&lt;/span&gt;
  14:32  ▶ QA           → &lt;span class="s2"&gt;"Verify auth edge cases"&lt;/span&gt;
  14:35  ✓ Backend B    DONE  &lt;span class="o"&gt;(&lt;/span&gt;3m 12s · 4,200 tokens&lt;span class="o"&gt;)&lt;/span&gt;
  14:38  ✓ Backend A    DONE  &lt;span class="o"&gt;(&lt;/span&gt;6m 44s · 8,100 tokens&lt;span class="o"&gt;)&lt;/span&gt;
  14:39  ↻ QA           RETRY  attempt 2 · found regression
  14:41  ✓ QA           DONE  &lt;span class="o"&gt;(&lt;/span&gt;2m 15s · 2,800 tokens&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No tab-switching. No manual routing. The agents work; you watch metrics.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture: Three Layers That Scale
&lt;/h2&gt;

&lt;p&gt;The architecture follows domain-driven design with clean separation between what the system knows (domain), what it does (application), and how it stores things (infrastructure).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────┐
│                   CLI / TUI Interface                │
│  Commands (Commander.js)    Dashboard (Ink/React)    │
└─────────────────────────┬───────────────────────────┘
                          │
┌─────────────────────────▼───────────────────────────┐
│              Application Layer                       │
│  Orchestrator  ←→  EventBus  ←→  Services           │
│  (tick/dispatch/reconcile)      (Task/Agent/Goal)   │
└──────────┬───────────────────────────────┬──────────┘
           │                               │
┌──────────▼──────────┐    ┌───────────────▼──────────┐
│   Domain Layer       │    │  Infrastructure Layer     │
│   State Machine      │    │  Adapters: claude/codex/  │
│   todo→in_progress   │    │  cursor/shell             │
│   →review→done       │    │  Storage: YAML/JSON/JSONL │
│   Events (31 types)  │    │  Process Manager          │
└─────────────────────┘    └──────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The State Machine
&lt;/h3&gt;

&lt;p&gt;Every task follows a validated state machine. Invalid transitions are rejected at the domain layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;todo → in_progress → review → done
                   ↘ retrying → in_progress
                   ↘ failed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This isn't a glorified TODO list. When an agent finishes, the task goes to &lt;code&gt;review&lt;/code&gt; — it doesn't jump straight to &lt;code&gt;done&lt;/code&gt;. When it fails, ORCH retries with exponential backoff. When an agent stalls (exceeds timeout), ORCH kills it and re-queues the task. These transitions are enforced by &lt;code&gt;transitions.ts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/domain/transitions.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;VALID_TRANSITIONS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Record&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TaskStatus&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;TaskStatus&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;in_progress&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cancelled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;in_progress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;review&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;retrying&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;failed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cancelled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;review&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;      &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;done&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;in_progress&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;failed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;retrying&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;in_progress&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;failed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cancelled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="na"&gt;failed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;      &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;todo&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;cancelled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Event Bus
&lt;/h3&gt;

&lt;p&gt;Everything in ORCH communicates through a typed event bus. Agents emit events, the orchestrator reacts, the TUI updates — all decoupled. There are 31 event types covering the full lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Sampling of event types from src/domain/events.ts&lt;/span&gt;
&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;task:created&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;task:status_changed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;task:scope_overlap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;agent:output&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;agent:completed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;agent:error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;run:started&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;run:finished&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;goal:created&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;goal:status_changed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;team:created&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;team:task_claimed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orchestrator:error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;orchestrator:shutdown&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message:sent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message:delivered&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The event bus supports wildcard subscriptions (&lt;code&gt;onAny()&lt;/code&gt;), which is how the TUI activity feed works — it receives every event without knowing the event types in advance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adapters: The Plugin Layer
&lt;/h3&gt;

&lt;p&gt;Each AI tool is wrapped in an adapter that implements a common interface. You get Claude, Codex, Cursor, and Shell out of the box:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/infrastructure/adapters/
├── claude.ts    # Claude Code CLI (claude --print)
├── codex.ts     # OpenAI Codex CLI (codex exec --json)
├── cursor.ts    # Cursor Agent (headless mode)
├── shell.ts     # Any command: npm test, python bot.py, etc.
└── utils.ts     # Shared: extractTokens, createStreamingEvents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adapters are async generators that stream events — token counts, file changes, output chunks — as they happen. The orchestrator consumes these streams and writes to JSONL event logs for replay and analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  File-Based Storage: No Database Required
&lt;/h3&gt;

&lt;p&gt;State lives entirely in &lt;code&gt;.orchestry/&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;.orchestry/&lt;/span&gt;
&lt;span class="s"&gt;├── config.yml&lt;/span&gt;          &lt;span class="c1"&gt;# Project config (agents, timeouts, max_concurrent)&lt;/span&gt;
&lt;span class="s"&gt;├── state.json&lt;/span&gt;          &lt;span class="c1"&gt;# Live orchestrator state (running, claimed, retry_queue)&lt;/span&gt;
&lt;span class="s"&gt;├── tasks/&lt;/span&gt;              &lt;span class="c1"&gt;# One YAML file per task&lt;/span&gt;
&lt;span class="s"&gt;├── agents/&lt;/span&gt;             &lt;span class="c1"&gt;# One YAML file per agent&lt;/span&gt;
&lt;span class="s"&gt;├── runs/&lt;/span&gt;               &lt;span class="c1"&gt;# JSON metadata + JSONL event streams per run&lt;/span&gt;
&lt;span class="s"&gt;├── goals/&lt;/span&gt;              &lt;span class="c1"&gt;# Goal YAML files&lt;/span&gt;
&lt;span class="s"&gt;├── teams/&lt;/span&gt;              &lt;span class="c1"&gt;# Team YAML files&lt;/span&gt;
&lt;span class="s"&gt;└── messages/&lt;/span&gt;           &lt;span class="c1"&gt;# Message YAML files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Atomic writes (temp file → rename) prevent corruption. File locking with O_EXCL prevents concurrent orchestrator instances. JSONL streams support tail-reads for large log files without loading everything into memory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo Walkthrough: 10 Commands to a Working Agent Team
&lt;/h2&gt;

&lt;p&gt;Here's the complete setup for a TypeScript project with a Backend agent, a QA agent, and task coordination:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Initialize the project
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/my-project
orch init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates &lt;code&gt;.orchestry/config.yml&lt;/code&gt; with sensible defaults. An Agent Creator agent is included automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Add your agents
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;orch agent add &lt;span class="s2"&gt;"Backend"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--adapter&lt;/span&gt; claude &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--model&lt;/span&gt; claude-sonnet-4-6 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"Senior TypeScript developer. Implements features following DDD patterns. Uses Promise.all for I/O, atomic writes for file operations. Runs tsc --noEmit and vitest run before finishing."&lt;/span&gt;

orch agent add &lt;span class="s2"&gt;"QA"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--adapter&lt;/span&gt; claude &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--model&lt;/span&gt; claude-sonnet-4-6 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"QA engineer. Writes Vitest tests. Checks TypeScript types. Verifies edge cases and error handling. Never fixes bugs directly — files tasks for developers."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Create tasks
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;orch task add &lt;span class="s2"&gt;"Implement OAuth2 flow with refresh token rotation"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--priority&lt;/span&gt; 1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--scope&lt;/span&gt; &lt;span class="s2"&gt;"src/auth/**"&lt;/span&gt;

orch task add &lt;span class="s2"&gt;"Write integration tests for OAuth2 endpoints"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--priority&lt;/span&gt; 2 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--scope&lt;/span&gt; &lt;span class="s2"&gt;"test/integration/**"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--depends-on&lt;/span&gt; &amp;lt;oauth-task-id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--scope&lt;/code&gt; flag prevents two agents from touching the same files simultaneously. &lt;code&gt;--depends-on&lt;/code&gt; ensures the QA task only dispatches after OAuth is done.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Set a strategic goal
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;orch goal add &lt;span class="s2"&gt;"Ship OAuth2 authentication"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--description&lt;/span&gt; &lt;span class="s2"&gt;"Complete implementation, tests, and documentation for the OAuth2 flow by end of sprint"&lt;/span&gt;

orch goal status &amp;lt;goal-id&amp;gt; active
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In autonomous mode, ORCH generates tasks for idle agents based on active goals. The agents stay productive without manual task creation.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Run everything
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;orch run &lt;span class="nt"&gt;--watch&lt;/span&gt;   &lt;span class="c"&gt;# daemon mode — dispatches continuously&lt;/span&gt;
&lt;span class="c"&gt;# or&lt;/span&gt;
orch             &lt;span class="c"&gt;# opens the TUI dashboard&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. Monitor from the dashboard
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;orch            &lt;span class="c"&gt;# TUI with Tasks / Agents / Goals tabs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The TUI shows live task statuses, agent activity with token counts, and the event stream. You can create tasks, assign agents, and approve reviews — all with keyboard shortcuts, without leaving the terminal.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Inter-agent messaging
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Agent shares findings with the team&lt;/span&gt;
orch msg send &amp;lt;qa-agent-id&amp;gt; &lt;span class="s2"&gt;"Auth tests failing on token expiry edge case — see test/auth.spec.ts:142"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--subject&lt;/span&gt; &lt;span class="s2"&gt;"OAuth regression"&lt;/span&gt;

&lt;span class="c"&gt;# Or broadcast to everyone&lt;/span&gt;
orch msg broadcast &lt;span class="s2"&gt;"Sprint review in 30 min — wrap up current tasks"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--subject&lt;/span&gt; &lt;span class="s2"&gt;"Coordination"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8. Shared context store
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Agent writes results others can read&lt;/span&gt;
orch context &lt;span class="nb"&gt;set &lt;/span&gt;oauth-endpoints &lt;span class="s2"&gt;"POST /auth/token, POST /auth/refresh, DELETE /auth/logout"&lt;/span&gt;

&lt;span class="c"&gt;# Another agent reads it&lt;/span&gt;
orch context get oauth-endpoints
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The context store supports TTL for ephemeral data. Agents use it to share findings mid-run without direct coordination.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Design Decisions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Decision 1: File-based state over a database
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;.orchestry/&lt;/code&gt; directory is the entire system state. This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero infrastructure to set up or maintain&lt;/li&gt;
&lt;li&gt;State is readable, debuggable, and git-committable&lt;/li&gt;
&lt;li&gt;Atomic writes prevent corruption without transactions&lt;/li&gt;
&lt;li&gt;JSONL event logs are append-only — concurrent agents don't conflict&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cost: reading large task lists requires Promise.all parallelization (implemented), and JSONL logs need tail-reads for large files (also implemented via &lt;code&gt;readJsonlTail()&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision 2: Reactive dispatch over polling
&lt;/h3&gt;

&lt;p&gt;Early versions polled every 30 seconds. That meant new tasks waited up to 30 seconds before dispatching — unacceptable for interactive use. The solution: when a task is created, the event bus emits &lt;code&gt;task:created&lt;/code&gt;, and a debounced handler triggers an immediate mini-dispatch cycle (500ms debounce, no reconcile). Agents start working in under a second.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision 3: Scope overlap as a safety mechanism
&lt;/h3&gt;

&lt;p&gt;Two agents editing the same files simultaneously produces merge conflicts and corrupted state. The scope system detects overlap at dispatch time and blocks conflicting tasks. Instead of failing silently, it emits a &lt;code&gt;task:scope_overlap&lt;/code&gt; event visible in the activity feed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision 4: 31-event typed bus, not logging
&lt;/h3&gt;

&lt;p&gt;Every meaningful state change is an event, not a log line. This enables the TUI to react in real-time, the context store to be event-sourced, and test suites to assert on specific events rather than parsing strings. The event bus has max listener protection and wildcard subscription support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision 5: Adapters as async generators
&lt;/h3&gt;

&lt;p&gt;Agent execution yields events as they happen — output chunks, token counts, file modifications. This enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time TUI streaming (batched at 80ms for performance)&lt;/li&gt;
&lt;li&gt;Per-run JSONL event logs for audit and replay&lt;/li&gt;
&lt;li&gt;Token counting and cost tracking per task&lt;/li&gt;
&lt;li&gt;Stall detection without polling (last-event timestamp)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Workspace isolation&lt;/strong&gt;: Currently &lt;code&gt;worktree&lt;/code&gt; mode creates a git worktree per run for file isolation. &lt;code&gt;isolated&lt;/code&gt; mode clones the entire repo. We're working on merge-back strategies for parallel agents editing the same repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Review pipeline&lt;/strong&gt;: The auto-review feature (currently in &lt;code&gt;review-runner.ts&lt;/code&gt;) runs a reviewer agent on task output before transitioning to &lt;code&gt;done&lt;/code&gt;. We're expanding this with configurable review criteria and structured feedback.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Goal decomposition&lt;/strong&gt;: When a goal is assigned to an agent in autonomous mode, the agent generates subtasks. We're working on goal templates that provide decomposition hints for common workflows (feature development, refactoring, documentation).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;npm registry&lt;/strong&gt;: Currently published to GitHub Packages. Moving to the public npm registry for easier installation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @oxgeneral/orch &lt;span class="nt"&gt;--registry&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://npm.pkg.github.com

&lt;span class="nb"&gt;cd&lt;/span&gt; ~/your-project
orch init
orch agent add &lt;span class="s2"&gt;"Backend"&lt;/span&gt; &lt;span class="nt"&gt;--adapter&lt;/span&gt; claude &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"TypeScript developer"&lt;/span&gt;
orch task add &lt;span class="s2"&gt;"Your first task"&lt;/span&gt; &lt;span class="nt"&gt;--priority&lt;/span&gt; 1
orch run &lt;span class="nt"&gt;--all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full TUI launches with &lt;code&gt;orch&lt;/code&gt;. 987 tests, strict TypeScript, MIT license.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/oxgeneral/ORCH" rel="noopener noreferrer"&gt;https://github.com/oxgeneral/ORCH&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're running multiple AI agents and spending more time coordinating them than doing actual engineering work — that's the exact problem ORCH was built to solve. Questions about the architecture or autonomous mode? Drop them in the comments.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tags: &lt;code&gt;ai-agents&lt;/code&gt;, &lt;code&gt;cli&lt;/code&gt;, &lt;code&gt;devops&lt;/code&gt;, &lt;code&gt;typescript&lt;/code&gt;, &lt;code&gt;automation&lt;/code&gt;, &lt;code&gt;developer-tools&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Found this useful?
&lt;/h2&gt;

&lt;p&gt;If this post helped you think about AI agent orchestration differently, here's how to support the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Star the repo on GitHub&lt;/strong&gt;: &lt;a href="https://github.com/oxgeneral/ORCH" rel="noopener noreferrer"&gt;github.com/oxgeneral/ORCH&lt;/a&gt; — it helps others discover the project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install and try it&lt;/strong&gt;: &lt;code&gt;npm install -g @oxgeneral/orch&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Join the discussion&lt;/strong&gt;: &lt;a href="https://github.com/oxgeneral/ORCH/discussions" rel="noopener noreferrer"&gt;GitHub Discussions&lt;/a&gt; — questions, ideas, and feedback welcome&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Built with 987 tests, strict TypeScript, and MIT license. Pull requests open.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
