Skip to main content

Command-line interface for the Bentolabs platform API

Project description

bentolabs-cli

OpenAPI-driven CLI for the Bentolabs platform API. Commands are auto-discovered from the running API's /openapi.json — no codegen, no hand-written wrappers per endpoint. New routes show up after bentolabs refresh.

Install

pip install bentolabs-cli

For local development from this repo:

pip install -e apps/cli

Setup

bentolabs config set api-base http://localhost:8080
bentolabs config set api-key bl_pk_...           # from POST /workspaces/{id}/api-keys
bentolabs refresh                                # cache the command tree

Config lives at ~/.bentolabs/config.toml. You can also pass --api-key per call, or set BENTOLABS_API_BASE / BENTOLABS_API_KEY env vars. The CLI only fetches /openapi.json when you run refresh; startup and --help use the cached spec if one exists.

Usage

bentolabs --help                           # discovered command groups
bentolabs traces --help                    # ops under "traces"
bentolabs traces list <ws-id>              # path params positional
bentolabs traces list <ws-id> --limit 5    # query params as flags
bentolabs traces list <ws-id> --tag prod --tag errors
bentolabs raw GET /health                  # ad-hoc escape hatch
bentolabs refresh                          # re-fetch openapi spec

Auth coverage

The API has two auth systems: Supabase JWT (browser) and API keys (workspace- scoped, bl_pk_… prefix). This CLI authenticates with API keys.

API keys are deliberately treated as member-level access — never owner. That means three tiers:

Tier 1 — API key works (require_workspace_member, no get_current_user):

  • analytics, clusters, drift, trajectories, workspace-extraction-config (read)
  • traces list, signals list, notification-channels list

Tier 2 — JWT-only (management/owner-gated): API keys 401/404 here on purpose to prevent privilege escalation:

  • workspaces list/rename/users, api-keys list/create, workspace-extraction-config put
  • credentials create/update/delete (workspace bearer secrets)
  • notification-channels create/update/delete
  • sync settings update / workspace reports

Tier 3 — JWT-only (user identity required): routes that resolve access from Supabase user membership, or write FK columns to public.users for audit trails:

  • traces get/body/spans/issues by bare trace id
  • signals get/events by bare signal id
  • notification-channels get/last-delivery by bare channel id
  • issues — status changes, comments, updates
  • incidents — acknowledge / assign / resolve
  • credentials, sync, deep-search mutations
  • agent — interactive surfaces

Hitting a JWT-only route with an API key returns 401 (missing user identity) or 404 (owner gate). The error envelope tells you which.

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.

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.0.tar.gz (26.4 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.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bentolabs_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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.0.tar.gz
Algorithm Hash digest
SHA256 dd6e95d1fbc46bc8ed004af7bb255eed0a4459a625cf21024c8a1d911049c22c
MD5 b359fe861834f297e36286d7ea768ebe
BLAKE2b-256 d4d5e56cebcd54b48607f3a12593908dd73ce5eef8f884529a50e2f443f5925b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bentolabs_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 635a8f533bd14d260b55976a7025018e9369b525dd072da76c3da85a4f78ff5c
MD5 5ccd78b4ada152735afb7fb098ddca15
BLAKE2b-256 233542ccac6b6b76cc2a330757bb56c6f9481036f3b423eb17fae7d3464c80a7

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