Skip to main content
Manage environment variables in HopX sandboxes using the env command. List, get, set, and delete environment variables to configure execution environments.

Command Syntax

Subcommands

list

List all environment variables in a sandbox. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (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 not found

get

Get the value of a specific environment variable. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • VARIABLE - Environment variable name (required)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox or variable not found

set

Set one or more environment variables. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • KEY - Environment variable name (optional, use with --env for multiple)
  • VALUE - Environment variable value (optional, use with --env for multiple)
Options:
  • --env, -e TEXT - Environment variable in KEY=VALUE format (repeatable)
  • --env-file PATH - Load environment variables from file
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox not found

delete

Delete an environment variable. Syntax:
Arguments:
  • SANDBOX_ID - Sandbox ID (required)
  • VARIABLE - Environment variable name to delete (required)
Examples:
Expected Output:
Exit Codes:
  • 0 - Success
  • 3 - Authentication error
  • 4 - Sandbox or variable not found

Shell Scripting Examples

Configure Environment for Code Execution

Load Environment from File

Conditional Environment Setup

List and Export Variables

Next Steps