Docs
CLI

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

Terminal
npm install -g @silos/cli

Once installed, the silos command is on your PATH:

Terminal
silos --version

The CLI is part of the open Silos workspace and can be built with Cargo:

Terminal
cargo install --path crates/silos-cli

This 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:

Terminal
silos auth login

You can confirm who you're acting as at any time:

Terminal
silos auth whoami

See Auth & config for managing API keys and switching between accounts.

Command groups

Global flags

These flags apply to every command:

FlagEnvironment variableDefaultDescription
--api-url <url>SILOS_API_URLhttps://api.silos.shThe Silos API endpoint to target.
--api-key <key>SILOS_API_KEYAPI key for authentication. Overrides stored credentials.
--format <format>tableOutput format. Use json for machine-readable output in scripts.

For example, to get JSON output and pass a key explicitly:

Terminal
silos --format json --api-key "$SILOS_API_KEY" db list

Setting 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:

Terminal
# 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-app

The global command group and its replica features are rolling out — see Global databases for current status.

On this page