blaxel-cli
Manage Blaxel resources from the command line using the bl CLI. Deploy agents, sandboxes, jobs, and MCP servers. Also installs the Blaxel CLI if not present.
By blaxel-ai · 419 installs
npx skills add blaxel-ai/agent-skills --skill blaxel-cli
Source repository · Upstream listing
Blaxel CLI
A CLI to manage Blaxel cloud resources from the command line: agents, sandboxes,
jobs, MCP servers, drives, and more.
Prerequisites
The bl command must be available on PATH. To check:
If not installed, use the official installer for this operating system.
macOS or Linux:
Windows PowerShell:
Follow the installer's PATH or shell reload instructions, then complete setup:
Setup installs the Blaxel skills and configures supported coding agents. In a
terminal, it also offers browser login. If the installer already completed
setup, verify the result instead of repeating it.
When running without a terminal, use bl setup yes . Setup skips browser login
in that environment. If sign in is still needed, run bl login , present its
secure browser URL, and continue after the user approves it. Confirm the
selected workspace from command output; do not guess a workspace name or ask for
pasted credentials.
For unattended automation, use an existing BL API KEY and BL WORKSPACE
supplied securely through the environment. Commands can use these directly; do
not start browser login or persist the key in agent configuration.
Verify the installed command and active workspace:
Treat empty workspace output as incomplete sign in.
Global Flags
All commands support these flags:
Flag Description
o, output <format Output format: pretty, yaml, json, table
w, workspace <name Override workspace for this command
v, verbose Enable verbose output
u, utc Enable UTC timezone
skip version warning Skip version warning
Non Interactive Mode
For commands that prompt for input (confirmations, selections), add y or
yes to auto confirm. This is required when running in non interactive /
no TTY environments (scripts, CI, agents).
Available Commands
Reference Documentation
[apply](references/apply.md) Apply configuration changes to resources
declaratively using YAML files.
[chat](references/chat.md) Start an interactive chat session with a deployed
agent.
[connect](references/connect.md) Open an interactive terminal session to a
sandbox
[delete](references/delete.md) Delete Blaxel resources from your workspace.
[deploy](references/deploy.md) Deploy your Blaxel project to the cloud.
[drive](references/drive.md) Manage drives and drive mounts on sandboxes.
[fork](references/fork.md) Create a new sandbox or application by forking an
existing sandbox.
[get](references/get.md) Retrieve information about Blaxel resources in your
workspace.
[login](references/login.md) Authenticate with Blaxel to access your
workspace.
[logout](references/logout.md) Remove stored credentials for a workspace.
[logs](references/logs.md) View logs for Blaxel resources.
[mcp](references/mcp.md) Serve the hosted Blaxel MCP tools over stdio using
your existing bl login.
[new](references/new.md) Create a new Blaxel resource from templates.
[push](references/push.md) Build and push a container image to the Blaxel
registry without creating a deployment.
[run](references/run.md) Execute a Blaxel resource with custom input data.
[serve](references/serve.md) Start a local development server for your
Blaxel project.
[setup](references/setup.md) Set up everything Blaxel needs on this machine,
then log in.
[share](references/share.md) Share Blaxel resources with other workspaces in
your account.
[skills](references/skills.md) Manage Blaxel skills for coding agents
[token](references/token.md) Retrieve the authentication token for the
specified workspace.
[unshare](references/unshare.md) Remove shared Blaxel resources from other
workspaces.
[upgrade](references/upgrade.md) Upgrade the Blaxel CLI to the latest
version.
[version](references/version.md) Print the version number
[workspaces](references/workspaces.md) List and manage Blaxel workspaces.
Discovering Options
To see available subcommands and flags, run help on any command:
Common Workflows
Create a sandbox, run a command, and get its logs
Run a complex command in a sandbox (agent guideline)
bl run sandbox ... path /process data '<json ' requires the JSON payload
to survive shell quoting . As soon as the command embeds nested quotes,
backslashes, multiple lines, or interpreters like sh lc / python3 c ,
inline data becomes brittle and the API rejects the request with
400 Bad Request: invalid character ... in string escape code .
Decision rule for an agent:
1. Command has no single quotes, no backslashes, no newlines → use
data '{"command": "...", "waitForCompletion": true}' directly.
2. Anything more complex (nested quotes, escapes, multiline, scripts) → write
the JSON payload to a file with your Write/file creation tool (this
bypasses the shell entirely), then run with file .
Deploy an agent
Manage sandboxes
Multi workspace deployment