AI Agent Loop Orchestrator - A terminal UI for orchestrating AI coding agents to work through task lists autonomously.
Loopwright connects your AI coding assistant (GitHub Copilot CLI, OpenCode) to your task tracker and runs them in an autonomous loop, completing tasks one-by-one with intelligent selection, error handling, and full visibility.
- Bun - JavaScript runtime (REQUIRED)
- GitHub Copilot CLI - Default AI agent
# Windows - Option 1: via npm
npm install -g bun
# Windows - Option 2: via PowerShell
powershell -c "irm bun.sh/install.ps1 | iex"
# macOS/Linux
curl -fsSL https://bun.sh/install | bashAfter installation, verify Bun is available:
bun --version# Install the package
npm install -g @asidorenkocode/loopwright
# IMPORTANT: Also install with bun to create the CLI symlink
bun install -g @asidorenkocode/loopwrightNote: The
bun install -gstep is required to create theloopwrightcommand in your PATH.
See: https://github.com/github/copilot-cli
loopwright --helpIf you get "command not found", try:
# Option 1: Run directly with bunx
bunx @asidorenkocode/loopwright --help
# Option 2: Add bun's bin to PATH (add to your shell profile)
export PATH="$HOME/.bun/bin:$PATH"# Setup your project
cd your-project
loopwright setup
# Create a PRD with AI assistance
loopwright create-prd
# Or create a PRD from a Jira issue
loopwright create-prd --jira
# Run Loopwright!
loopwright run --prd ./tasks/prd.jsonThat's it! Loopwright will work through your tasks autonomously.
Loopwright integrates with Jira to convert your tickets into actionable PRDs with user stories.
# List your assigned Jira issues
loopwright jira-prdThis uses GitHub Copilot CLI's MCP (Model Context Protocol) to fetch issues assigned to you from Jira.
# Interactive: select a Jira ticket and generate a PRD
loopwright create-prd --jiraHow it works:
- Fetches your assigned Jira issues via Copilot CLI MCP
- Presents an interactive selector to choose a ticket
- Opens an AI chat session with the ticket context
- AI transforms the Jira ticket into a structured PRD with:
- User stories (US-001, US-002, etc.)
- Acceptance criteria as checklists
- Technical requirements extracted from the ticket
Example transformation:
Jira ticket:
TPH-123: Add dark mode support
Acceptance Criteria:
- User can toggle dark mode
- Settings persist across sessions
Generated PRD:
### US-001: Dark Mode Toggle
- [ ] Add toggle switch in settings page
- [ ] Toggle changes theme immediately
### US-002: Persist Dark Mode Setting
- [ ] Save preference to localStorage
- [ ] Load preference on app startupThe Jira integration uses GitHub Copilot CLI's MCP feature. Ensure your Copilot CLI is configured with Jira MCP access.
| Agent | Description | Default |
|---|---|---|
copilot |
GitHub Copilot CLI | Yes |
opencode |
OpenCode CLI | No |
┌─────────────────────────────────────────────────────────────────┐
│ PLANNING PHASE │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ JIRA │────▶│ AI CHAT │────▶│ PRD.JSON │ │
│ │ TICKET │ │ SESSION │ │ USER STORIES │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ EXECUTION PHASE │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ 1. SELECT │────▶│ 2. BUILD │────▶│ 3. EXECUTE │ │
│ │ TASK │ │ PROMPT │ │ AGENT │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ ▲ │ │
│ │ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ 5. NEXT │◀────────────────────────│ 4. DETECT │ │
│ │ TASK │ │ COMPLETION │ │
│ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Planning Phase:
- Fetch a Jira ticket (or create manually)
- AI chat transforms it into user stories with acceptance criteria
- Save as
prd.json- your task list
Execution Phase:
- Loopwright selects the highest-priority incomplete task
- Builds a prompt with task details + context
- Executes your AI agent (Copilot CLI)
- Detects completion via
<promise>COMPLETE</promise>token - Marks task done, moves to next
Repeat until all tasks are complete.
- Jira Integration: Convert Jira tickets to PRDs with AI-generated user stories
- AI Agents: GitHub Copilot CLI (default), OpenCode
- Task Trackers: prd.json (simple), Beads (git-backed with dependencies)
- Session Persistence: Pause anytime, resume later, survive crashes
- Real-time TUI: Watch agent output, control execution with keyboard shortcuts
- Cross-iteration Context: Automatic progress tracking between tasks
- Cross-platform: Works on Windows, macOS, and Linux
Loopwright can analyze your project structure to help AI agents understand the codebase. The learn command scans your project, detects patterns, and generates a context file (loopwright-context.md) that agents can use for better code understanding.
# Analyze current directory
loopwright learn
# Analyze a specific path
loopwright learn ./my-project
# Custom output file
loopwright learn --output ./docs/context.md# Quick structural scan
loopwright learn --depth shallow
# Standard analysis (default)
loopwright learn --depth standard
# Deep analysis with code patterns
loopwright learn --depth deepUse the --agent flag to enable intelligent folder grouping via GitHub Copilot:
# Let AI analyze and group related code
loopwright learn --agent
# Preview the analysis plan without executing
loopwright learn --agent --dry-run
# Choose a specific splitting strategy
loopwright learn --agent --strategy domainSplitting Strategies:
| Strategy | Description |
|---|---|
auto |
Let the AI choose the best strategy (default) |
top-level |
Split by top-level directories |
domain |
Group by code dependencies/imports |
balanced |
Distribute files evenly across workers |
- Project structure: Directory tree and organization
- Project types: Detected frameworks and languages (TypeScript, React, etc.)
- Conventions: Coding patterns and standards
- Dependencies: Package relationships
- Architectural patterns: Design patterns in use
The following are excluded by default:
- Build directories:
node_modules/,dist/,build/,.next/ - Binary files: images, videos, archives, compiled files
- Patterns from
.gitignoreand.loopwrightignore
Override exclusions with --include:
loopwright learn --include "dist/**" --include "*.min.js"| Command | Description |
|---|---|
loopwright |
Launch the interactive TUI |
loopwright run [options] |
Start Loopwright execution |
loopwright resume |
Resume an interrupted session |
loopwright status |
Check session status |
loopwright logs |
View iteration output logs |
loopwright setup |
Run interactive project setup |
loopwright learn |
Analyze project for AI agents |
loopwright create-prd |
Create a new PRD interactively |
loopwright create-prd --jira |
Create PRD from Jira ticket |
loopwright jira-prd |
List assigned Jira issues |
loopwright config show |
Display merged configuration |
loopwright plugins agents |
List available agent plugins |
# Run with a PRD file (uses Copilot CLI by default)
loopwright run --prd ./prd.json
# Run headless (no TUI)
loopwright run --prd ./prd.json --headless
# Override agent
loopwright run --prd ./prd.json --agent opencode
# Override model (Copilot supports: claude-sonnet-4, gpt-5, etc.)
loopwright run --prd ./prd.json --model claude-sonnet-4
# Limit iterations
loopwright run --iterations 5| Key | Action |
|---|---|
s |
Start execution |
p |
Pause/Resume |
d |
Toggle dashboard |
i |
Toggle iteration history |
q |
Quit |
? |
Show help |
git clone https://github.com/aSidorenkoCodePPI/loopwright.git
cd loopwright
bun installbun run build # Build the project
bun run typecheck # Type check
bun run lint # Run linter
bun run dev # Run from sourceloopwright/
├── src/
│ ├── cli.tsx # CLI entry point
│ ├── commands/ # CLI commands
│ │ ├── jira-prd.ts # Jira integration
│ │ └── create-prd.ts # PRD creation with --jira flag
│ ├── chat/ # AI chat engine for PRD generation
│ ├── config/ # Configuration (Zod schemas)
│ ├── engine/ # Execution engine
│ ├── plugins/
│ │ ├── agents/ # Agent plugins (copilot, opencode)
│ │ └── trackers/ # Tracker plugins (json, beads)
│ ├── prd/ # PRD parsing and Jira mapping
│ ├── session/ # Session persistence
│ └── tui/ # Terminal UI components
└── dist/ # Built output
- Forked from subsy/ralph-tui
MIT License