Skip to main content
Version: 0.1.22
Last Verified: 2025-01-27
Package: @hopx-ai/sdk on npm

Overview

The Commands resource provides shell command execution capabilities for sandboxes. Access it via the commands property on a Sandbox instance.

Methods

run

Run a shell command.
Parameters:
  • command (string): Shell command to execute
  • options.timeout (number, optional): Command timeout in seconds (default: 30)
  • options.background (boolean, optional): Run in background (default: false)
  • options.workingDir (string, optional): Working directory (default: '/workspace')
  • options.env (Record<string, string>, optional): Environment variables
Returns: Promise<CommandResponse> - Command execution result Example:

runBackground

Run command in background.
Returns: Promise<{ processId: string }> - Process ID
  • Sandbox - Main sandbox class
  • Files - File operations resource

See Also

Next Steps