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.
The auth command
Authenticates the user or caller to Neon.
Usage
neonctl authThe 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.
/home/<home>/.config/neonctl/credentials.jsonAn 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-keyoption is provided, it is used for authentication. - If the
--api-keyoption is not provided, theNEON_API_KEYenvironment variable setting is used. - If there is no
--api-keyoption orNEON_API_KEYenvironment variable setting, the CLI looks for thecredentials.jsonfile created by theneonctl authcommand. - If the credentials file is not found, the Neon CLI initiates the
neonctl authweb 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