Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

7.9 KB
Raw Blame

Hosted App commands

boxlite app deploys a local project to BoxLite Cloud and manages its environments. The installed BoxLite executable contains these commands. Use boxlite app --help for the command list or boxlite app deploy --help for the options on a specific command.

To browse the CLI’s management requests, open /api on your API server and expand Applet. The CLI uses the hosted Apps OpenAPI contract.

Authenticate and select an App

Sign in to the server named by the Dashboard handoff. A named context stores the platform credential and organization. Use a secret on stdin when setting up CI.

boxlite --context work auth login --url https://api.example.test/api
boxlite --context work auth whoami
boxlite --context work app list
boxlite --context work app init shop --create --env main
boxlite --context work app status --json

A project link in .boxlite/link.json records the App, environment, organization URL and spec version. Use --env to select another environment. --app selects an App outside a linked directory. A conflicting App or organization in a linked directory is an error. boxlite app status --json includes the selected environment’s url, status and access, the environment list envs, and sign_in_providers. A new environment’s URL is null until the first healthy deployment.

For unattended use, pipe the organization key to boxlite --context work auth login --url SERVER --api-key-stdin, or set BOXLITE_API_KEY, BOXLITE_REST_URL and BOXLITE_REST_PATH_PREFIX. Apps permissions determine which requests the API allows.

Project and deployment workflow

boxlite app deploy --check
boxlite app deploy --dry-run
boxlite app deploy -m "Publish storefront"
boxlite app logs --source web --level error --since 10m
boxlite app logs --follow --json
Task Command
Check files and migrations locally or validate online boxlite app deploy --check, boxlite app deploy --check --online
Apply resource and configuration changes boxlite app deploy --config-only --yes
Inspect a deployment plan boxlite app deploy --dry-run
Publish the current project and wait for deployment boxlite app deploy
Deploy a prepared request or an existing source snapshot boxlite app deploy --request request.json, boxlite app deploy --snapshot ID
Fetch the environment’s manifest and retain a local backup boxlite app init --pull
Download deployed source boxlite app init --clone shop
List release history or revert to a previous release boxlite app status --deployments, boxlite app rollback 7
Inspect environment findings as Markdown boxlite app status --details --format markdown
Diagnose local project and hosted environment issues boxlite app status --diagnostics
Inspect the environment, Dashboard view or services boxlite app status --details --json, boxlite app status --view, boxlite app status --services
Restore a database without rolling back application code boxlite app rollback --snapshot ID --yes or boxlite app rollback --to TIMESTAMP --yes
Delete a selected environment boxlite app delete shop --env qa --yes
Move an App to the recycle bin, list deleted Apps and restore one boxlite app delete shop, boxlite app list --deleted, boxlite app restore shop

A deployment generates a UUID idempotency key by default. To retry the same submission across CLI invocations, pass the same --idempotency-key <UUID> each time. A deployment waits for the terminal result by default. --detach returns the queued deployment, and --verbose displays build logs while following it. A stale-base error calls for boxlite app init --pull and review of local changes before another deployment. Destructive operations such as rollback --with-database and delete --permanent require explicit confirmation.

Environment variables and secrets

boxlite app vars set LOG_LEVEL=info
printf '%s' "$STRIPE_KEY" | boxlite app vars set STRIPE_KEY --secret
boxlite app vars set SHARED_TOKEN --from org/shared-token
boxlite app vars list
boxlite app deploy

Plain edits and references update boxlite.toml. The secret command stores the value in the App’s secret store and writes its reference to the selected environment’s manifest. Add --online to apply a change directly to the hosted environment. Online creation of a secret requires a new name. Use --from for an existing secret. boxlite app vars unset NAME --secret removes the reference and keeps the stored value.

Local development and PostgreSQL

Task Command
Run the project against a development environment boxlite app dev --env qa
Query the hosted database through the API boxlite app psql --env qa --query 'SELECT 1' --json
Open the local PostgreSQL client or run one client command boxlite app psql --env qa, boxlite app psql -c "SELECT 1"
Forward a local PostgreSQL port for another client boxlite app psql --proxy --env qa
Create a numbered migration in the project boxlite app psql --migration add_orders

Use --query - for SQL on stdin and --explain for a query plan. The query API works with the BoxLite executable alone. Install the PostgreSQL client to use an interactive session or -c. SQL and proxy access default to read-only. Pass --write for an intentional write. Publish schema changes on the main environment through migration files.

Organization-scoped REST requests

boxlite api METHOD PATH uses the active platform context. Paths start at the organization. Replace shop and staging with your App and environment. Mutating requests take effect immediately.

boxlite api GET /apps/shop/envs/staging/db/schema
printf '%s' '{"query":"SELECT 1","explain":true}' | boxlite api POST /apps/shop/envs/staging/db/sql --input -
boxlite api GET /apps/shop/envs/staging/auth
boxlite api GET /apps/shop/envs/staging/deployments/7/timeline
printf '%s' '{"name":"qa","from":"main"}' | boxlite api POST /apps/shop/envs --input -
boxlite api GET "/apps/shop/envs/qa/probe?path=/health"
boxlite api POST /apps/shop/envs/qa/services/all/restart

For the SQL endpoint, JSON fields are query, optional write and optional explain. Pass write: true only for an intended change. The REST result is JSON, while boxlite app psql -c uses the locally installed PostgreSQL client.

Set the access level in boxlite.toml at the root or in [env.staging] and apply it with boxlite app deploy --config-only --yes. A Dashboard override takes precedence. To return control to the manifest for this environment:

printf '%s' '{"access":null}' | boxlite api PUT /apps/shop/envs/staging/access --input -

Use the App’s Dashboard for visitor accounts, volume files, email configuration and provider credentials. To route an organization-owned hostname, use boxlite domain bind shop.example.test --type app --app shop --env staging. Open a private App in the browser with boxlite app status --open, or use Open app in the Dashboard. boxlite app status --open --print-url returns a one-time link. Keep that link private.

For an HTTP check against the selected workload, use boxlite app request /health --expect 200. Add --as [email protected] for a short-lived test visitor. For example, in a disposable environment:

boxlite app request /admin --env qa --as [email protected] --role owner --expect 200
boxlite app request /admin --env qa --as [email protected] --expect 403

App commands with --json write documents to stdout and errors to stderr. logs --follow --json emits newline-delimited JSON. Workload checks using request --json include the HTTP status and response body. App output masks organization keys, Box tokens and passwords in PostgreSQL URLs, including when they appear in logs or API errors. The raw API command streams successful response bodies byte for byte.