NubleStation

@nublestation/cli provides the nuble command — the developer’s tool for connecting to a NubleStation org, pushing database schemas, and deploying frontends. It also wraps the host’s Docker stack (nuble server …) when run on the machine itself.

Installation

npm install -g @nublestation/cli
# or
pnpm add -g @nublestation/cli

Requires Node 22+ (the CLI loads your TypeScript schema.ts with --experimental-strip-types).

Configuration

nuble init writes a TOML config to ~/.nuble/config, organized into profiles so one machine can target several orgs:

[default]
org_url = "http://api.clinic.local"
api_key = "nbl_<key_id>.<secret>"
app_slug = "tasks"

Every command accepts --profile <name> to select a profile (defaults to default).


nuble init

Connect to a NubleStation org and write a profile. Prompts interactively for anything not passed as a flag, then verifies the gateway is reachable before saving.

nuble init
nuble init --url http://api.clinic.local --key nbl_abc.secret --slug tasks
FlagDescription
--url <url>Gateway URL (e.g. http://api.clinic.local)
--key <key>API key (nbl_…)
--slug <slug>App slug
--profile <name>Profile name to write (default: default)

--url also falls back to the NUBLE_GATEWAY_URL environment variable.


nuble db push

Compile your schema.ts and apply it to Blaze.

nuble db push
nuble db push --schema src/schema.ts

What it does:

  1. Loads your schema.ts and serializes it (serializeSchema).
  2. POSTs the schema JSON to /v1/blaze/admin/migrations on the gateway.
  3. Blaze takes a per-app advisory lock, diffs against the previous schema, generates and validates the migration SQL, applies the DDL, and enables Row-Level Security on any new table — all in one transaction.
  4. Prints how many statements were applied (or Schema unchanged on a no-op).

Options:

FlagDescription
--schema <path>Path to your schema file (default: schema.ts)
--profile <name>Config profile to use (default: default)

Your schema module must export schema (or a default export). See @nublestation/blaze for the DSL.


nuble deploy

Zip a built frontend directory and deploy it to Orbit via the gateway.

nuble deploy
nuble deploy --dist build
nuble deploy --build           # run the project build first

What it does:

  1. Optionally runs your project’s build script (--build), loading .env automatically so build-time vars (like VITE_…) are baked in.
  2. Zips the dist/ directory (or --dist).
  3. Uploads it to Orbit; Caddy serves the new files immediately.

Options:

FlagDescription
--dist <path>Built frontend directory (default: dist)
--buildRun the project build script before deploying
--profile <name>Config profile to use (default: default)

nuble status

Check gateway health for every configured profile.

nuble status
[default] http://api.clinic.local — checking… ✓ online

nuble server …

Manage the NubleStation Docker stack on the host machine. These wrap Docker Compose and are meant to run where NubleStation is installed.

CommandDescription
nuble server startStart all services
nuble server stopStop all services (data is preserved)
nuble server restartRestart all services
nuble server statusShow container health
nuble server logs [service]Tail logs (omit service for all; -f to follow)
nuble server status
nuble server logs blaze -f

Environment variables

VariableDescription
NUBLE_GATEWAY_URLFallback gateway URL for nuble init --url