Related
- CLI Commands - Shell commands from CLI
What You’ll Learn
- How to run shell commands synchronously
- How to run commands in the background
- How to handle command output and errors
- How to use commands for system administration
- How to integrate commands with code execution
Command Execution Overview
| Execution Mode | SDK Method | API Endpoint |
|---|---|---|
| Running Commands | sandbox.commands.run() | POST /commands/run |
| Background Commands | sandbox.commands.run_background() | POST /commands/background |
Core Concepts
Running Commands
Execute shell commands synchronously and wait for results.- Running Commands - Run shell commands
- SDK: Python: sandbox.commands.run() | JavaScript: sandbox.commands.run()
- API: POST /commands/run
Background Commands
Run long-running commands in the background without blocking.- Background Commands - Run commands in background
- SDK: Python: sandbox.commands.run_background() | JavaScript: sandbox.commands.runBackground()
- API: POST /commands/background
SDK Reference
Python SDK
Complete reference for Python command execution.- Commands Module - Complete command API
commands.run()- Run commands synchronouslycommands.run_background()- Run commands in background
JavaScript SDK
Complete reference for JavaScript/TypeScript command execution.- Commands Module - Complete command API
commands.run()- Run commands synchronouslycommands.runBackground()- Run commands in background
API Reference
VM Agent API
REST API endpoints for command execution.- VM Agent API Overview - API overview
- Run Command -
POST /commands/run- Run commands synchronously - Run Command Background -
POST /commands/background- Run commands in background
Quick Start
If you’re new to command execution, start here:- Running Commands - Run your first command
- Background Commands - Run long-running commands
Related Topics
- Code Execution - Execute code alongside commands
- File Operations - Work with files via commands
- Environment Variables - Use variables in commands
- Process Management - Manage command processes
Next Steps
- Learn about Running Commands for system administration
- Explore Background Commands for long-running tasks
- Review Code Execution to combine with commands
- Check out Process Management for advanced workflows

