bl is the command-line interface for BuilderLab. It provides authenticated
access to BuilderLab skills, agents, workspaces, and apps, along with the
bl tools command for discovering configured tool extensions.
The CLI is written in Rust and is built from this repository. Run bl --help
to see the current command surface:
auth Manage BuilderLab marketplace authentication
workspace Manage BuilderLab workspaces
apps Manage apps through Apps Platform
curl Call a protected BuilderLab hosted app with curl
config Get and set bl preferences
skills Manage BuilderLab skills
agents Manage BuilderLab marketplace agents
completions Generate shell completions
tools Discover auth-backed tool extensions
This repository uses the Hermit-managed toolchain. From the repository root:
source ./bin/activate-hermit
just build-bl-release
target/release/bl --helpFor a debug build during development:
cargo build --locked --bin bl
./target/debug/bl --versionService access requires an existing BuilderLab account and a reachable backend.
The inherited default is Block's internal https://kgoose.sqprod.co; building
this public repository does not grant access to that service. For another
BuilderLab installation, set KGOOSE_BASE_URL to the base URL supplied by its
operator before logging in. Organization configuration does not replace that
base URL.
Authenticate before using commands that access BuilderLab services:
./target/debug/bl auth login
./target/debug/bl auth status
./target/debug/bl skills listThe CLI can also configure the organization used for service routing:
./target/debug/bl config set org <org>
./target/debug/bl config get orgbl tools (or bl tools --help) fetches the configured extensions from the
selected KGoose backend. Extensions whose credentials are missing for the caller
appear with [not connected] beside their description. The same live list is
used by bl tools --describe-commands. Listing requires backend access and
authentication, just like inspecting or calling an extension's tools.
When inspecting an extension fails, bl tools also uses the live extension list
to distinguish an unknown name from a configured extension that is not connected.
The separately packaged sq agent-tools command uses the embedded
extensions.yaml catalog for its top-level help and command discovery.
Use --json for machine-readable output and --verbose for request
diagnostics. Do not include credentials or other sensitive data when sharing
verbose output.
To publish a built static site or single-page app, deploy the build output directory:
bl apps deploy docs-site --dir dist --jsonIf you have no app with that ID, the first deploy creates it as a static app,
says so on stderr (Created new app docs-site at <url>), and reports
"created": true with the creation details under create. Later deploys to the
same ID update it. Because a mistyped ID creates a new app rather than failing,
check that line on first deploys; remove an unintended app with
bl apps delete. An ID someone else already owns fails before anything is
deployed. Pass --private on the first deploy to make the new app private
before it goes live; for an app that already exists, --private only checks
that it is already private.
--dir takes the folder your build writes, with index.html at its root. The
CLI writes the static manifest, packages the files under public/, and uploads
the result, so no manifest or tarball is needed. It skips .DS_Store, ._*
AppleDouble files, __MACOSX/ and .git, plus .env*/.envrc files and
node_modules/ so --dir . doesn't publish secrets or dependencies, and
refuses other symlinks. The same
directory always produces the same archive.
Unknown paths return 404. For client-side routing, pass --spa to serve
index.html for unknown paths instead. Current platform static runtimes also
serve /about from about.html and answer a 404 with the site's root
404.html when present.
The JSON response adds created and packaged_site with the file count, byte
sizes and skipped paths. To deploy a prebuilt artifact.tar.gz instead, pass
its path in place of --dir; that needs an app from bl apps create first.
When the selected Apps Platform contract and server support managed MySQL, create a fetch-js app with:
bl apps create --app-id inventory --runtime-profile fetch-js --persistence mysql --jsonThe command plans, reserves the exact app ID, and initializes its database
before returning success. MySQL supports fetch-js and process apps; pass
the runtime explicitly. MySQL is unavailable for static apps.
The client preserves server availability errors; it does not fall back to SQLite.
For an existing app, inspect it first. To resume failed initialization or enable MySQL on a compatible stateless server app, use its existing runtime:
bl apps get inventory --json
bl apps initialize inventory --runtime-profile fetch-js --persistence mysql --jsoninitialize checks that the app exists, plans the requested settings, and
initializes the same ID without another reservation. It does not reclaim
deleted apps or migrate an existing database to another engine. Use the same
selected endpoint and environment throughout. Check the returned
initialize.persistence is mysql before deploying the matching runtime artifact.
Deleting a MySQL app revokes its database access, but the database data is retained.
To reuse a deleted app's ID, for example to give a deleted static site's URL a
database, run bl apps create with the new runtime and persistence:
bl apps create --app-id inventory --runtime-profile fetch-js --persistence mysql --jsonOnce the deleted app's cleanup finishes, create reclaims the ID as a new app
and reports reclaimed: true; its sharing, publishers, versions, and data are
not carried over. Until then it fails with app_deleted; retry a few minutes
later.
For inherited Apps Platform trace context and failure correlation, see Apps operation correlation.
On a BuilderLab Blox workstation, the operator sets BL_APPS_CONTROL_PLANE_URL.
For that origin, the CLI delegates authentication to Roxy and needs no local
login or organization configuration. Roxy obtains a short-lived Compose JWT
from KGoose for the workstation owner and injects it on the wire. Any other
URL, including an explicit --base-url outside that origin, must be an
approved HTTPS ingress and requires bl auth login.
bl whoami prints the user-* ID the Apps Platform control plane verifies
for your session: the ID shown as an app's owner and in publisher lists, and
the one to give someone adding you as a publisher. bl whoami --json prints
{"user_id": "...", "environment": "..."}. It uses the same control plane
and authentication as bl apps, so it needs BL_APPS_CONTROL_PLANE_URL or
--base-url.
Hosted apps (https://<app>.apps.<org>.builderlab.xyz) accept only the
tenant's hosted-site session cookie, not the bl auth login credential. Use
bl curl to call them from scripts and agents:
bl curl https://myapp.apps.block.builderlab.xyz/api/items -sS
bl curl https://myapp.apps.block.builderlab.xyz/_compose/server/save \
-H 'Content-Type: application/json' -d '{"name":"example"}'The URL comes first; the remaining arguments go to the system curl. On first
use, or after the hosted session expires, bl curl opens a browser login and
stores a hosted-app session for the configured org, separately from the CLI
session. bl auth logout revokes it on the server and removes it.
- Only
httpshosts inside the configured org's hosted-app domain receive the session. Configure the org withbl config set org <org>. - The cookie reaches
curlon stdin (curl --config -), never on the command line. Options that could print or forward it (-v,--trace,-L,-b,-c,-K,-k,--resolve, and similar) are refused, as are request bodies read from stdin (-d @-) and negations that undo whatbl curlenforces (--no-globoff,--no-disable,--no-get,--no-head). Use-iinstead of-Dto see response headers. - POST requests to
/_compose/server/*getOrigin: https://<host>unless you setOriginyourself. - If the app needs your approval,
bl curlprints the approval URL and exits with code 3. - If the app rejects a stored session,
bl curllogs in again once. It resends onlyGET,HEAD, andOPTIONSrequests. Other requests could already have taken effect, sobl curlexits with code 3 and asks you to rerun the command with the new session.
See BuilderLab Auth Flow for the login details.
A valid CLI session does not guarantee Apps access. For an empty HTTP 403,
the CLI uses the account information already verified by /auth/me to provide
account_setup_required when setup is incomplete, or builderlab_access_required
when BuilderLab product access is absent. Follow next_action using the same
account and environment. Repeating login does not finish account setup.
Other permission denials retain their server code and recovery guidance. A 403 uses exit code 4; an expired session (HTTP 401) uses exit code 3 and login guidance. Account information only adds recovery guidance after a denial; the server continues to decide access.
Apps HTTP failures include error.details.http_status in JSON output and retain
the server error code and available trace ID. For HTTP 400
artifact_manifest_invalid, human output and error.details.validation give
repair guidance. Missing hotpod.manifest.json and missing fetch-js ASSETS or
HOTPOD bindings get specific diagnostics; other manifest failures point to
the selected control plane's advertised schemas and runtime requirements.
Rebuild the artifact after fixing it, then explicitly deploy again.
Use the same control plane for contract discovery, carrying forward any
--base-url override used for the rejected request.
The CLI generates validation details from fixed public validator messages. Unknown backend messages and raw bodies remain hidden; malformed or unavailable responses retain the generic HTTP failure. Existing server recovery strings are credential-redacted and terminal-safe. This does not retry failed mutations.
bl apps list --scope owned --json preserves the server's optional quota
metadata. A list without --scope, or with --scope manageable, includes it
too, read from the owned listing; it is left out if that read fails or takes
more than 5 seconds. quota.current_count is authoritative owner usage,
including held deploy reservations. The list's count describes visible apps
and can differ. Check accounting_enabled, enforcement_enabled and tier_status before using
the current allowance. Missing quota metadata does not mean zero or unlimited
usage; an unavailable tier has no reliable tier-derived limit.
Apps JSON errors retain the public object fields from error.details, alongside
the CLI's http_status and reviewed validation diagnostics. Top-level
next_action preserves string or structured recovery guidance. Credentials and
terminal controls are sanitized only in these error recovery fields. Unsafe
object keys omit the affected field. Successful JSON data, including multiline
debug logs and deletion metadata, retains its original shape and contents after
credential redaction. Authentication failures keep local auth guidance and do
not expose server details.
For owner_site_limit_reached, inspect owned apps on the same control plane,
delete only an app you no longer need, then refresh authoritative usage before
retrying. Existing counted apps remain manageable at the cap. Initialization
does not consume quota; a validated deployment claims a slot, and failure after
admission can retain that reservation until retry or owner deletion.
Deletion requires the exact app and environment confirmations. A retired route
does not prove capacity was released: quota_cleanup_pending: true means the
slot remains held. The server retries that cleanup on its own, so there is
nothing to rerun: inspect the same app/environment and recheck usage with
bl apps list --scope owned --include-deleted --json. If cleanup stays pending,
ask the BuilderLab team, because some cases need an operator to resolve. Owner
reconciliation and unavailable quota or tier services require recovery before
another mutation. The CLI does not automatically delete apps or retry failed
mutations.
Install the repository tools and git hooks once:
./bin/hermit install rustup just lefthook
source ./bin/activate-hermit
just setupRun the standard checks:
just fmt-check
just lint
just test
just ciRun the isolated Docker acceptance harness for the skills workflows:
just bl-cli-docker-acceptanceFor browser-based authentication and local service testing, see:
The most useful configuration options are:
| Variable | Purpose |
|---|---|
BL_HOME |
Override the BuilderLab state directory. |
BL_SKILLS_HOME |
Override the installed skills directory. |
BL_SKILLS_CONFIG |
Select an explicit skills configuration file. |
BL_SKILLS_PROFILE |
Select a skills configuration profile. |
BL_AUTH_STORAGE |
Select authentication storage, including file for local testing. |
BL_AUTH_STORAGE_FILE |
Path used when file-backed auth storage is selected. |
KGOOSE_BASE_URL |
Override the backend base URL for local development. |
BL_KGOOSE_PLAYPEN |
Route backend requests through a named development playpen. |
For example, a local backend can be used without changing the stored profile:
KGOOSE_BASE_URL=http://localhost:8080 \
./target/debug/bl --local-dev skills listAuthentication storage defaults to the operating-system keyring where supported. The local auth guide documents file-backed storage for tests and development without modifying keyring state.
src/bl/contains theblcommand implementations.crates/builderlab-auth/contains browser login, session storage, workspace, and organization-routing support.src/lib.rswires the CLI runtime and test harness together.tests/bl_e2e.rscontains the offline and mock-service end-to-end coverage.docker/acceptance/contains the isolated skills acceptance harness.docs/RELEASING-bl.mddescribes release builds and downstream packaging.
Build a release binary with:
source ./bin/activate-hermit
just build-bl-release
target/release/bl --versionThis repository owns the bl binary, which can be used independently of Berd
or Buzz. Standalone downloads and app-assisted installation or updates are
planned; for now, build from source. See RELEASING-bl.md
for the current build and distribution status.
- Contributing guide
- Report a bug or request a feature
- Security policy
- Block Open Source governance
- Apache License 2.0
The executable and environment variables now use bl and BL_. The default
state directory is ~/.bl; existing ~/.bb preferences and agent installation
records are not automatically moved. To continue using that state, explicitly
set BL_HOME="$HOME/.bb" before running bl, and translate any BB_ overrides
to their BL_ equivalents. Keep the same backend URL and profile to reuse a
stored session. macOS keychain IDs and skill/agent ownership metadata retain
their legacy names so existing credentials and managed installs remain usable.
Do not use --force just to adopt an existing installation.
The backend X-BB-Session-Credential header, BBIdentity authorization scheme,
builderbot extension ID, and
Playpen routing key are protocol identifiers and retain their existing names.
On Linux and Windows, keyring login storage is not implemented; the explicit
BL_AUTH_STORAGE=file option is available as described in the local auth guide.
On managed bb-public Blox workstations, bl workspace list uses the same
operator-configured Kgoose endpoint and Roxy owner identity as bl tools.
It needs no local org setting or bl auth login, and does not read or write
local session credentials. The server derives the org from the verified owner
and returns that owner's current workspace memberships. This requires the
shared workspace-list endpoint to accept workstation authentication, with the
matching Roxy policy deployed.
bl workspace switch continues to require a local CLI login; listing does not
change the workstation's active workspace or rotate a session.
After readiness, bl apps get APP_ID shows the app, who can open it and its Share &
manage link, for example:
Who can open it: Only you. So can members of the Buzz community Alpha Team.
bl apps visibility APP_ID workspace|private switches between everyone in the app's
workspace and only you, and bl apps community grant|revoke APP_ID COMMUNITY_ID
shares with a Buzz community; bl apps community list shows the IDs. Each prints who
can open the app afterwards. Add --json for the full response. get --json keeps
the inspection fields and adds who_can_open, audience, app_url,
management_url and next_action beside them. bl apps handoff is a hidden alias
for get, kept for older scripts.
When --management-base-url or BL_APPS_MANAGEMENT_BASE_URL gives the HTTPS portal
origin for the same environment, get also returns an exact management_url into the
app's Share & manage panel; the flag wins over the variable. Without an origin, or
with a blank one, it still reports the audience, returns management_url: null,
and points the owner to Hosted Apps in the BuilderLab portal. An invalid
--management-base-url is an error before any request; an invalid
BL_APPS_MANAGEMENT_BASE_URL only drops the link and says why. The CLI never guesses the portal from a workstation, app or
mesh hostname. Keep the configured control-plane origin for delegated authentication.
The result separates verified policy from unknown access and does not claim
recipient browser acceptance. get performs no sharing, session switch, or deployment.
If policy inspection is unavailable, the audience is reported as unknown.
Portal deep links require the matching portal and Kgoose workspace-selection changes.
An app you own can use your read-only tools (for example Jira or Slack reads) when nobody is signed in to it, such as from a schedule. This is available only where the environment enables it (bb-block), and only for process or fetch-js apps.
bl apps background on APP_ID
bl apps background status APP_ID
bl apps background off APP_IDUse on to turn them on. It opens the approval link in your browser, waits while
you approve and Compose restarts the app's sandbox so only your code runs (up to
about 10 minutes), and exits 0 when they are on and ready. Approval is
browser-only by design: only the app's owner can approve, and the CLI never
approves. Progress goes to stderr. With --json, stdout gets one final JSON object
(the status below). Options:
--no-browserprints the link instead of opening it. The link is also only printed on a Blox workstation and when using the workstation proxy.--timeout SECONDS(default 600) bounds the wait. On timeout it exits non-zero and says to checkbl apps background status APP_ID.
If the owner hasn't approved the app's own tool access yet, on says
Can't turn on yet: ..., opens the app for you to approve, and carries on once
that is done. It exits non-zero when the app declares no read-only tools
(no_read_capabilities), when other publishers pause access
(other_publishers), when access is turned off again, or when the wait times out.
Temporary network or server errors are retried until the timeout.
Turning them on makes the app owner-only, so only you can deploy it and calls
pause while any other publisher exists. status changes nothing: it shows whether
you are the sole publisher, whether the app is ready or restarting, which tools
are approved or waiting for approval, what blocks approval (blocked_reason),
and prints Approve in your browser: <link> when approval is needed. off turns
them off and confirms the new state; it only reduces access, so it asks for no
confirmation. --json prints ok, app_id, state, sole_publisher, ready,
restarting, capabilities, pending_capabilities, confirmed_at, message,
blocked_reason (code, message, next_step, url; null when nothing is
known to block approval or Kgoose doesn't report it) and approval_url.
On a BuilderLab Blox workstation, these commands use the workstation's user identity
through the configured BL_TOOLS_BASE_URL proxy, without a local login or organization
configuration. The proxy defaults to Kgoose's internal /cash-app/goose prefix;
--kgoose-service-path or KGOOSE_SERVICE_PATH can override it. Elsewhere the commands
use your bl auth login session. Neither needs --base-url. Exit codes follow the other bl
commands: 3 when you need to log in, 4 when you are not the app's owner, 5 for a
network or server failure, and 1 for refusals such as background_disabled (not
available in this environment), owner_consent_required, other_publishers or an
unsupported runtime. Each refusal carries a next_action.
When the selected control plane advertises lifetime operations, read the exact app's deadline and renewal eligibility:
bl apps expiration APP_ID --base-url "$BL_APPS_CONTROL_PLANE_URL" --jsonUse the returned incarnation, expiration revision, and an allowed day count to renew as the owner. Preserve all fields on a retry, including the request ID:
bl apps renew APP_ID --base-url "$BL_APPS_CONTROL_PLANE_URL" \
--app-incarnation-id INCARNATION --expected-revision REVISION \
--request-id UNIQUE_RENEWAL_ID --days DAYS --jsonRenewal adds days to the previous deadline. The server enforces ownership and the renewal window. A conflict does not trigger a retry with a newer revision; read current expiration before choosing a new request. An identical retained retry returns the original receipt without another extension. These commands do not enroll, restore, or delete an app, and do not prove serving readiness.