Skip to main content

The Interactive CLI for AI Agents — persistent, deterministic, project-scoped execution

Project description

clrun

The Interactive CLI for AI Agents

Persistent. Deterministic. Agent-Native.

yup! that's right — no more --yes or command retries

clrun gives AI agents full control over interactive terminal sessions — TUI prompts, select lists, checkboxes, long-running processes, and stateful shells. Every response is structured YAML with contextual hints telling the agent exactly what to do next.

pip install clrun

Why clrun?

Traditional CLI execution gives agents a string and an exit code. clrun gives them:

  • Structured context — every response includes output, hints, and warnings
  • Interactive control — navigate TUI prompts with named keystrokes
  • Persistent sessions — env vars, cwd, and history survive across calls
  • Agent-native errors — failures include the reason, alternatives, and recovery commands
# What an agent sees after running a command:
---
terminal_id: f5e6d7c8-...
command: npx create-vue@latest
output: |
  ◆  Project name:
  │  vue-project
status: running
hints:
  send_input: clrun f5e6d7c8 "my-app"
  send_keys: clrun key f5e6d7c8 enter
  view_output: clrun tail f5e6d7c8 --lines 50
  kill: clrun kill f5e6d7c8

Quick Start

# Run any command
clrun echo "hello world"

# Start an interactive scaffolder
clrun "npx create-vue@latest"

# Send input to a session
clrun <terminal_id> "my-project-name"

# Navigate TUI prompts with keystrokes
clrun key <terminal_id> down down enter

# View output
clrun tail <terminal_id> --lines 50

# Check all sessions
clrun status

# Kill a session
clrun kill <terminal_id>

Commands

Action Command
Run a command clrun <command>
Send text + Enter clrun <id> "text"
Send keystrokes clrun key <id> down enter
Toggle checkbox clrun key <id> space
Accept default clrun key <id> enter
View output clrun tail <id>
Check sessions clrun status
Kill session clrun kill <id>
Interrupt clrun key <id> ctrl-c

TUI Prompt Navigation

You see Type Action
◆ Name: │ default Text input clrun <id> "value" or clrun key <id> enter
● Opt1 ○ Opt2 Single-select clrun key <id> down... enter
◻ Opt1 ◻ Opt2 Multi-select clrun key <id> space down... enter
● Yes / ○ No Confirm clrun key <id> enter or right enter
(y/n) Simple confirm clrun <id> "y" or clrun <id> "n"

Python Version

This is the Python port of clrun. It uses pexpect for PTY management instead of node-pty, which means:

  • No native compilationpexpect is pure Python on macOS/Linux
  • Same CLI interface — identical commands and YAML output
  • Same file-based state.clrun/ directory structure is fully compatible

Install via pip:

pip install clrun

Or pipx for isolated install:

pipx install clrun

License

MIT — github.com/cybertheory/clrun

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clrun_cli-1.1.0.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clrun_cli-1.1.0-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file clrun_cli-1.1.0.tar.gz.

File metadata

  • Download URL: clrun_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clrun_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dc35455855e9d5b6c90025a4f54aac9096a00e5bbd3c9bb4adb83ea47d70d496
MD5 dc2031c4ff52049ff3ef4e14f753cc0b
BLAKE2b-256 a19b96a0ba1cdc38de8deeea59869c0f1408a652dfb28ab99fa30de7aca8e6a0

See more details on using hashes here.

File details

Details for the file clrun_cli-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: clrun_cli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clrun_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 feae4701d7588a7ac1adad9576a607e54d325f27865f044c5cce28f9c5472638
MD5 bc48ba382b624363f2169f8e764b8d12
BLAKE2b-256 b625a1ca3424ede800cf171ecf9362c6b33f832163080c57fd8cf7d7a1f8f16a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page