The Nearbase CLI lets you list and inspect your databases without leaving the terminal — thinkDocumentation Index
Fetch the complete documentation index at: https://docs.nearbase.dev/llms.txt
Use this file to discover all available pages before exploring further.
nvidia-smi, but for Postgres.
Install
@nearbase/cli.
Quick start
Log in
nearbase login runs an OAuth-style device flow. The CLI prints a short
code and opens console.nearbase.dev in your
browser. Sign in and approve the displayed code — the CLI receives a
long-lived token and stores it locally.List your databases
nearbase (or nearbase ls) prints a table of every instance across every
Clerk organization you belong to.Commands
| Command | What it does |
|---|---|
nearbase login | Authenticate via your browser (device flow). |
nearbase logout | Forget the stored credentials on this machine. |
nearbase ls | List every database across your organizations. The default action. |
nearbase ls --json | Emit the same listing as JSON. |
nearbase --help | Show all commands and flags. |
nearbase --version | Print the installed CLI version. |
Example
Authentication
nearbase login uses an OAuth-style device flow:
- The CLI requests a one-time
device_codeand shortuser_codefrom the Nearbase API. - Your browser opens to the console, where you sign in with Clerk and approve the displayed code.
- The CLI exchanges the device code for a long-lived access token (90 days) and stores it on disk.
~/.config/nearbase/auth.json with file mode 0600 on Unix. To revoke access on a machine, run nearbase logout.
Tokens are scoped to your Clerk user and inherit the org memberships you have
at the moment each request is made. Removing a user from an org takes effect
on their next CLI command.
Configuration
| Variable | Default | Description |
|---|---|---|
NEARBASE_API_URL | https://nearbase.up.railway.app | Override the API endpoint (used for staging or dev). |
Troubleshooting
Not logged in. Run nearbase login first.— Runnearbase login.Session expired or invalid.— Tokens are valid for 90 days; runnearbase loginagain.- Browser didn’t open. — Open the verification URL printed in the terminal manually.