Registry / database / snowflake-cli

snowflake-cli

JSON →
library3.16.0pypypiunverified

Snowflake CLI is an open-source command-line interface designed for developers building applications and managing workloads on Snowflake. It supports tasks across Streamlit in Snowflake, the Snowflake Native App Framework, Snowpark Container Services, and general SQL operations. The library maintains an active development pace with frequent, often monthly or bi-monthly, releases and major version updates introducing significant behavior changes.

pip install snowflake-cli
INSTALL
IMPORT
SIG · SNOWFLAKE-CLI
S
snowflake-cli
databasepythonv3.16.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to install Snowflake CLI, configure a new connection, and execute a basic SQL query. It also shows how to initialize a project from a template. For authentication, it relies on environment variables or an interactively configured `config.toml` file.

# 1. Install Snowflake CLI (if not already installed) # pip install snowflake-cli # 2. Add a new connection interactively # This command will prompt you for connection details like account, user, warehouse, etc. # For non-interactive use, consider environment variables (SNOWFLAKE_ACCOUNT, SNOWFLAKE_USER, SNOWFLAKE_PASSWORD) or a pre-configured config.toml file. print('Run "snow connection add" and follow the prompts to set up a connection.') print('Example prompts: \n Connection name: my_snowflake_conn\n Account: <your_account_identifier>\n User: <your_username>\n Password: <your_password>') # Simulate environment variables for a non-interactive quickstart (replace with actual values) import os os.environ['SNOWFLAKE_ACCOUNT'] = os.environ.get('SNOWFLAKE_ACCOUNT', 'your_account_identifier') os.environ['SNOWFLAKE_USER'] = os.environ.get('SNOWFLAKE_USER', 'your_username') os.environ['SNOWFLAKE_PASSWORD'] = os.environ.get('SNOWFLAKE_PASSWORD', 'your_password') # 3. Execute a simple SQL query using the configured connection # Assuming a default connection 'my_snowflake_conn' has been set up print('\nExecuting a simple SQL query:') # Use --connection to explicitly specify the connection name # For simplicity, if one connection is default, it might not be needed. # In a real script, consider using `snow connection set-default my_snowflake_conn` first, or pass --connection. import subprocess result = subprocess.run(['snow', 'sql', '--query', 'SELECT CURRENT_VERSION()', '--connection', 'my_snowflake_conn'], capture_output=True, text=True) print(result.stdout) if result.stderr: print(f"Error: {result.stderr}") # 4. Initialize a new Streamlit in Snowflake project # print('\nInitializing a Streamlit project:') # subprocess.run(['snow', 'init', '--template', 'streamlit-python', 'my_streamlit_app_project'], check=True) # print('Streamlit project "my_streamlit_app_project" created.')
snow --version
Debug
Known issues
breakingSnowflake CLI dropped support for Python versions below 3.10 starting with version 3.0.0. Ensure your Python environment is 3.10 or newer.
fix
Upgrade your Python environment to version 3.10 or higher.
affects: >=3.0.0
breakingSeveral commands were renamed or consolidated in version 3.0.0. For instance, 'snow object stage' commands were replaced by 'snow stage' commands, and 'snow snowpark init'/'snow streamlit init' were replaced by 'snow init'.
fix
Update existing scripts and workflows to use the new command syntax. Refer to the official release notes for a complete list of changes.
affects: >=3.0.0
deprecatedSnowflake CLI is the recommended modern command-line tool, replacing the legacy SnowSQL client. While SnowSQL is still available, new features and enhancements are exclusively added to Snowflake CLI.
fix
Transition from SnowSQL to Snowflake CLI. The `snow helpers import-snowsql-connections` command can assist in migrating existing SnowSQL connection configurations.
affects: All (transition recommended)
gotchaOn MacOS and Linux systems, the `config.toml` file (default location: `~/.config/snowflake/config.toml` or `~/.snowflake/config.toml`) requires specific file permissions (read and write for the file owner only) for security. Incorrect permissions can lead to connection issues.
fix
Set the correct file permissions using `chown $USER config.toml` and `chmod 0600 config.toml`.
affects: All
Errors
Common errors & fixes
snowflake: command not found
The `snowflake` executable is not installed or not available in your system's PATH.
fix
Install the CLI using `pipx install snowflake-cli` (recommended) or `pip install snowflake-cli`, and ensure your shell's PATH includes the directory where pipx/pip installs executables (often `~/.local/bin`).
Error: Could not connect to Snowflake. Please check your connection details.
The Snowflake CLI failed to establish a connection to your Snowflake account, usually due to incorrect account identifier, username, password, key pair path, or an invalid connection profile.
fix
Verify your connection details in your `~/.snowflake/config.toml` file, environment variables, or by explicitly providing them via command-line arguments (e.g., `--connection <name>`, `--account <account_id>`).
Error: No such command 'apps'
The command or subcommand specified (`apps` in this example) does not exist or is misspelled. The correct subcommand for native apps is `native-app`.
fix
Consult the `snowflake --help` and `snowflake <subcommand> --help` outputs to find the correct command name and its subcommands (e.g., `snowflake native-app init`, `snowflake streamlit deploy`).
Error: An active connection is not set.
The command requires an active Snowflake connection, but no default connection has been configured or specified for the current session.
fix
Set a default connection using `snowflake connection set <connection_name>` or specify the connection for the command using the `--connection <connection_name>` flag.
Upgrade
Version history
3.16.0latest on PyPI · released Mar 19, 2026
Audit
Dependencies
snowflake-connector-pythonrequiredCore dependency for connecting to Snowflake; frequently updated with CLI releases.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources