SerenDB CLI
The SerenDB CLI is a command-line interface that lets you manage SerenDB directly from the terminal. This documentation references all commands and options available in the SerenDB CLI.
🚀 Get set up in just a few steps with the CLI Quickstart.
Install
<Tabs labels={["macOS", "Windows", "Linux"]}>
Install with Homebrew
brew install neonctlInstall via npm
npm i -g neonctlRequires Node.js 18.0 or higher.
Install with bun
bun install -g neonctlmacOS binary
Download the binary. No installation required.
curl -sL https://github.com/serenorg/neonctl/releases/latest/download/neonctl-macos -o neonctlRun the CLI from the download directory:
neon <command> [options]Install via npm
npm i -g neonctlInstall with bun
bun install -g neonctlRequires Node.js 18.0 or higher.
Windows binary
Download the binary. No installation required.
curl -sL -O https://github.com/serenorg/neonctl/releases/latest/download/neonctl-win.exeRun the CLI from the download directory:
neonctl-win.exe <command> [options]Install via npm
npm i -g neonctlInstall with bun
bun install -g neonctlLinux binary
Download the x64 or ARM64 binary, depending on your processor type. No installation required.
x64:
curl -sL https://github.com/serenorg/neonctl/releases/latest/download/neonctl-linux-x64 -o neonctlARM64:
curl -sL https://github.com/serenorg/neonctl/releases/latest/download/neonctl-linux-arm64 -o neonctlRun the CLI from the download directory:
neon <command> [options]For more about installing, upgrading, and connecting, see SerenDB CLI — Install and connect.
You can run the SerenDB CLI without installing it using **npx** (Node Package eXecute) or the `bun` equivalent, **bunx**. For example:
# npx
npx neonctl <command>
# bunx
bunx neonctl <command>Synopsis
neon --help
usage: neon <command> [options] [aliases: neonctl]
Commands:
neon auth Authenticate [aliases: login]
neon me Show current user
neon orgs Manage organizations [aliases: org]
neon projects Manage projects [aliases: project]
neon ip-allow Manage IP Allow
neon vpc Manage VPC endpoints and project VPC restrictions
neon branches Manage branches [aliases: branch]
neon databases Manage databases [aliases: database, db]
neon roles Manage roles [aliases: role]
neon operations Manage operations [aliases: operation]
neon connection-string [branch] Get connection string [aliases: cs]
neon set-context Set the current context
neon completion generate completion script
Global options:
-o, --output Set output format
[string] [choices: "json", "yaml", "table"] [default: "table"]
--config-dir Path to config directory [string] [default: ""]
--api-key API key [string] [default: ""]
--analytics Manage analytics. Example: --no-analytics, --analytics false
[boolean] [default: true]
-v, --version Show version number [boolean]
-h, --help Show help [boolean]
Options:
--context-file Context file [string] [default: (current-context-file)]Commands
list, create, reset, restore, rename, schema-diff, set-default, add-compute, delete, get
Manage branches
Global options
Global options are supported with any SerenDB CLI command.
-o, --outputSets the output format. Supported options are
json,yaml, andtable. The default istable. Table output may be limited. Thejsonandyamloutput formats show all data.neon me --output json--config-dirSpecifies the path to the
neonctlconfiguration directory. To view the default configuration directory containing youcredentials.jsonfile, runneon --help. The credentials file is created when you authenticate using theneon authcommand. This option is only necessary if you move yourneonctlconfiguration file to a location other than the default.neon projects list --config-dir /home/<user>/.config/neonctl--api-keySpecifies your SerenDB API key. You can authenticate using a SerenDB API key when running a SerenDB CLI command instead of using
neon auth. For information about obtaining an SerenDB API key, see Create an API key.neon <command> --api-key <neon_api_key>To avoid including the
--api-keyoption with each CLI command, you can export your API key to theNEON_API_KEYenvironment variable.export NEON_API_KEY=<neon_api_key>The authentication flow for the SerenDB CLI follows this order:
If the
--api-keyoption is provided, it takes precedence and is used for authentication.If the
--api-keyoption is not provided, theNEON_API_KEYenvironment variable is used if it is set.If both
--api-keyoption andNEON_API_KEYenvironment variable are not provided or set, the CLI falls back to thecredentials.jsonfile created by theneon authcommand.If the credentials file is not found, the SerenDB CLI initiates the
neon authweb authentication process.
--colorColorize the output. This option is enabled by default, but you can disable it by specifying
--no-coloror--color false, which is useful when using SerenDB CLI commands in your automation pipelines.--analyticsAnalytics are enabled by default to gather information about the CLI commands and options that are used by our customers. This data collection assists in offering support, and allows for a better understanding of typical usage patterns so that we can improve user experience. SerenDB does not collect user-defined data, such as project IDs or command payloads. To opt-out of analytics data collection, specify
--no-analyticsor--analytics false.-v, --versionShows the SerenDB CLI version number.
$ neon --version 1.15.0-h, --helpShows the
neoncommand-line help. You can view help forneon, aneoncommand, or aneonsubcommand, as shown in the following examples:neon --help neon branches --help neon branches create --help
Options
--context-fileSets a background context for your CLI sessions, letting you perform organization, project, or branch-specific actions without having to specify the relevant id in every command. For example, this command lists all branches using the
branches listcommand. No need to specify the project since the context file provides it.neon branches list --context-file path/to/context_file_nameTo define a context file, see SerenDB CLI commands — set-context.
GitHub repository
The GitHub repository for the SerenDB CLI is found here.
Last updated