npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cli4ai/snowflake

v1.0.9

Published

Snowflake read-only queries

Readme

@cli4ai/snowflake

Official @cli4ai package • https://cli4ai.com • Install cli4ai: npm i -g cli4ai

Snowflake explorer with read-only SQL (blocks writes by default).

Setup

npm i -g cli4ai
cli4ai add -g snowflake

Create ~/.snowflake/connections.toml (required). Example:

[dev]
account = "xy12345.us-east-1"
user = "YOUR_USER"
password = "YOUR_PASSWORD"
warehouse = "COMPUTE_WH"
role = "SYSADMIN"
database = "MY_DB"
schema = "PUBLIC"

Then verify:

cli4ai run snowflake connections

Commands

cli4ai run snowflake connections
cli4ai run snowflake warehouses <conn>
cli4ai run snowflake databases <conn>
cli4ai run snowflake schemas <conn> [database]
cli4ai run snowflake tables <conn> [database] [schema]
cli4ai run snowflake views <conn> [database] [schema]
cli4ai run snowflake columns <conn> <table>
cli4ai run snowflake ddl <conn> <table>
cli4ai run snowflake sample <conn> <table> [limit]
cli4ai run snowflake count <conn> <table>
cli4ai run snowflake query <conn> <sql>
cli4ai run snowflake context <conn>
cli4ai run snowflake stages <conn>
cli4ai run snowflake formats <conn>
cli4ai run snowflake functions <conn>
cli4ai run snowflake procedures <conn>
cli4ai run snowflake tasks <conn>
cli4ai run snowflake streams <conn>
cli4ai run snowflake search <conn> <pattern>

Security

Credentials

Store your ~/.snowflake/connections.toml file with restricted permissions:

chmod 600 ~/.snowflake/connections.toml

Consider using Snowflake key-pair authentication instead of passwords for production use. See Snowflake Key-Pair Authentication.

Read-Only Enforcement

This tool blocks destructive SQL commands (INSERT, UPDATE, DELETE, DROP, etc.) at the application layer. However, this is defense-in-depth only.

Best practice: Use a role with minimal privileges for maximum protection. Snowflake allows creating roles with restricted privileges:

CREATE ROLE readonly_role;
GRANT USAGE ON WAREHOUSE MY_WH TO ROLE readonly_role;
GRANT USAGE ON DATABASE MY_DB TO ROLE readonly_role;
GRANT USAGE ON ALL SCHEMAS IN DATABASE MY_DB TO ROLE readonly_role;
GRANT SELECT ON ALL TABLES IN DATABASE MY_DB TO ROLE readonly_role;
GRANT SELECT ON FUTURE TABLES IN DATABASE MY_DB TO ROLE readonly_role;

The application-layer filtering may have edge cases (e.g., stored procedures, unusual syntax). Database-level permissions are the authoritative security boundary.