Neon CLI commands — auth
Use the Neon CLI to manage Neon directly from the terminal
Before you begin
Before running the auth
command, ensure that you have installed the Neon CLI.
auth
command
The Authenticates the user or caller to Neon.
Usage
The command launches a browser window where you can authorize the Neon CLI to access your Neon account. After granting permissions to the Neon CLI, your credentials are saved locally to a configuration file named credentials.json
, enabling you manage your account's projects from the command line.
An alternative to authenticating using neon auth
is to provide an API key when running a CLI command. You can do this using the global --api-key
option or by setting the NEON_API_KEY
variable. See Global options for instructions.
info
The authentication flow for the Neon CLI follows this order:
- If the
--api-key
option is provided, it is used for authentication. - If the
--api-key
option is not provided, theNEON_API_KEY
environment variable setting is used. - If there is no
--api-key
option orNEON_API_KEY
environment variable setting, the CLI looks for thecredentials.json
file created by theneonctl auth
command. - If the credentials file is not found, the Neon CLI initiates the
neonctl auth
web authentication process.
Options
Only global options apply.
Need help?
Join our Discord Server to ask questions or see what others are doing with Neon. Users on paid plans can open a support ticket from the console. For more detail, see Getting Support.
Last updated on