Execute shell commands in HopX sandboxes using theDocumentation Index
Fetch the complete documentation index at: https://docs.hopx.ai/llms.txt
Use this file to discover all available pages before exploring further.
cmd command. Run commands synchronously or in the background with full control over execution environment.
Command Syntax
Subcommands
run
Run a shell command synchronously.
Syntax:
SANDBOX_ID- Sandbox ID (required)COMMAND- Shell command to execute (required)
--timeout INTEGER- Command timeout in seconds--workdir TEXT- Working directory for command execution--env TEXT- Environment variable in KEY=VALUE format (repeatable)--background- Run command in background (returns immediately)--output, -o FORMAT- Output format:table,json,plain(default:table)
0- Success1- Command execution error3- Authentication error4- Sandbox not found5- Timeout
exec
Execute a shell command (alias for run).
Syntax:
run command. See run for options and examples.
Shell Scripting Examples
Install Dependencies
Run Tests
Background Process
Chain Commands
Related
- CLI Quickstart - Get started with CLI
- Sandbox Commands - Manage sandboxes
- Code Execution - Execute code in sandboxes
- Environment Variables - Manage environment variables
- Python SDK: Commands - Python SDK command execution
- JavaScript SDK: Commands - JavaScript SDK command execution
- API: Run Command - REST API endpoint
Next Steps
- Learn about Code Execution to run code alongside commands
- Explore File Operations to work with files via commands
- Review Environment Variables to configure command execution

