Step-by-step quickstart guide to install the Blaxel CLI, create a cloud sandbox, run processes, manage files, and deploy your first AI agent.
Blaxel is the infrastructure for autonomous agents. Our platform lets you keep infinite, secure sandboxes on automatic standby while co-hosting your agents and context for near instant latency.
Using Cursor, Claude Code, Codex, Goose, or another AI coding agent?The Blaxel skills give your agent the ability to deploy AI agents, create sandboxes for code execution, host MCP servers, run batch jobs, and more…all using simple prompts, zero code required!Installing Blaxel (step 1 below) sets them up for the coding agents on your machine, with the Blaxel MCP servers. If you already have the CLI, run:
Welcome there! 👋 Make sure you have created an account on Blaxel (here → https://app.blaxel.ai), and created a first workspace (you’ll need the workspace ID).
1
Install Blaxel
Run the installer in a terminal:
curl -fsSL https://blaxel.ai/install.sh | sh
irm https://blaxel.ai/install.ps1 | iex
The installer checks the Blaxel CLI (bl) against the release checksums, installs it, and adds it to your PATH. On macOS and Linux, it also installs completions for your current shell if you use zsh, bash, or fish. On Windows, configure PowerShell completions separately. It then runs bl setup, which shows what it found and installs it when you press Enter: the Blaxel skills and MCP servers for the coding agents on your machine (Claude Code, Codex, Cursor and others), then the browser login. Run it again at any time to add what is missing.
Install with Homebrew
brew install blaxel-ai/blaxel/blaxelbl setup
Homebrew 6.0.0+ requires explicit trust for non-official taps, so use the fully qualified formula name.
Installer options
On macOS and Linux, set these variables for sh:
Variable
Effect
VERSION=v0.1.119
Install that release instead of the latest
BINDIR=/usr/local/bin
Install to that folder instead of ~/.local/bin
BL_INSTALL_SETUP=false
Install the CLI only, and run bl setup later
BL_INSTALL_SKILLS=false
Leave your coding agents alone
BL_INSTALL_PATH=false
Do not add bl to your PATH
BL_INSTALL_COMPLETION=false
Skip the shell completions
For example, to install a specific release for all users:
curl -fsSL https://blaxel.ai/install.sh | sudo VERSION=v0.1.119 BINDIR=/usr/local/bin sh
Under sudo, the installer still sets up your own shell, coding agents and login. In CI, it installs the CLI only and leaves the shell configuration and coding agents alone. On Windows, run $env:BL_INSTALL_SETUP = "false" before the installer to install the CLI only.
2
Login
The installer logs you in. To log in again or to another workspace, open a terminal and run:
bl login
Learn more about authentication on Blaxel
The Blaxel SDK requires two environment variables to authenticate:
Variable
Description
BL_WORKSPACE
Your Blaxel workspace name
BL_API_KEY
Your Blaxel API key
You can create an API key from the Blaxel console. Your workspace name is visible in the URL when you log in to the console (e.g. app.blaxel.ai/{workspace}).Set them as environment variables or add them to a .env file at the root of your project:
When developing locally, you can also log in to your workspace with Blaxel CLI (as shown above). This allows you to run Blaxel SDK functions that will automatically connect to your workspace without additional setup. When you deploy on Blaxel, authentication is handled automatically — no environment variables needed.
3
Create your first resource
Blaxel is the ultimate toolkit for AI agent builders. Our flagship product is the sandbox, although we also offer other services for the rest of your agentic workloads on our infrastructure.Sandboxes are secure, instant-launching compute environments that you can use for running AI code. Blaxel lets you keep sandboxes on automatic standby with optimized agent hosting for near instant latency.With Blaxel sandboxes, you get:
Automatic scale-to-zero after 5s inactivity, resume from standby under 25ms even after weeks.
Micro-VMs with full access to file system, processes and logs — and native support for Zero Data Retention (ZDR).
Preview URLs with your own custom domain.
Create a sandbox
Sandboxes can be created programmatically using Blaxel SDK. Install the SDK:
pip install blaxel
uv pip install blaxel
pnpm install @blaxel/core
npm install @blaxel/core
yarn add @blaxel/core
bun add @blaxel/core
Create your first sandbox:
import { SandboxInstance } from "@blaxel/core";async function main() { // Create a new sandbox const sandbox = await SandboxInstance.createIfNotExists({ name: "my-sandbox", image: "blaxel/base-image:latest", // public or custom image memory: 4096, // in MB ports: [{ target: 3000, protocol: "HTTP" }], // ports to expose labels: { env: "dev", project: "my-project" }, // labels region: "us-pdx-1" // deployment region }); console.log("Sandbox created: ", {sandbox});}main().catch(console.error);
import asynciofrom blaxel.core import SandboxInstanceasync def main(): # Create a new sandbox sandbox = await SandboxInstance.create_if_not_exists({ "name": "my-sandbox", "image": "blaxel/base-image:latest", # public or custom image "memory": 4096, # in MB "ports": [{ "target": 3000 }], # ports to expose "labels": {"env": "dev", "project": "my-project"}, # labels "region": "us-pdx-1" # deployment region }) print(f"Sandbox created: {sandbox}")if __name__ == "__main__": asyncio.run(main())
Learn how to manage sandboxes
Read the complete guide for creating & connecting to sandboxes using Blaxel SDK.
Or deploy another type of resource:
Deploy an agent, batch job or MCP server
Deploy your agent’s components on a purpose-built computing infrastructure for agentics.
Let’s initialize a first app. The following command initializes a new pre-scaffolded local repository ready for developing and deploying your agent on Blaxel.
bl new agent
You can now develop your agent application using any framework you want (or none), and use the BlaxelSDK to leverage other Blaxel deployments. A placeholder HTTP API server is already preconfigured in /src/main.py or /src/main.ts.
Let’s initialize a first batch job definition. The following command initializes a new pre-scaffolded local repository ready for developing and deploying your job on Blaxel.
bl new job
You can now develop your job and use the BlaxelSDK to leverage other Blaxel deployments in /src/index.py or /src/index.ts.
You can quickly initialize a new MCP server from scratch by using CLI command bl new. This initializes a new pre-scaffolded local repo where your entire code can be added.
Run the following command to serve your workload locally, replacing <<DIRECTORY-NAME>> with the name of the workload’s root directory:
cd <<DIRECTORY-NAME>>;bl serve;
Agent: send a test invocation
Query your agent locally by making a POST request to this endpoint: http://localhost:1338 with the following payload format: {"inputs": "Hello world!"}:
Execute your job locally by making a POST request to this endpoint: http://localhost:1338 with the following payload format: {"tasks": [{"param1": "value1"}]}
You can test it by running the following command which launches both the MCP server and a web application to query it (MCP Inspector, managed by MCP) locally.
pnpm inspect
BL_DEBUG=true uv run mcp dev src/server.py
The web application is accessible at: http://127.0.0.1:6274. Alternatively, you can just simply serve the server locally by running bl serve --hotreload.
To push to Blaxel, run the following command. Blaxel will handle the build and deployment:
bl deploy
Your workload is made available as a serverless auto scalableglobal endpoint 🌎.
3
Query your deployment
Agent: send an invocation request
Run an inference from a terminal with the following command:
bl chat <<AGENT-NAME>>
This gives you a chat-like interface where you can interact with your agent. To use this when serving locally, just add option --local.Alternatively, just call theglobal endpoint.
Job: execute the job
Trigger an execution of your batch job from a terminal by running:
# Run a job using Blaxel CLI with --data argumentbl run job <<JOB-NAME>> --data '{"tasks": [{"name": "John"}, {"name": "Jane"}]}'
When you deploy an MCP server on Blaxel, an HTTP endpoint is generated on Global Agentics Network to connect to the server.The server endpoint looks like this:
You are ready to run AI with Blaxel! Here’s a curated list of guides which may be helpful for you to make the most of Blaxel, but feel free to explore the product on your own!
Connect your coding agent to Blaxel
Let your AI coding assistant (Cursor, Claude Code, Windsurf…) create and manage Blaxel resources using natural language.
Create agentic code sandboxes
Complete guide for spawning sandboxed VMs for your agents to access.
Schedule and execute batch tasks
Complete guide for creating and running batch jobs from your agents.
Host serverless agents
Complete guide for deploying AI agents on Blaxel.
Enforce policies
Complete guide for managing deployment and routing policies on the Global Agentics Network.
Although we designed this documentation to be as comprehensive as possible, you are welcome to contact support@blaxel.ai or the community on Discord with any questions or feedback you have.
Last modified on October 5, 2026
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.