CLI
laser - command-line and TUI for LaserData Cloud
laser is a single static binary that drives the LaserData Cloud control plane from your terminal. Two execution modes share one binary, one config, and one set of credentials:
- Headless - one-shot verbs (
laser tenant get,laser deployment list). The default. Suitable for pipes, scripts, cron, and CI. Exit code0on success, non-zero on failure. - TUI - full-screen Ratatui dashboard with mouse and keyboard support, a command palette, and persistent history. Launched via
laser tui, or by passing--interactiveto any verb.
The CLI is tenant-scoped: it authenticates with an API key (not your user account) and operates on a tenant's hierarchy - divisions, environments, and deployments. Provision credentials with the appropriate roles and permissions before signing in.
Supported platforms: macOS (arm64) and Linux (x86_64, arm64).
Install
curl -fsSL https://cli.laserdata.cloud/install.sh | shThe installer detects OS + arch, downloads the matching tarball from the public release repo, verifies the SHA-256 checksum, and drops laser into $HOME/.local/bin (or $LD_PREFIX if set). Re-run any time to upgrade.
Installer Flags
Pass flags via sh -s --:
| Flag | Effect |
|---|---|
--to <dir> | Install dir (default $HOME/.local/bin). Alternative to LD_PREFIX. |
--version <vX.Y.Z> | Pin a release tag (default latest). Alternative to LD_VERSION. |
--with-cc-skills | Also install/update the Claude Code skill pack from cli.laserdata.cloud/claude.sh. See Claude Code Skills. |
--help | Show usage. |
Environment Variables
| Var | Effect |
|---|---|
LD_VERSION | Pin release tag. |
LD_PREFIX | Override install dir. |
Common Recipes
# Pin a version.
curl -fsSL https://cli.laserdata.cloud/install.sh | sh -s -- --version v0.2.1
# System-wide install dir.
curl -fsSL https://cli.laserdata.cloud/install.sh | sh -s -- --to /usr/local/bin
# Bundle Claude Code skills in the same step.
curl -fsSL https://cli.laserdata.cloud/install.sh | sh -s -- --with-cc-skills
# All three at once.
curl -fsSL https://cli.laserdata.cloud/install.sh \
| sh -s -- --version v0.2.1 --to /usr/local/bin --with-cc-skillsThe installer is idempotent: re-running upgrades the binary (overwrite) and the skill pack (cp -f) in place. Safe to script in CI or dotfiles.
In-Place Upgrade
laser updatePulls the latest release and replaces the running binary atomically.
Verify
laser versionSign In
laser auth login --tenant-id <numeric-id>Prompts for the API key (masked input) and stores the secret in the OS keyring (Keychain on macOS, Secret Service on Linux). Only the account name lands on disk; the secret itself stays in the keyring. The login flow validates the key by hitting GET /tenants/<id>/api_keys/context and prints back the resolved role on success; a non-2xx response means the key is revoked, expired, or wrong-tenant.
The tenant id is required on first login. The CLI resolves it (in order) from --tenant-id <id>, LD_TENANT_ID, or the existing context's saved tenant_id. With none of those set the command errors out.
For agents, CI, and scripts, set the key + tenant in the environment instead:
export LD_API_KEY=ld_pat_...
export LD_TENANT_ID=615380456123456789LD_API_KEY always takes precedence over the keyring, so no separate login step is needed in CI. To inspect the role and permission set the active key resolves to, use laser tenant key context -o json at any time.
Local State
All state lives under XDG paths (or the platform equivalent on macOS):
| Path | Purpose |
|---|---|
$XDG_CONFIG_HOME/laser/config.toml | Named contexts (mode 0600, atomic writes). Stores account names only; secrets stay in the OS keyring. |
$XDG_STATE_HOME/laser/active | Pointer to the currently active context. |
$XDG_DATA_HOME/laser/history | TUI command history. Capped at 1000 entries with atomic writes. |
$XDG_DATA_HOME/laser/logs/laser-YYYY-MM-DD.log | Rolling daily debug log. Written for every invocation, including --silent and --quiet runs. |
Override the log verbosity with LD_LOG_FILE (file output) or LD_LOG (stderr). Both accept standard tracing directives, for example LD_LOG_FILE=trace.
Contexts
A context bundles an optional tenant_id together with a keyring binding for an API key. Multiple contexts let you switch between tenants without re-entering credentials:
laser context create prod
laser context list
laser context switch prod # alias: laser ctx use prod
laser context current
laser context show prod
laser context set tenant_id 615380456123456789
laser context rename prod prod-eu
laser context delete prod-euOverride the active context for a single invocation with --context NAME or LD_CONTEXT=NAME.
Output Formats
Pick with -o / --output:
| Format | Default for | Notes |
|---|---|---|
table | TTY | Aligned ASCII table. Colored unless NO_COLOR is set or --no-color is passed. |
json | Pipe / non-TTY | Machine-readable. Stable schema. |
yaml | - | YAML 1.2. |
name | - | IDs and names only. Useful in xargs pipelines. |
Auto-detection: table on a TTY, json when piped. Override per call with -o.
Global Flags
| Flag | Env | Purpose |
|---|---|---|
--context NAME | LD_CONTEXT | Use a specific named context for this invocation. |
--api-key KEY | LD_API_KEY | Override the context API key. |
-o, --output FORMAT | - | table, json, yaml, or name. |
--no-color | NO_COLOR | Disable colored output. |
-q, --quiet | - | Suppress non-essential output. |
--debug | - | Enable debug logging to stderr. |
--silent | - | Suppress success output entirely. Errors still go to stderr; exit code preserved. |
--interactive | - | Run the verb inside the TUI dashboard with rendered output. |
--config PATH | - | Use an alternate config file. |
--yes | - | Skip confirmation prompts for destructive operations. |
--generate SHELL | - | Print shell completion script (bash, zsh, fish, powershell, elvish) and exit. |
Quick Start
# install + login
curl -fsSL https://cli.laserdata.cloud/install.sh | sh
laser auth login --tenant-id <numeric-id>
# explore your tenant
laser tenant get
laser tenant structure -o json
# launch the dashboard
laser tui
# spin up a starter deployment (AWS or GCP)
laser deployment create-starter --cloud aws --region us-east-1
laser deployment create-starter --cloud gcp --region us-central1
# follow it to ready
laser deployment watch --deployment-id <id>