Snowflake CLI

Automate Snowflake CLI operations for SQL execution, app deployment, and stage management.

34|13|Updated Feb 1, 2022
One-click install
npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill snowflake-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Snowflake CLI
Source: https://github.com/sfc-gh-dflippo/snowflake-dbt-demo/tree/main/.claude/skills/snowflake-cli
Command: npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill snowflake-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires snowflake-cli, and includes references (resource) components.

What problem does it solve?

Manually interacting with Snowflake, running ad-hoc SQL, deploying applications, or managing objects can be repetitive and inefficient, especially in automated workflows. This skill empowers users to automate a wide range of Snowflake operations directly from the command line.

Core Features & Use Cases

  • SQL Execution & Templating: Run SQL queries and scripts with powerful client-side templating using Jinja or standard syntax.
  • Application Deployment: Deploy Streamlit applications and Snowpark UDFs/procedures directly from your local environment or CI/CD.
  • Object & Stage Management: Create, list, describe Snowflake objects and manage files on internal stages with ease.
  • Use Case: Automate a daily data pipeline by writing a shell script that uses snow sql to execute a series of SQL transformations, snow stage copy to upload new data files, and snow snowpark deploy to update a Python stored procedure, all without manual intervention.

Quick Start

Execute an inline SQL query

snow sql -q "SELECT CURRENT_VERSION()" -c default

Run a SQL script from a file

snow sql -f my_script.sql -c default

Deploy a Streamlit application

snow streamlit deploy --replace -c default

Frequently Asked Questions about Snowflake CLI

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate SQL execution and deployments in Snowflake from the command line?

Automate SQL execution and deployments using the Snowflake CLI to run queries, deploy Streamlit apps, and manage Snowpark procedures without manual intervention. The `snow sql` command executes scripts, `snow streamlit deploy` pushes applications, and `snow snowpark deploy` updates stored procedures—all scriptable for CI/CD workflows.

Can I use templating and variable substitution with Snowflake CLI commands?

Yes, Snowflake CLI supports client-side templating with Jinja and standard syntax for variable substitution in SQL scripts and deployment configurations. This enables dynamic query generation and environment-specific configuration across multi-environment deployments without hardcoding values.

What Snowflake objects and operations can I manage from the terminal?

Manage Snowflake objects by creating, listing, and describing databases, schemas, tables, and other resources directly from the CLI. Stage operations let you upload, download, and organize files on internal stages using `snow stage copy` and related commands for streamlined data pipeline automation.

How do I integrate Snowflake CLI into CI/CD pipelines for multi-environment deployments?

Integrate Snowflake CLI into CI/CD by writing shell scripts that chain `snow sql`, `snow stage copy`, and deployment commands with environment-specific variables. This automates data transformations, file uploads, and application updates across development, staging, and production environments in a single workflow.

Does Snowflake CLI support Snowpark procedure deployment and execution?

Yes, Snowflake CLI supports executing and deploying Snowpark Python UDFs and stored procedures using `snow snowpark deploy`. This enables automation of complex data processing logic written in Python directly from your terminal or deployment pipeline.

What's the best way to structure shell scripts that automate repetitive Snowflake tasks?

Structure automation scripts by combining Snowflake CLI commands in sequence—execute SQL with `snow sql -f`, copy staged files with `snow stage copy`, and deploy applications with `snow streamlit deploy` or `snow snowpark deploy`. Use shell variables for configuration and environment switching to keep scripts reusable across contexts.