Skip to main content
Manage files in HopX sandboxes using the files command (alias: f). Read, write, list, upload, download, and delete files from the command line.

Command Syntax

Subcommands

read

Read file contents from a sandbox. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • PATH - File path to read (required)
Options:
  • --output, -o FORMAT - Output format: table, json, plain (default: table)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox or file not found

write

Write data to a file in a sandbox. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • PATH - File path to write (required)
Options:
  • --data, -d TEXT - Data to write (use - to read from stdin)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox not found

list

List files and directories in a sandbox. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • PATH - Directory path (optional, default: /workspace)
Options:
  • --output, -o FORMAT - Output format: table, json, plain (default: table)
Examples:
Expected Output (Table):
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox not found

delete

Delete a file or directory from a sandbox. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • PATH - File or directory path to delete (required)
Options:
  • --force - Skip confirmation prompt
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox or file not found

upload

Upload a local file to a sandbox. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • LOCAL_PATH - Local file path (required)
  • REMOTE_PATH - Remote file path in sandbox (required)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox not found

download

Download a file from a sandbox to local filesystem. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • REMOTE_PATH - Remote file path in sandbox (required)
  • LOCAL_PATH - Local file path (required)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox or file not found

info

Get detailed information about a file or directory. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • PATH - File or directory path (required)
Options:
  • --output, -o FORMAT - Output format: table, json, plain (default: table)
Examples:
Expected Output (Table):
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox or file not found

Shell Scripting Examples

Upload and Process File

Download Results

Batch File Operations

Next Steps