clrun
Original:🇺🇸 English
Translated
Run and control interactive CLI sessions for AI agents. Handles TUI prompts (select lists, checkboxes, confirms), persistent shell state, and long-running processes. Use when you need to execute terminal commands, respond to interactive prompts, navigate scaffolding wizards like create-vue or create-vite, or manage dev servers.
2installs
Sourcecybertheory/clrun
Added on
NPX Install
npx skill4agent add cybertheory/clrun clrunTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →clrun — The Interactive CLI for AI Agents
No more flags or command retries. gives you full control over interactive terminal sessions with structured YAML responses.
--yesclrunInstall
bash
npm install -g clrunCore Commands
| Action | Command |
|---|---|
| Run a command | |
| Send text + Enter | |
| Send keystrokes | |
| Toggle checkbox | |
| Accept default | |
| View output | |
| Check sessions | |
| Kill session | |
| Interrupt | |
Two Input Modes
Text input — sends text followed by Enter:
bash
clrun <id> "my-project-name" # Type and press Enter
clrun <id> "" # Just press EnterKeystroke input — sends raw keys for TUI navigation:
bash
clrun key <id> down down enter # Select 3rd item in list
clrun key <id> space down space enter # Toggle checkboxes 1 and 2
clrun key <id> enter # Accept defaultAvailable keys: , , , , , , , , , , , , , , , , , , , , ,
updownleftrightentertabescapespacebackspacedeletehomeendpageuppagedownctrl-cctrl-dctrl-zctrl-lctrl-actrl-eynIdentifying Prompt Types
When you a session, identify the prompt type to choose the right input:
tail| You see | Type | Action |
|---|---|---|
| Text input | |
| Single-select | |
| Multi-select | |
| Confirm | |
| Simple confirm | |
| Readline | |
Select List Navigation
Count items from the top. First item is highlighted by default. To select item N, send N-1 presses then .
downenter◆ Select a framework:
│ ● Vanilla ← 0 downs
│ ○ Vue ← 1 down
│ ○ React ← 2 downs
│ ○ Svelte ← 3 downsbash
clrun key <id> down down enter # Selects ReactMulti-Select Pattern
Plan a sequence of (toggle) and (skip) from top to bottom, ending with :
spacedownenterbash
# Select items 1, 3, and 4 from a list of 5:
clrun key <id> space down down space down space enter
# item1 skip skip item3 item4 confirmReading Responses
All responses are structured YAML. Key fields:
- — store this for all subsequent calls
terminal_id - — cleaned terminal output (ANSI stripped)
output - —
status,running,suspended,exited,killeddetached - — exact commands you can run next (copy-pasteable)
hints - — detected issues with input or output
warnings
Workflow Pattern
1. START → clrun <command> → get terminal_id
2. OBSERVE → clrun tail <id> → read output, identify prompt
3. INTERACT → clrun <id> "text" / clrun key → respond to prompt
4. REPEAT → steps 2-3 until done
5. CLEANUP → clrun kill <id> → if neededShell Variable Quoting
Use single quotes to prevent your shell from expanding variables:
$bash
clrun <id> 'echo $MY_VAR' # Correct
clrun <id> "echo $MY_VAR" # Wrong — expanded before clrun sees itSession Persistence
- Environment variables persist within a session
- Sessions auto-suspend after 5 min idle (env and cwd saved)
- Sending input to a suspended session auto-restores it
- No pre-check needed — just send input
See references/tui-patterns.md for complete real-world examples.