CLI Overview
Install the silos CLI and manage databases, branches, SQL, local development, and migrations from your terminal.
The silos CLI is the command-line interface to the Silos platform. It wraps the
same REST API the console uses, so anything you can do in the dashboard you can do
from a terminal or a script — create databases, branch them, run SQL, open a psql
session, manage migrations, and spin up a local PostgreSQL for development.
Install
npm install -g @silos/cliOnce installed, the silos command is on your PATH:
silos --versionThe CLI is part of the open Silos workspace and can be built with Cargo:
cargo install --path crates/silos-cliThis produces a silos binary you can run directly.
Authenticate
Most commands talk to the Silos API and need an API key. Log in once and the CLI stores your credentials locally:
silos auth loginYou can confirm who you're acting as at any time:
silos auth whoamiSee Auth & config for managing API keys and switching between accounts.
Command groups
Databases
Create, list, inspect, suspend, resume, and delete databases; print connection strings.
Branches
Branch a database, list and inspect branches, restore to a point in time.
SQL & connect
Run a one-off query with silos sql, or open an interactive psql session with silos connect.
Local development
Run a local PostgreSQL via silos dev (PGLite) for offline, local-first work.
Global databases
Create globally-replicated databases and manage replica regions.
Migrations
Initialize, generate, apply, and roll back schema migrations with silos silo.
Auth & config
Log in, manage API keys, and configure CLI defaults.
Global flags
These flags apply to every command:
| Flag | Environment variable | Default | Description |
|---|---|---|---|
--api-url <url> | SILOS_API_URL | https://api.silos.sh | The Silos API endpoint to target. |
--api-key <key> | SILOS_API_KEY | — | API key for authentication. Overrides stored credentials. |
--format <format> | — | table | Output format. Use json for machine-readable output in scripts. |
For example, to get JSON output and pass a key explicitly:
silos --format json --api-key "$SILOS_API_KEY" db listSetting SILOS_API_URL and SILOS_API_KEY in your environment (or a .env file in
the working directory) lets you omit the flags. This is handy in CI, where you can
inject a scoped key as a secret.
A first run
Create a database, run a query against it, and print its connection string:
# Create a database in the iad region
silos db create my-app
# Run a query
silos sql my-app "select version();"
# Get a connection string for any Postgres client
silos db connection-string my-appThe global command group and its replica features are rolling out — see
Global databases for current status.