Skip to main content
Get up and running with the HopX CLI in 5 minutes. This guide walks you through installation, authentication, creating your first sandbox, executing code, and managing files.

What You’ll Learn

In this quickstart, you’ll learn how to:
  • Install the HopX CLI
  • Authenticate with your API key
  • Create your first sandbox
  • Execute code in multiple languages
  • Manage files in sandboxes
  • Clean up sandboxes

Prerequisites

  • HopX API key (get one here if you don’t have it)
  • Python 3.12+ installed
  • Terminal access

Step 1: Install the CLI

Install the CLI using the quick install script:
Expected Output:
Verify installation:
Expected Output:

Step 2: Authenticate

Run the interactive setup wizard:
The wizard will:
  1. Guide you through browser-based OAuth login
  2. Help you create an API key
  3. Configure default settings
  4. Test your connection

Option 2: Manual Authentication

Authenticate manually:
Expected Output:

Option 3: Environment Variable

Set your API key as an environment variable:
Get your API key at console.hopx.dev.

Step 3: Create Your First Sandbox

Create a sandbox from a pre-built template:
Expected Output:
List your sandboxes:
Expected Output:

Step 4: Execute Code

Execute Python code in your sandbox:
Expected Output:
Execute code from a file:
Expected Output:
Execute JavaScript:
Expected Output:
Execute Bash:
Expected Output:

Step 5: Manage Files

Write a file to your sandbox:
Expected Output:
Read the file:
Expected Output:
List files in a directory:
Expected Output:
Upload a local file:
Expected Output:
Download a file:
Expected Output:

Step 6: Run Shell Commands

Run shell commands in your sandbox:
Expected Output:
Install packages:
Expected Output:

Step 7: Manage Environment Variables

Set environment variables:
Expected Output:
List environment variables:
Expected Output:
Get a specific variable:
Expected Output:

Step 8: Clean Up

Kill your sandbox when done:
Expected Output:
Or pause it to preserve state:
Expected Output:
Resume later:
Expected Output:

Next Steps

Now that you’ve completed the quickstart, explore more CLI features: