Skip to main content

Command-line interface for the Bentolabs platform API

Project description

bentolabs-cli

Command-line tools for working with the Bentolabs platform API.

Install

uv tool install bentolabs-cli

Or with pip:

python3 -m pip install --user bentolabs-cli

For local development from this repo:

pip install -e apps/cli

Sign in

bentolabs auth login

Opens your browser to a Bento-branded Allow / Deny page. If you're already signed in to the web app, just click Allow and the CLI gets signed in as you. Your tokens are stored in the OS keychain (macOS Keychain / Linux Secret Service / Windows Credential Locker), with a chmod 0600 file fallback for headless Linux boxes that don't ship secret-service.

bentolabs auth whoami   # show signed-in identity + current workspace
bentolabs auth logout   # revoke session + clear keychain

Pointing the CLI at a different environment

The CLI defaults to https://api.bentolabs.ai. To target a local stack or a custom deployment, change the API base — three ways, highest priority first:

# 1. Per-command flag (no persistence) — flag attaches to the subcommand
bentolabs auth login --api-base http://localhost:8080
bentolabs traces list --api-base http://localhost:8080

# 2. Environment variable (per shell)
export BENTOLABS_API_BASE=http://localhost:8080
bentolabs auth login

# 3. Persisted in config (default for every future command)
bentolabs config set api-base http://localhost:8080

bentolabs config show prints the OS-specific config path plus the effective values.

How the browser-side URL is chosen

bentolabs auth login needs to open a browser at the matching web app. The CLI derives this automatically from the effective api_base — it never reads a saved value, so switching api_base always switches the web app too. The mapping is:

api_base you set Browser opens at
http://localhost:8080 or http://127.0.0.1:8080 http://localhost:3000
https://api.bentolabs.ai https://platform.bentolabs.ai
https://api-staging.bentolabs.ai https://platform-staging.bentolabs.ai
anything else the api_base itself (you probably want to override)

If your deployment doesn't follow the api.* ↔ app.* convention, force the web URL explicitly:

export BENTOLABS_WEB_BASE=https://internal.example.com
bentolabs auth login

BENTOLABS_WEB_BASE always wins.

Pick a default workspace

The CLI commands act on one workspace at a time. Set the default once and you won't need to pass --workspace on every command:

bentolabs workspaces list           # see the workspaces you belong to
bentolabs workspaces use <id>       # persist this as the default

To override per command:

bentolabs traces list --workspace <other-id>

The --workspace <id> flag wins over the persisted default.

Usage

bentolabs --help                           # discovered command groups
bentolabs traces --help                    # ops under "traces"
bentolabs traces list --limit 5            # uses the persisted workspace
bentolabs traces list --tag prod --tag errors
bentolabs raw GET /health                  # ad-hoc escape hatch
bentolabs refresh                          # pull latest command metadata

Output

JSON by default (pretty-printed via rich). Use --output raw for unformatted stdout (pipeable), or --output table for list endpoints with simple row shapes.

Workspace API keys (for SDKs and CI)

Workspace-scoped API keys still exist for SDK integrations and CI — they just aren't how the CLI itself authenticates anymore. Mint and manage them with:

bentolabs api-keys create
bentolabs api-keys list
bentolabs api-keys revoke <id>

The resulting bl_pk_… keys are intended for the SDK or other server-side callers — not for the CLI. The CLI authenticates only as a human via bentolabs auth login.

Publish

just publish-cli

The recipe runs the CLI lint/test/build checks, builds the wheel/sdist, then publishes bentolabs-cli to PyPI with UV_PUBLISH_TOKEN or PYPI_TOKEN.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bentolabs_cli-0.1.2.tar.gz (50.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bentolabs_cli-0.1.2-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file bentolabs_cli-0.1.2.tar.gz.

File metadata

  • Download URL: bentolabs_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 50.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bentolabs_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f26f71b14944d2d863b465faf87e218251143096af8ccd11c6e29ac854125e05
MD5 c392f7551e62d651973bd01ad0902dfd
BLAKE2b-256 b678ffc2b49a61b02b5040531b7698408b0664686a949e0d41bfcc81219fecff

See more details on using hashes here.

File details

Details for the file bentolabs_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bentolabs_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bentolabs_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 606bc57f964496f0a29dc13cb96355739b13a897d74a7f7dc5f8bd008e555e86
MD5 8eeeedbb0230bd639833854c07297d0f
BLAKE2b-256 9ff27b38ab3b62774efdd6cc1645f3b6eb141c83c7c99c1756dbc97c7af40782

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page