CLI Install

This section describes how to install the SerenDB CLI and connect via web authentication or API key.

<Tabs labels={["macOS", "Windows", "Linux"]}>

Install with Homebrew

brew install neonctl

Install via npm

npm i -g neonctl

Requires Node.js 18.0 or higher.

Install with bun

bun install -g neonctl

macOS binary

Download the binary. No installation required.

curl -sL https://github.com/serenorg/neonctl/releases/latest/download/neonctl-macos -o neonctl

Run the CLI from the download directory:

neon <command> [options]

Install via npm

npm i -g neonctl

Requires Node.js 18.0 or higher.

Install with bun

bun install -g neonctl

Windows binary

Download the binary. No installation required.

curl -sL -O https://github.com/serenorg/neonctl/releases/latest/download/neonctl-win.exe

Run the CLI from the download directory:

neonctl-win.exe <command> [options]

Install via npm

npm i -g neonctl

Install with bun

bun install -g neonctl

Linux 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 neonctl

ARM64:

 curl -sL https://github.com/serenorg/neonctl/releases/latest/download/neonctl-linux-arm64 -o neonctl

Run the CLI from the download directory:

neon <command> [options]

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>

Upgrade

When a new version is released, you can update your SerenDB CLI using the methods described below, depending on how you installed the CLI initially. To check for the latest version, refer to the Releases information on the SerenDB CLI GitHub repository page. To check your installed version of the SerenDB CLI, run the following command:

neon --version

<Tabs labels={["npm", "Homebrew", "Binary"]}>

To upgrade the SerenDB CLI via npm:

npm update -g neonctl

To upgrade the SerenDB CLI with Homebrew:

brew upgrade neonctl

To upgrade a binary version, download the latest binary as described in the install instructions above, and replace your old binary with the new one.

If you're using the SerenDB CLI in CI/CD tools like GitHub Actions, you can safely pin the SerenDB CLI to latest, as we prioritize stability for CI/CD processes.

<Tabs labels={["npm", "Homebrew", "Binary"]}>

In your GitHub Actions workflow, you can use the latest tag with npm:

- name: Install SerenDB CLI
  run: npm install -g neonctl@latest

Homebrew automatically fetches the latest version when running the install or upgrade command. You can include the following in your workflow:

- name: Install SerenDB CLI
  run: brew install neonctl || brew upgrade neonctl

If you're downloading a binary, reference the latest release from the Releases page. For example, you can use curl or wget in your workflow:

- name: Install SerenDB CLI
  run: |
    curl -L https://github.com/serenorg/neonctl/releases/latest/download/neonctl-linux-amd64 -o /usr/local/bin/neon
    chmod +x /usr/local/bin/neon

Connect

The SerenDB CLI supports connecting via web authentication or API key.

Web authentication

Run the following command to connect to SerenDB via web authentication:

neon auth

The neon auth command launches a browser window where you can authorize the SerenDB CLI to access your SerenDB account. If you have not authenticated previously, running a SerenDB CLI command automatically launches the web authentication process unless you have specified an API key.

If you use SerenDB through the [Vercel-Managed Integration](/docs/guides/vercel-managed-integration), you must authenticate connections from the CLI client using a SerenDB API key (see below). The `neon auth` command requires an account registered through SerenDB rather than Vercel.

API key

To authenticate with a SerenDB API key, you can specify the --api-key option when running a SerenDB CLI command. For example, the following neon projects list command authenticates to SerenDB using the --api-key option:

neon projects list --api-key <neon_api_key>

To avoid including the --api-key option with each CLI command, you can export your API key to the NEON_API_KEY environment variable.

export NEON_API_KEY=<neon_api_key>

For information about obtaining an SerenDB API key, see Create an API key.

Configure autocompletion

The SerenDB CLI supports autocompletion, which you can configure in a few easy steps. See SerenDB CLI commands — completion for instructions.

Last updated