Installing Snowflake CLI¶
This topic explains how to install Snowflake CLI on supported platforms. Note that Snowflake CLI is not currently available for AIX systems.
Snowflake recommends using binary installation methods, such as package managers, to install Snowflake CLI on your system. You can download the binary installers from the official Snowflake CLI repository.
Requirements¶
Before using Snowflake CLI, you must have a valid Snowflake account.
To run Streamlit in Snowflake using Snowflake CLI, you must have a Snowflake account with permission to use Streamlit.
To run Snowpark Container Services in Snowflake using Snowflake CLI, you must have a Snowflake account with privileges to use Snowpark Container Services.
Tip
If your Snowflake account requires MFA (multi-factor authentication), Snowflake CLI requires approval for every command. You can use MFA caching to require authentication only once every four hours. For more information, see Use multi-factor authentication (MFA).
Install Snowflake CLI using package managers¶
To install Snowflake CLI using platform-specific package managers, use one of the following procedures:
Install with Linux package managers¶
If you use a Linux operating system, you can install Snowflake CLI with package managers that support the following:
debpackages,rpmpackages.
To install Snowflake CLI using the deb package manager:
Download the Snowflake CLI
debfrom the Snowflake CLI repository.Install the package by running the following command:
To install Snowflake CLI using the rpm package manager:
Download the Snowflake CLI
rpmpackage from the Snowflake CLI repository.Install the package by running the following command:
To verify that the software was installed successfully, run the following command:
Install with the MacOS package installer¶
To install Snowflake CLI on MacOS, do the following:
Download the Snowflake CLI installer from the Snowflake CLI repository.
Run the installer and follow the instructions to install Snowflake CLI.
To verify that the software was installed successfully, open new terminal and run the following command:
Install with the Windows installer¶
To install Snowflake CLI on Windows, do the following:
Download the Snowflake CLI installer from the Snowflake CLI repository.
Run the installer and follow the instructions to install Snowflake CLI.
To verify that the software was installed successfully, open new terminal and run the following command:
Install with Homebrew¶
If you use a Mac operating system, you can install Snowflake CLI with Homebrew (https://brew.sh/).
Install Homebrew (https://brew.sh/), if necessary.
To give Homebrew access to the Snowflake CLI repository, run the following command:
To install Snowflake CLI, run the following command:
To verify that the software was installed successfully, run the following command:
Advanced local installations¶
You can also install Snowflake CLI as a Python package using either of the following:
Snowflake recommends installing as a Python package only for development purposes or when installing binaries isn’t possible in your environment.
Install with pip (PyPi)¶
Note
This method modifies the Python environment where you install Snowflake CLI. Consider using pipx instead to avoid dependency conflicts.
To install Snowflake CLI using pip, you must have Python (https://python.org) version 3.10 or later installed.
Run the following shell command:
To verify that the software was installed successfully, run the following command:
Install with pipx¶
pipx (https://github.com/pypa/pipx) provides an alternative to pip that installs and executes Python packages into isolated virtual environments. Installing Snowflake CLI with pipx does not, therefore, modify your current Python environment.
To install Snowflake CLI using pipx, you must have pipx (https://github.com/pypa/pipx) installed.
Run the following shell command:
To verify that the software was installed successfully, run the following command:
Installing Snowflake CLI in FIPS-compliant environments¶
You can use a Docker image to install Snowflake CLI in an environment that is compliant with FIPS (Federal Information Processing Standards).
Prerequisites¶
Before installing Snowflake CLI in a FIPS-compliant environment, ensure that you meet the following prerequisites:
FIPS-compliant Python: Python must be preinstalled, built, and configured for FIPS compliance. This typically means Python is linked against a FIPS-enabled OpenSSL library.
FIPS-enabled OpenSSL: The system’s OpenSSL libraries must be FIPS-compliant and available to Python at runtime.
Build tools: Standard build tools (such as a C compiler and Python development headers) must be available, as dependencies will be built from source.
Network Access: The environment must allow access to PyPI or your internal package index for downloading source distributions.
Install Snowflake CLI in a FIPS-compliant Dockerfile¶
To install Snowflake CLI in a FIPS-compliant environment, follow these steps:
Create a Python virtual environment in the container, as shown in the following example:
Activate the Python virtual environment in the container, as shown in the following example:
Upgrade
pipandsetuptoolsin the container, as shown in the following example:Install the cryptography, Python connector, and Snowflake CLI dependencies from source in the container, as shown in the following example. Note that all dependencies must be installed from source to ensure they are built against your FIPS-compliant libraries.
The
--no-binaryoption forces installation from source, ensuring that the builds use FIPS-ready libraries.
Validate the Docker image¶
To confirm that your Python environment uses a FIPS-enabled OpenSSL library, enter the following command in the running container:
After installing Snowflake CLI and validating the Docker image, you can use Snowflake CLI in the container.
where <your-command> is any valid Snowflake CLI command, such as snow --help.
Install command auto-completion functionality¶
Snowflake CLI supports standard shell tab completion functionality.
To install auto-completion into Snowflake CLI, perform the following steps:
Run the
snow --install-completioncommand:Run the
snow --show-completioncommand to generate the commands you need to add to your shell profile (.bashrc,.bash_profile,.zshrc, and others):Select and copy the command output text.
Open your shell profile file,
.bashrcin this example, and paste the copied text:Save the file.
To activate the tab-completion functionality, restart your shell or
sourceyour shell profile file, such as:To test the feature, enter a snow command followed by a
TAB, as shown: