Documentation Index
Fetch the complete documentation index at: https://docs.enconvo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
EnConvo’s Code Runner lets AI agents execute shell commands and code directly on your Mac. When you ask an AI agent to perform tasks like running scripts, installing packages, or managing files through the terminal, Code Runner handles the execution in a controlled environment with automatic timeout handling and output optimization.How It Works
Code Runner is primarily used as a tool by AI agents. When you chat with an AI agent that has code execution capabilities, it can invoke the Code Runner to:- Run shell commands (bash/zsh)
- Execute Python scripts
- Install packages via npm, pip, or other package managers
- Perform git operations
- Run build tools and development servers
- Execute any command-line operation
Supported Operations
Shell Commands
Code Runner executes commands through/bin/zsh, inheriting your shell profile (.zshrc or .bashrc). This means all your PATH settings, aliases, and environment variables are available.
| Category | Examples |
|---|---|
| Package Management | npm install, pip install, brew install, cargo add |
| Version Control | git status, git commit, git push, git log |
| File Operations | mkdir, cp, mv, chmod, tar |
| Development | npm run build, python script.py, cargo build |
| System | ls, pwd, which, env, ps |
| Docker | docker run, docker-compose up, docker build |
| Network | curl, wget, ssh, scp |
Python
Code Runner automatically activates Python virtual environments when available:- If a
venvor.venvdirectory exists in the working directory, it is activated automatically uvis preferred overpipfor Python package management when available- All standard Python tooling works:
pytest,mypy,black,ruff, etc.
Node.js / JavaScript
Full support for the Node.js ecosystem:node,npm,npx,pnpm,yarn- Direct execution of
.jsand.tsfiles (viats-nodeortsx) - Package scripts via
npm run
Other Languages
Any language with a command-line compiler or interpreter works:| Language | Run Command |
|---|---|
| Python | python3 script.py |
| Node.js | node script.js |
| Ruby | ruby script.rb |
| Go | go run main.go |
| Rust | cargo run |
| Swift | swift script.swift |
| Shell | bash script.sh |
| C/C++ | gcc -o app main.c && ./app |
Configuration
Working Directory
Code Runner uses a configurable working directory that persists between commands. The AI agent can specify the working directory for each command, or it defaults to the current workspace directory.Timeout Settings
| Setting | Value |
|---|---|
| Default timeout | 2 minutes (120,000 ms) |
| Maximum timeout | 10 minutes (600,000 ms) |
RTK Token Optimization
Code Runner includes RTK (Rust Token Killer) — a token compression system that reduces command output size before sending it back to the AI agent.- Enabled by default — reduces token usage and costs
- Compresses verbose command output while preserving essential information
- Particularly useful for commands that produce large outputs (e.g.,
npm install, build logs)
| Setting | Description |
|---|---|
| Enable RTK | Use RTK to compress command output and reduce token usage (default: on) |
Background Execution
Long-running commands can be executed in the background:- The AI agent marks a command as background when it does not need the result immediately
- You are notified when the background command completes
- Useful for builds, installations, and server startups
Security
Safety Measures
EnConvo implements several safety measures for code execution:-
Non-interactive execution: Commands run non-interactively (
execFileSync), so they cannot prompt for input. Commands requiring-yor--yesflags must include them explicitly. - Timeout protection: All commands have enforced timeouts to prevent runaway processes.
- Output limits: Command output exceeding 30,000 characters is automatically truncated.
-
Agent guidelines: AI agents follow strict safety protocols:
- Prefer non-destructive operations
- Use absolute paths to avoid accidental directory changes
- Quote file paths with spaces
- Verify directories exist before creating files
Sandboxing
Code Runner supports an optional sandbox mode. When sandbox mode is enabled, commands run in a restricted environment. The AI agent can request to disable sandboxing for specific commands when necessary, but this is done with explicit intent.Usage in AI Chat
Code Runner is automatically available to AI agents with tool-use capabilities. You do not need to configure anything — simply ask the agent to perform tasks that require command execution.Example Interactions
Running a build:Output Handling
Output Format
Command output is captured from both stdout and stderr and returned to the AI agent for analysis. The agent then presents relevant information in a human-readable format.Large Output
For commands with verbose output:- RTK compression reduces token usage automatically
- Truncation at 30,000 characters prevents excessive token consumption
- The AI agent summarizes key information from the output
Error Handling
When a command fails:- The exit code and error message are captured
- The AI agent analyzes the error and suggests fixes
- The agent may retry with a corrected command
Troubleshooting
Command not found
Command not found
- The command may not be installed or not in your PATH
- Check that your shell profile (
.zshrc) properly exports the PATH - Some tools installed via Homebrew need
eval "$(/opt/homebrew/bin/brew shellenv)"in your profile - Try using the full path to the command (e.g.,
/usr/local/bin/python3)
Permission denied
Permission denied
- The file may not have execute permissions — the agent can run
chmod +x file - Some system directories require
sudowhich is not supported in non-interactive mode - Check file ownership with
ls -la
Command times out
Command times out
- The default timeout is 2 minutes — long builds or downloads may need more
- The AI agent can specify a longer timeout (up to 10 minutes)
- Consider running long tasks in background mode
- Break complex operations into smaller steps
Output appears garbled or truncated
Output appears garbled or truncated
- RTK compression may be too aggressive for certain output — try disabling it
- Very long outputs are truncated at 30,000 characters by design
- Ask the agent to redirect output to a file for full access
Related Features
AI Agents
Agents that use Code Runner as a tool
AI Chat
Chat interface for code execution
SmartBar
Quick command execution
Workflows
Automate code execution in workflows