Skip to main content

Shell & Code Execution

OrcBot provides powerful system-level execution capabilities including shell commands, TypeScript compilation, and Python virtual environments. All execution skills include safety guardrails and resource limits.

run_command

Execute shell commands on the host system.

Parameters

string
required
Shell command to execute. Uses PowerShell on Windows, bash/sh on Unix.
string
Working directory for command execution. Auto-extracted from cd /path && command patterns.

Return Value

string
Combined stdout + stderr. Capped at 8 KB with tail hint if truncated.

Platform Detection

The skill automatically adapts to the host platform:
  • Windows: Uses PowerShell via powershell -Command
  • Unix/Linux/macOS: Uses /bin/sh -c

Working Directory Auto-Extraction

The skill intelligently extracts working directory from common patterns:

Safety Features

  1. Command allow/deny lists: Configured via commandAllowList / commandDenyList
  2. Stdout capping: Output limited to 8 KB to prevent memory overflow
  3. Process tree kill: Reliable termination on timeout (uses taskkill /T /F on Windows)
  4. Safe mode enforcement: Disabled when safeMode: true

Example Usage

Run npm test:
List directory:
Git status:

Response Examples

Success:
Error:
Truncated output:

Configuration Options

Allow specific commands:
Deny dangerous commands:
Disable all command execution:

Metadata

  • isDeep: true - Commands are substantive work
  • isDangerous: true - Requires admin approval in autonomy mode
Command execution is powerful and dangerous. Always validate commands before running. Enable safeMode in production unless command execution is explicitly required.

execute_typescript

Write, compile, and execute TypeScript code on the fly.

Parameters

string
required
TypeScript code to compile and execute
string
Optional filename to save/reuse the script. If omitted, saves to scratchpad.ts.
array
Command-line arguments to pass to the script

Return Value

string
Combined stdout + stderr from the compiled and executed JavaScript

Features

  • Persistent scratchpad: If filename is omitted, code is saved to a reusable scratchpad.ts
  • Named scripts: Provide filename to save for future reuse
  • Execute saved scripts: Call with only filename (no code) to re-run
  • TypeScript compilation: Automatically compiles to JavaScript via tsc
  • Full Node.js API access: Import any installed package

Example Usage

Execute TypeScript snippet:
Save and execute:
Re-run saved script:
Pass arguments:

Response Example

Use Cases

  • Data processing: Parse CSV, JSON, or XML files
  • API calls: Hit undocumented endpoints with custom logic
  • Calculations: Complex math or statistics
  • Prototyping: Test algorithms before implementing as skills
  • One-off tasks: Tasks that don’t warrant a full skill

Metadata

  • isDeep: true
  • isDangerous: false (sandboxed to Node.js API)
Use execute_typescript for custom logic. When standard skills can’t handle a task, TypeScript execution provides unlimited flexibility without modifying the codebase.

execute_python_code

Execute Python code in an isolated virtual environment.

Parameters

string
required
Python code to execute
string
Optional filename to save/reuse the script (e.g., "script.py")

Return Value

string
Combined stdout + stderr from the Python interpreter

Features

  • Isolated virtual environment: Uses ~/.orcbot/python-venv/
  • Persistent environment: Installed packages persist across runs
  • Auto-activation: Virtual environment activated automatically
  • Named scripts: Save scripts for reuse with filename
  • Re-execution: Call with only filename to re-run saved scripts

Example Usage

Data analysis:
Math calculation:
Save script:

Response Example

Metadata

  • isDeep: true
  • isDangerous: false
Only use Python for tasks requiring Python libraries. Prefer execute_typescript for general scripting since Node.js is already available.

install_npm_dependency

Install an NPM package for use in custom skills or TypeScript execution.

Parameters

string
required
NPM package name (e.g., "axios", "lodash", "@types/node")

Return Value

string
npm install output

Example Usage

Response Example

Metadata

  • isDeep: false
  • isDangerous: false

install_python_package

Install a Python package via pip into the isolated virtual environment.

Parameters

string
required
Package name (e.g., "pandas", "numpy", "requests")

Return Value

string
pip install output

Example Usage

Response Example

Metadata

  • isDeep: false
  • isDangerous: false
Install packages on-demand as needed. The virtual environment persists, so packages only need to be installed once.

get_system_info

Get platform, OS, Node version, shell, and command guidance.

Parameters

None.

Return Value

object
System information:
  • platform: OS platform (linux, darwin, win32)
  • arch: CPU architecture
  • nodeVersion: Node.js version
  • shell: Default shell
  • timestamp: Current date/time
  • guidance: Platform-specific command tips

Example Usage

Response Example

Metadata

  • isDeep: false

system_check

Verify that commands, shared libraries, and file paths exist.

Parameters

array
Command names to check (e.g., ["node", "git", "docker"])
array
Shared library names (e.g., ["libssl.so", "libcrypto.so"])
array
File paths to verify (e.g., ["/etc/hosts", "/usr/bin/python3"])

Return Value

object
Verification results for each category with pass/fail status

Example Usage

Response Example

Metadata

  • isDeep: false

Best Practices

Execution skill priority:
  1. Use run_command for existing CLI tools (npm, git, docker)
  2. Use execute_typescript for custom JavaScript/TypeScript logic
  3. Use execute_python_code for data science (pandas, numpy) or Python-specific libs
  4. Consider creating a custom skill for frequently-used operations
Security considerations:
  • Never pass untrusted user input directly to run_command
  • Enable commandDenyList to block dangerous operations
  • Set safeMode: true in production to disable command execution
  • Use execute_typescript / execute_python_code for sandboxed logic

Common Workflows

Git Operations

NPM Project Management

Data Processing Pipeline

Troubleshooting

”Command not found”

  • Cause: Command not installed or not in PATH
  • Fix: Use system_check to verify, then install missing command or use absolute path

”Permission denied”

  • Cause: Insufficient file permissions
  • Fix: Use chmod +x or run with appropriate user permissions

”Timeout”

  • Cause: Command took too long
  • Fix: Increase timeout in config or split into smaller operations

”Output truncated”

  • Cause: Command output exceeded 8 KB
  • Fix: Redirect output to file, then read file in chunks

File Operations

Read, write, and process files

Configuration

Manage system settings