Neon is expanding into a backend: Object Storage, Functions, and AI Gateway now in beta
/APIs & SDKs/Setup and context/auth

Neon CLI command: auth

Authenticate to Neon via browser or API key and manage credentials

The auth command authenticates you to Neon. neon login is an alias for neon auth.

Usage

neon auth [options]

The command launches a browser window where you authorize the Neon CLI to access your Neon account. Your credentials are then saved locally to credentials.json:

Output
/home/<home>/.config/neonctl/credentials.json

note

If you use Neon through the Vercel-Managed Integration, authenticate with a Neon API key instead (see below). The neon auth command requires an account registered through Neon rather than Vercel.

Instead of running neon auth, you can provide an API key with the global --api-key option or the NEON_API_KEY environment variable. See Global options.

info

The Neon CLI resolves authentication in this order:

  • The --api-key option, if provided.
  • The NEON_API_KEY environment variable, if set.
  • The credentials.json file created by neon auth.
  • If none are found, the CLI starts the neon auth web authentication flow.

Options

Takes only the global options.

Was this page helpful?
Edit on GitHub

On this page

Copy neon init command