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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@snippkit/cli

v2.0.3

Published

Official CLI for SnippKit

Downloads

92

Readme

SnippKit CLI (SNiX) v2

Version License Downloads

The official terminal companion for SnippKit.
Manage code snippets, run command playbooks, upload local source files, and execute remote scripts directly from your shell.


🔒 Technical Security Architecture

Credential Storage Mechanism

  • Vault Mechanism: API keys are stored in an application-level AES-256-GCM encrypted vault inside config.json with restricted file permissions (0o600 - User read/write only).
  • Key Derivation: The 256-bit encryption key is derived via crypto.pbkdf2Sync (100,000 iterations, SHA-256) combining the OS username (os.userInfo().username), machine hostname (os.hostname()), and a static vault salt.
  • Access Scope: Credentials are bound to the specific OS user and machine hostname. Copying config.json to another machine invalidates decryption.
  • Legacy Key Migration: Plaintext apiKey entries from legacy installations are automatically encrypted into secureVault on first run and removed from disk.

Execution Security & Trust Model

  • Code Scripts (snix run script <id>): Executed using direct executable invocation with shell: false and discrete argument arrays, avoiding shell interpolation. Isolated in temporary directories (os.tmpdir()) and unlinked upon completion or cancellation (SIGINT/SIGTERM).
  • Command Playbooks (snix run command <id>): Command playbooks execute multi-step shell commands with the user's current terminal permissions. Interactive execution displays a mandatory trust confirmation prompt before running (-y, --yes to bypass non-interactively).

🛡 Safe Deletion & Ambiguity Protection

When deleting items by URL slug or ID, SnippKit enforces strict data loss protection:

  1. Explicit Commands: snix snippets delete id1 id2... and snix commands delete id1 id2... target only their respective resource tables.
  2. Ambiguous Slug Protection: If top-level snix delete <slug> or snix rm <slug> matches both a code snippet and a command playbook:
    • Interactive TTY Mode: Displays metadata cards for both items and prompts the user to select which one to delete.
    • Non-Interactive --yes Mode: Refuses to guess and aborts deletion with an actionable error requiring explicit snippets delete or commands delete.

📖 Canonical Command Reference

1. Authentication

snix auth login            # Authenticate API Key securely
snix auth status           # View session details (Shortcut: snix whoami)
snix auth logout           # Remove local vault credential

2. Snippet Management (snippets)

snix snippets list                 # List snippets with pagination, size, date & visibility
snix snippets show <id>            # Render highlighted source code
snix snippets pull <id>            # Download snippet (saves as title_id.ext)
snix snippets delete <ids...>      # Delete one or more snippets (-y to bypass prompt)

3. Command Playbook Management (commands)

snix commands list                 # List playbooks with pagination, size, date & visibility
snix commands show <id>            # Render ordered playbook shell steps
snix commands pull <id>            # Download playbook (saves as title_id.json)
snix commands delete <ids...>      # Delete one or more playbooks (-y to bypass prompt)

4. Execution Engine (run)

# Canonical Execution Grammar
snix run script <id>                        # Single code script snippet
snix run scripts <id1> <id2>                # Multiple code script snippets
snix run command <id>                       # Single command playbook
snix run commands <id1> <id2>               # Multiple command playbooks

# Smart Auto-Detect Execution
snix run <id>                               # Single item (auto-detects type)
snix run <id1> <id2>                        # Multiple items (auto-detects type)

# Fast Shortcuts
snix script <id1> <id2>                     # Shortcut for snix run scripts
snix cmd <id1> <id2>                        # Shortcut for snix run commands

5. Source Code Upload (push)

# Basic & Bulk Uploads
snix push app.py
snix push main.py utils.js config.json
snix push ./scripts --recursive

# Visibility Control
snix push app.py --public                  # Global batch public
snix push app.py:private index.js:public    # Granular per-file visibility

# Per-File Language, Title & Slug Modifiers
snix push script1.txt:language=python:title="Database Sync":slug=sync-db
snix push file1.txt:public:language=python file2.txt:private:language=json

# Folder Target & Non-Interactive Mode
snix push ./scripts -r --folder "DevOps/Scripts" --yes

Push Override Precedence:

  • Title: Per-File Modifier (:title=...) $\rightarrow$ Global --title $\rightarrow$ Filename without extension
  • Language: Per-File Modifier (:language=python) $\rightarrow$ Global --language $\rightarrow$ Extension Detection $\rightarrow$ Plain Text Fallback
  • Visibility: Per-File Modifier (:public/:private) $\rightarrow$ Global --public/--private $\rightarrow$ Default PRIVATE
  • Custom Slug Validation: If your account subscription plan does not support custom slugs, SNiX warns and seamlessly offers fallback to an auto-generated ID.

💡 Quick Reference Cheat Sheet

| Task | Canonical Command Syntax | | :--- | :--- | | Login | snix auth login | | Check Session | snix whoami | | List Snippets (Paged) | snix snippets list | | Show Snippet | snix snippets show <id> | | Pull Snippet (title_id.ext)| snix snippets pull <id> | | Delete Multiple Snippets| snix snippets delete id1 id2 | | List Playbooks (Paged) | snix commands list | | Show Playbook | snix commands show <id> | | Pull Playbook | snix commands pull <id> | | Delete Multiple Playbooks| snix commands delete id1 id2 | | Run Single Script | snix run script <id> | | Run Multiple Scripts | snix run scripts <id1> <id2> | | Run Single Playbook | snix run command <id> | | Run Multiple Playbooks | snix run commands <id1> <id2> | | Push Single File | snix push app.py | | Push Per-File Modifiers | snix push file1.py:private:title="Core":slug=core-app | | Search Library | snix search "python automation" | | Diagnose System | snix doctor |


📦 Installation

Requires Node.js 18+.

npm install -g @snippkit/cli