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

sahnik

v1.0.2

Published

CLI tool to interact with Sahnik's AI assistant

Readme

Sahnik CLI

A command-line interface to interact with Sahnik's AI assistant. Ask questions and learn about Sahnik without needing your own API key!

🚀 Installation

For Users

Install globally from npm:

npm install -g sahnik

For Development

Clone the repository and link locally:

npm install
npm link

📖 Usage

Available Commands

# Learn about Sahnik
sahnik about

# Ask a question
sahnik ask "What tech stack does Sahnik use?"
sahnik ask "Tell me about Sahnik's projects"

# Show help
sahnik help

# Show version
sahnik version

Examples

$ sahnik about
⠋ Thinking...
🤖 Sahnik AI:

Sahnik is a talented developer...

$ sahnik ask "What programming languages does he know?"
⠋ Thinking...
🤖 Sahnik AI:

Sahnik is proficient in JavaScript, TypeScript, Python...

⚙️ Configuration

For development or if you're running your own backend:

  1. Copy .env.example to .env
  2. Update the configuration:
BACKEND_URL=http://localhost:3000
AUTH_KEY=your-shared-secret-key

Note: For published npm package, these values are embedded during build.

🏗️ Development

Testing Locally

# Install dependencies
npm install

# Link the CLI globally
npm link

# Test commands
sahnik about
sahnik ask "test question"

Before Publishing

  1. Ensure backend is deployed and running
  2. Update .env with production backend URL
  3. Update version in package.json
  4. Test thoroughly with npm link

📦 Publishing to npm

First Time Setup

  1. Create npm account: npmjs.com/signup

  2. Login locally:

    npm login
  3. Verify package name is available:

    npm search sahnik

    If taken, choose a different name in package.json

Publishing Steps

  1. Update version in package.json:

    {
      "version": "1.0.0"  // or 1.0.1, 1.1.0, etc.
    }
  2. Test locally:

    npm link
    sahnik about
  3. Publish:

    npm publish
  4. Verify:

    npm install -g sahnik
    sahnik about

Publishing Updates

  1. Make your changes

  2. Update version (semantic versioning):

    • Patch (1.0.0 → 1.0.1): Bug fixes
    • Minor (1.0.0 → 1.1.0): New features, backwards compatible
    • Major (1.0.0 → 2.0.0): Breaking changes
    # Auto-increment version
    npm version patch   # 1.0.0 → 1.0.1
    npm version minor   # 1.0.0 → 1.1.0
    npm version major   # 1.0.0 → 2.0.0
  3. Publish update:

    npm publish
  4. Users can update:

    npm update -g sahnik

🔧 Troubleshooting

"Command not found: sahnik"

  • Ensure installed globally: npm install -g sahnik
  • Check global install path: npm root -g
  • Try reinstalling: npm uninstall -g sahnik && npm install -g sahnik

"Cannot connect to backend server"

  • Check internet connection
  • Backend might be sleeping (Render free tier) - wait 30-60 seconds
  • Verify backend is deployed and running

"Authentication failed"

  • Contact package maintainer - auth key might be outdated

📁 Project Structure

cli/
├── bin/
│   └── sahnik.js       # Main CLI executable
├── package.json        # Package configuration
├── .env               # Environment variables (development)
├── .env.example       # Template
└── README.md          # This file

🔒 Security

  • API key is never exposed to CLI users
  • All requests go through authenticated backend
  • Rate limiting prevents abuse
  • Environment variables keep secrets safe

📄 License

MIT

🤝 Contributing

Issues and pull requests welcome!

📞 Support

For issues or questions, visit: https://github.com/sahnik/sahnik-cli