Code Execution CLI
Command-line interface for code execution
graph LR
U[Input] --> A[Agent]
A --> O[Output]
classDef agent fill:#8B0000,color:#fff
classDef tool fill:#189AB4,color:#fff
class A agent
class U,O toolCode Execution CLI
Execute Python code from the command line.
Prerequisites
npm install @vercel/sandboxBasic Usage
praisonai-ts agent run \
--tools code-execution \
--prompt "Calculate the factorial of 20"With Options
praisonai-ts agent run \
--tools "code-execution:timeout=60000" \
--prompt "Find all prime numbers under 1000"Examples
Math Calculations
praisonai-ts agent run \
--tools code-execution \
--prompt "Calculate the sum of squares from 1 to 100"Data Analysis
praisonai-ts agent run \
--instructions "You are a data analyst" \
--tools code-execution \
--prompt "Calculate mean, median, and std dev of [1,2,3,4,5,6,7,8,9,10]"Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY | Yes | OpenAI API key |