This article follows the official documentation. We haven’t tested this tool for a hands-on review.
A coding agent that can run shell commands can use Snowflake CLI to query and manage resources in Snowflake. For example, it can ask Snowflake to list Git repositories stored in an account, then list the files in one repository. These commands read repository information from Snowflake, not from a local copy.
Snowflake CLI is a terminal tool for working with Snowflake, including SQL and stages. It also supports Snowpark and Streamlit apps, along with object management. It is separate from Snowflake CoCo, Snowflake’s coding agent. The commands below show how an agent that runs shell commands can inspect Snowflake without changing its objects.
Install and connect
Install Snowflake CLI using the method for your operating system in the official installation instructions. One documented installation route uses Python’s package installer:
pip install snowflake-cli
Add a Snowflake connection using the CLI’s connection setup command, then test it:
snow connection add
snow connection test
Connection setup stores the account details and authentication settings the CLI uses. Configure credentials through the CLI or an approved credential provider; do not include passwords, tokens, or private keys in an agent prompt. Snowflake’s CLI documentation describes connections and authentication options.
List repositories and files
A concrete agent task is to find a repository in Snowflake and report its tracked file names. First, list the repositories visible to the configured connection:
snow git list
The command asks Snowflake for the repositories available to the connection and prints the results. To inspect one repository, pass its name to list-files:
snow git list-files <repository_name>
Replace <repository_name> with a name returned by the first command. The angle brackets mark a placeholder; do not type them as part of the actual name. Snowflake documents snow git list and snow git list-files, including their command syntax. The second command lists the file names recorded for that repository in Snowflake. It does not fetch file contents or change the repository.
Use the --format option to choose an output format. For example, request JSON when an agent needs to parse the results:
snow --format JSON git list
If your installed CLI lists different options, check the command’s help:
snow git list --help
These commands read information about Snowflake objects but do not change them. The connection must use a Snowflake role, an access-control identity, that has permission to view the repository.
A suitable agent prompt is: “Use Snowflake CLI to list the Git repositories available to the configured connection. For the repository named <repository_name>, list its files and summarize the paths. Do not change any Snowflake objects.” The agent should treat the returned name as a placeholder to replace with an actual result, not as a literal repository name.
Keep the two CLI tools distinct
Snowflake CoCo was formerly called Cortex Code. Its local terminal client uses the cortex code command, while Snowflake CLI uses the snow command. Snowflake describes CoCo as a coding agent available in Snowflake interfaces and as a CLI for local development and automation on its CoCo product page. The names and purposes overlap, but the repository-listing example above uses Snowflake CLI, not CoCo.
This distinction matters when configuring a shell-enabled agent: installing Snowflake CLI provides the snow commands, while using CoCo’s coding-agent features requires its separate client or hosted service.