Use the Neon CLI to manage Neon directly from the terminal
The Neon CLI is a command-line interface that lets you manage Neon directly from the terminal. This documentation references all commands and options available in the Neon CLI.
For installation instructions, see Neon CLI — Install and connect.
|me||Show current user|
|connection-string||Get connection string|
|completion||Generate a completion script|
Global options are supported with any Neon CLI command.
|-o, --output||Set the Neon CLI output format (||string||table|
|--config-dir||Path to the Neon CLI configuration directory||string|
|--api-key||Neon API key||string|
|-v, --version||Show the Neon CLI version number||boolean||-|
|-h, --help||Show the Neon CLI help||boolean||-|
Sets the output format. Supported options are
table. The default is
table. Table output may be limited. The
yamloutput formats show all data.
Specifies the path to the
neonctlconfiguration directory. To view the default configuration directory containing you
neonctl --help. The credentials file is created when you authenticate using the
neonctl authcommand. This option is only necessary if you move your
neonctlconfiguration file to a location other than the default.
Specifies your Neon API key. You can authenticate using a Neon API key when running a Neon CLI command instead of using
neonctl auth. For information about obtaining an Neon API key, see Create an API key.
To avoid including the
--api-keyoption with each CLI command, you can export your API key to the
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, the
NEON_API_KEYenvironment variable setting is used.
- If there is no
NEON_API_KEYenvironment variable setting, the CLI looks for the
credentials.jsonfile created by the
- If the credentials file is not found, the Neon CLI initiates the
neonctl authweb authentication process.
- If the
Analytics are enabled by default to gather information about the CLI commands and options that are used by our customers. This data collection assists in offering support, and allows for a better understanding of typical usage patterns so that we can improve user experience. Neon does not collect user-defined data, such as project IDs or command payloads. To opt-out of analytics data collection, specify
Shows the Neon CLI version number.
neonctlcommand-line help. You can view help for
neonctlcommand, or a
neonctlsubcommand, as shown in the following examples:
The GitHub repository for the Neon CLI is found here.