Major update to our Free Plan: now with 1 GB of Postgres storage per project, 100 projects included
/APIs & SDKs/Setup and context/login

Neon CLI command: login

Authenticate to Neon via browser or API key and manage credentials

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

Usage

neon login [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
~/.config/neon/credentials.json

note

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

Instead of running neon login, 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 login.
  • If none are found, the CLI starts the neon login web authentication flow. neon me is the exception: it reports that you're signed out instead.

Options

OptionDescriptionTypeDefaultRequired
--keyringStore the credential in the OS keyring. Per profile; a later login without the flag stays there. See neon profile list.boolean—No

Pass --keyring to store the credential in your operating system's keyring instead of the credentials.json file. The choice is saved per profile, so once set, neon login keeps using the keyring for that profile even without the flag. Along with this option, login accepts the global options.

Was this page helpful?
Edit on GitHub

On this page

Copy neon init command