@buildspacestudio/cli
v0.6.0
Published
Buildspace CLI for app creation, setup, deployment, and environment management
Readme
@buildspacestudio/cli
BuildSpace CLI for creating apps, cloning repos, managing env vars, and triggering deployments from your terminal.
Install
Requires Node.js 18+.
npm install -g @buildspacestudio/cli
buildspace --helpWhat it does
- Sign in with browser-based login or a personal access token
- Create and select BuildSpace apps
- Clone an app repo locally
- Manage dev and prod environment variables
- Enable hosting and inspect hosting state
- Trigger deployments and stream deployment logs
Quick start
# 1) Authenticate
buildspace auth login
# 2) Create an app
buildspace app create --name "My App"
# 3) Clone it locally
buildspace init --app my-app
# 4) Pull local env vars
buildspace env pull --env dev
# 5) Deploy current HEAD to dev
buildspace deployCommands
auth
Manage authentication for CLI requests.
buildspace auth login
buildspace auth set --token <bs_pat_...>
buildspace auth show
buildspace auth clearloginopens a browser, completes a PKCE flow, and stores a token locallysetstores a personal access token manuallyshowprints the masked token and active API/git endpointsclearremoves the stored token
Useful options:
buildspace auth login --url https://creator.buildspace.studio --git-url https://api.buildspace.studio
buildspace auth login --no-open
buildspace auth login --name "CLI on laptop" --expires-days 30app
Create apps, switch active app context, and manage hosting.
buildspace app list
buildspace app current
buildspace app use <slug>
buildspace app create --name "My App"
buildspace app delete <slug> --confirm <slug>
buildspace app hosting status [--app <slug>] [--env dev|prod]
buildspace app hosting enable [--app <slug>] [--env dev|prod]
buildspace app hosting disable [--app <slug>] [--env dev|prod]Notes:
app createsets the new app as your active app automaticallyapp deleteis a soft delete and requires--confirmto match the slug exactly- hosting commands default to the resolved app from
--app, git remote, or active app
config
Inspect or override the API and git base URLs used by the CLI.
buildspace config show
buildspace config set-url --url <api-base-url> [--git-url <git-base-url>]
buildspace config resetinit
Clone a BuildSpace app repo by slug.
buildspace init --app <slug>
buildspace init --app <slug> --dir ./my-local-folderAfter cloning, the CLI changes its working directory to the clone and runs the same flow as buildspace env pull for dev (writes .env.local). Your interactive shell does not change—use the printed cd path to enter the project.
env
Manage environment variables for an app.
buildspace env list [--env dev|prod]
buildspace env set KEY=VALUE [--env dev|prod] [--secret | --no-secret]
buildspace env unset KEY [--env dev|prod]
buildspace env pull [--env dev|prod] [--output .env.local]Behavior:
listshows masked valuessetcreates or updates a variable, and uppercases the key automaticallypullwrites system vars plus non-secret vars to a local env file- keys with the
BUILDSPACE_prefix are reserved NEXT_PUBLIC_*keys default to non-secret unless you override them
Examples:
buildspace env list --env prod
buildspace env set STRIPE_SECRET_KEY=sk_test_123 --secret
buildspace env set NEXT_PUBLIC_API_URL=https://example.com --no-secret
buildspace env pull --env dev --output .env.localdeploy
Deploy from the current repo and inspect deployment state.
buildspace deploy
buildspace deploy status
buildspace deploy history --env prod --limit 5
buildspace deploy logs --env dev --latest
buildspace deploy logs --env prod --deployment <deployment-id>deploypushesHEADtoorigin/mainto trigger a dev deploymentstatusshows the latest deployment summary for dev, prod, or bothhistoryshows recent deployment history for dev, prod, or bothlogsshows deployment logs for a specific deployment or the latest one
telemetry
Manage anonymous product telemetry preferences.
buildspace telemetry status
buildspace telemetry enable
buildspace telemetry disablestatusshows whether telemetry is enabled and the anonymous installation IDenableturns on anonymous telemetry (default)disableturns off all telemetry data collection
Telemetry can also be disabled globally via the environment variable:
export BUILDSPACE_TELEMETRY=0Telemetry is anonymous, fire-and-forget, and never blocks CLI commands. See the telemetry docs for details on what is collected.
App resolution
Most app-aware commands resolve the target app in this order:
--app <slug>- the current git remote
origin - the active app saved by
buildspace app use
That means commands like buildspace env list and buildspace deploy status usually work directly inside a cloned BuildSpace app repo.
Local config
The CLI stores local settings such as:
- personal access token
- API base URL
- git base URL
- active app selection
You can inspect the current configuration at any time with:
buildspace config showHelp
Run help for any command group:
buildspace --help
buildspace auth --help
buildspace app --help
buildspace env --help
buildspace deploy --helpLinks
- Docs: https://docs.buildspace.studio/docs/cli/overview
- Repository: https://github.com/buildspacestudio/buildspace/tree/main/packages/cli
