Synopsis
p
Description
Theprompt command launches one or more AI coding agents, each in an isolated environment with its own tmux session, git worktree, and branch. Agents execute the provided prompt independently and can optionally run development servers on dedicated ports.
Each agent operates in complete isolation, allowing you to:
- Run multiple approaches to the same problem in parallel
- Test different AI models simultaneously
- Avoid conflicts between concurrent code changes
Options
Specify agents to run with their counts in the format
AGENT:COUNT[,AGENT:COUNT...].Examples:claude:1- Single Claude agentclaude:2,codex:1- Two Claude agents and one Codex agentrandom:3- Three agents with random names
random as the agent name to select random agent names for each instance.Path to the Uzi configuration file (defaults to
uzi.yaml in current directory).Arguments
The prompt to send to the agent(s). All arguments after the options are joined with spaces to form the complete prompt.
Environment Setup
For each agent,prompt creates:
- Git Worktree: Isolated working directory at
~/.local/share/uzi/worktrees/{worktree-name} - Git Branch: New branch with pattern
{agent-name}-{project}-{hash}-{uniqueId} - Tmux Session: Named
agent-{project}-{hash}-{agent-name} - Agent Window: Primary tmux window named “agent” where the agent runs
- Dev Server (optional): Secondary window named “uzi-dev” if configured
Configuration
The prompt command respects these configuration options fromuzi.yaml:
Command template to start a development server. Use
$PORT as a placeholder for the assigned port.Example: npm run dev -- --port $PORTRange of ports to allocate for dev servers in format
START-END.Example: 3000-3100Examples
Basic Usage
Multiple Agents
Random Agent Names
With Development Server
If youruzi.yaml includes:
Custom Config Path
How It Works
- Parse agents flag to determine how many agents and which models to use
- For each agent:
- Generate unique identifiers (branch name, session name, worktree name)
- Create git worktree from current repository
- Create tmux session with agent window
- If configured, create dev server window and assign available port
- Send the prompt to the agent window
- Save state to
~/.local/share/uzi/state.json
Port Allocation
WhendevCommand and portRange are configured:
- Ports are allocated sequentially from the available range
- Already-in-use ports are skipped
- Each agent gets a unique port to avoid conflicts
- Port is saved in state for easy access via
uzi ls
Related Commands
auto- Automatically handle agent promptsls- List active agents and their statuscheckpoint- Merge agent work back to main branchkill- Terminate agent sessions
Notes
The agent count for each model must be at least 1. Invalid counts will result in an error.