bex works with the official, unmodified Render CLI. You keep using the
render command; a bex API key and RENDER_HOST point it at bex instead of
Render.
bex also ships its own binary, bex: the same upstream command
implementation, already pointed at bex's API, plus Bex-native commands the
Render CLI has no equivalent for. Today those are the
coding-agent launchers.
Use the CLI to:
- create, update, suspend, resume, and delete services and datastores;
- trigger deploys, restarts, and one-off jobs;
- tail and filter application, request, and build logs;
- open SSH,
psql,pgcli, and Key Value sessions; and - automate repeatable operations with JSON or YAML output.
bex's compatibility suite is currently pinned to Render CLI v2.21.0. Newer releases might work, but use the tested version when reproducibility matters. See Compatibility and differences.
Set up the CLI
1. Install the official Render CLI
Install the latest release with Homebrew:
brew update
brew install renderOr use Render's installer on Linux or macOS:
curl -fsSL https://raw.githubusercontent.com/render-oss/cli/refs/heads/main/bin/install.sh | shFor the exact version bex verifies, download v2.21.0 from the Render CLI releases page. After installing, confirm the binary is available:
render --version2. Create a bex API key
- Open Dashboard → Settings.
- In API Keys, select Create API Key and give the key a recognizable
name such as
local-cli. - Copy both the key ID and secret. The secret is shown only once.
Treat the secret like a password. Do not commit it, paste it into an issue, or store it in a shell profile.
3. Connect the CLI to bex
Download bex's setup helper, inspect it, and source it so its environment variables remain in your current shell:
curl --fail --silent --show-error \
--output setup-render-cli.sh \
https://raw.githubusercontent.com/bex-co/bex/main/setup-render-cli.sh
less setup-render-cli.sh
source ./setup-render-cli.shThe helper:
- prompts for the key ID and secret without echoing the secret;
- exchanges them for a short-lived bex access token;
- sets
RENDER_HOST=https://api.bex.co/v1/; - asks you to select a
tea-…workspace; and - runs
render whoamito verify the connection.
The access token expires after 15 minutes. Re-source the helper when it does. It unsets the API key secret as soon as the token exchange finishes.
Common commands
Run render with no arguments to browse the interactive command menu, or run
render help <command> for flags and examples.
Inspect your workspace
render whoami
render workspaces
render servicesrender services includes services and datastores in the active workspace.
Most resource commands accept either the resource's bex ID (srv-…, dpg-…,
red-…) or its exact name.
Deploy and operate a service
# Review recent deploys
render deploys list srv-abc123
# Deploy and wait for the result
render deploys create srv-abc123 --wait
# Stream live logs
render logs --resources srv-abc123 --tail
# Restart or open a shell
render restart srv-abc123
render ssh srv-abc123Use render services create --help to create a web service, static site,
background worker, or cron job from a Git repository or container image.
Work with datastores
render postgres list
render keyvalues list
# Run one query and return text
render psql dpg-abc123 -c "SELECT NOW();" -o text
# Open the interactive Key Value client
render kv-cli red-abc123Database and Key Value sessions enforce the resource's IP allow list. Install
the corresponding local client (psql, pgcli, or redis-cli) before opening
an interactive session.
Filter logs
# Search recent application logs
render logs --resources srv-abc123 --type app --text "timeout"
# Inspect only error-level entries as JSON
render logs --resources srv-abc123 --level error --output json
# Follow build output
render logs --resources srv-abc123 --type build --tailThe CLI also supports time windows, direction, result limits, instances, host,
path, method, and status-code filters. Run render logs --help for the complete
flag list.
Scripts and CI
The CLI is interactive by default. In automation, provide the resource and
workspace IDs explicitly, select a machine-readable output format, and pass
--confirm to skip confirmation prompts:
export RENDER_HOST="https://api.bex.co/v1/"
export RENDER_WORKSPACE="tea-abc123"
export RENDER_OUTPUT="json"
export RENDER_API_KEY="$(
curl --fail --silent --show-error \
--request POST https://oauth.bex.co/oauth2/token \
--data-urlencode grant_type=client_credentials \
--data-urlencode "client_id=$BEX_API_KEY_ID" \
--data-urlencode "client_secret=$BEX_API_KEY_SECRET" \
| jq --exit-status --raw-output .access_token
)"
render deploys create "$BEX_SERVICE_ID" --wait --output json --confirmStore BEX_API_KEY_ID, BEX_API_KEY_SECRET, RENDER_WORKSPACE, and resource
IDs in your CI provider's encrypted secret store. Exchange the key at the start
of each job instead of persisting the short-lived access token.
Coding-agent launchers
The bex binary registers Bex-native commands beside the imported Render
command tree. The first of them are the coding-agent launchers: one command
per Anthropic-compatible model provider, each starting a
Claude Code session against that provider's
endpoint. Claude Code stays an external runtime and is never forked — a launcher
sets only its documented environment seams (ANTHROPIC_BASE_URL,
ANTHROPIC_AUTH_TOKEN, CLAUDE_CONFIG_DIR, and the model-slot variables) at
exec time.
Install bex
The install script detects your OS and architecture, verifies checksums.txt,
and installs atomically to ~/.local/bin:
curl -fsSL https://raw.githubusercontent.com/bex-co/bex/main/scripts/install-bex.sh | shOr install from the Homebrew tap:
brew install bex-co/tap/bexBoth channels install the same signed release binaries for macOS and Linux on
arm64 and amd64, and every release ships checksums.txt alongside a keyless
cosign signature bundle for provenance verification. Windows is not currently
built; use WSL. Confirm the install — the same command reports when a newer
release exists:
bex -vLaunch a provider
A launcher needs the claude binary on your PATH:
npm install -g @anthropic-ai/claude-code
bex glmEach command targets one provider's Anthropic-compatible endpoint — the integration pattern each of these providers documents itself. Keys are bring-your-own: the provider bills your session directly, and bex brokers nothing.
bex glmruns Claude Code against Z.ai's Anthropic-compatible endpoint, the pairing Z.ai documents for its coding plan. The key is read fromZAI_API_KEYorGLM_API_KEY. See GLM CLI with Claude Code.bex kimiruns it against the Moonshot platform's Anthropic-compatible endpoint, keyed withMOONSHOT_API_KEYorKIMI_API_KEY. Moonshot's general-purpose and small/fast model ids land in different Claude Code model slots. See Kimi CLI with Claude Code.bex deepseekruns it against DeepSeek's Anthropic-compatible endpoint, keyed withDEEPSEEK_API_KEY— the one entry in the catalog with a single key variable and the same model id in both slots. See DeepSeek CLI with Claude Code.bex museruns it against the Meta Model API, putting Muse Spark behind Claude Code's workflow, keyed withMETA_MODEL_API_KEYorMETA_API_KEY. See Muse Spark with Claude Code.
Each provider's page carries its endpoint, its API-key console, its current default and small/fast model ids, and a copy-paste quickstart. The launcher index lists all four with their default models.
Keys and isolation: bex code
- Each provider is isolated. A launcher points
CLAUDE_CONFIG_DIRat that provider's own directory under~/.bex/code(move the base withBEX_CODE_HOME), so settings, history, and permissions never collide, instances run in parallel, and your personal~/.claudeis neither read nor modified. InheritedANTHROPIC_*andCLAUDE_CONFIG_DIRvalues are stripped so the surrounding environment cannot leak into the session. - A key is captured once. A provider's first launch opens its API-key
console, takes one hidden paste, verifies the key live against the provider's
Messages endpoint, and stores it owner-only in
~/.bex/code/keys.toml. The key is injected into the child process at launch and written into no configuration file. - The environment always overrides the store. A key already set in that
provider's environment variables wins, first set variable first, so a CI job
or a one-off shell can bring its own key without touching
keys.toml. - Everything after the provider name goes to
claudeunchanged —bex glm --continue,bex glm -p "one prompt", orbex glm --helpfor Claude Code's own flags. bex codeis the hub.bex code(orbex code keys) shows which providers have a stored key;bex code keys set|unset <provider>manage the store, andsetaccepts piped stdin for scripting.
The provider catalog lives in the bex repository, so adding a provider is a data change rather than new command code.
Compatibility and differences
bex continuously exercises the unmodified Render CLI against its Render-compatible REST API. Services, deploys, jobs, logs, Postgres, Key Value, projects, environments, Blueprints, registry credentials, custom domains, SSH, and workspace commands have verified coverage.
Important boundaries:
- bex stamps its configured region; it does not pretend to run in a Render region.
- Render preview environments and Workflows are deliberate non-goals today.
- Postgres Datadog flags and deploy-after-CI-checks are rejected rather than silently accepted.
- The CLI does not switch a service's runtime after creation.
render docsopens Render's documentation. Bookmark this bex guide instead.render skillsis a client-side Render CLI feature, not a bex integration.
For the command-by-command status, verified version, limitations, and live test evidence, read the Render CLI compatibility checklist.
Troubleshooting
The CLI is calling Render instead of bex
Confirm the API base ends in /v1/:
printf '%s\n' "$RENDER_HOST"
# https://api.bex.co/v1/Then re-source setup-render-cli.sh in the same shell.
Authentication expired
bex access tokens last 15 minutes. Re-source the setup helper to exchange the API key for a new token. If the key itself was revoked, create a replacement in Dashboard → Settings.
A command is waiting for input
Pass an explicit resource ID and workspace, then add --output json --confirm.
This is required for reliable CI and agent workflows.
Related guides
- Quickstart — deploy your first bex app
- REST & GraphQL API — understand the API behind the CLI
- Logging — log sources, retention, and filters
- Connect an agent — use bex through MCP
- Claude Code launchers — run Claude Code against GLM, Kimi, DeepSeek, or Muse Spark
- Migrate from Render — move an existing service