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 🙏

© 2024 – Pkg Stats / Ryan Hefner

asktocmd

v1.0.7

Published

AI-powered CLI assistant for command-line queries using Google's Gemini AI

Downloads

193

Readme

asktocmd 🤖

Did you forget your command-line commands? Don't worry! Now you can directly ask asktocmd, your AI-powered CLI helper. Ask about any command, operation, or CLI-related query, and get instant, intelligent responses powered by Google's Gemini AI.

npm version License: MIT PRs Welcome

🚀 Quick Start

# Install globally
npm install -g asktocmd

# Set up your API key (get it from https://aistudio.google.com/app/apikey)
asktocmd set-api-key YOUR_GEMINI_API_KEY

# Start asking questions!
asktocmd "How do I list all files in a directory?"

🌟 Features

  • 🤖 AI-powered responses to command-line queries using Google's Gemini AI
  • 💬 Interactive mode for continuous questioning
  • 🎨 Beautiful terminal output with syntax highlighting
  • 📝 Markdown formatting for easy readability
  • 🚀 Fast and efficient responses
  • 📚 Comprehensive command-line knowledge
  • 🌐 Works across different operating systems

📦 Installation

To install asktocmd globally:

npm install -g asktocmd

Verify the installation:

asktocmd --version

🔑 API Key Setup

asktocmd requires a Gemini API key to function. Here's how to get started:

  1. Get your API key:

    • Visit Google AI Studio to create your API key
    • If you're new, you'll need to sign in with your Google account
    • Click on "Create API key" and copy your new key
  2. Set up the key using one of these methods:

    a. Using the CLI command (recommended):

    asktocmd set-api-key YOUR_GEMINI_API_KEY

    b. Manual configuration:

    • The key is stored in ~/.asktocmd-config.json
    • You can edit this file directly if needed

🖥 Usage

asktocmd offers two modes of operation:

1. Direct Query Mode

Perfect for quick, one-off questions:

# Basic usage
asktocmd "How do I find the largest files in a directory?"

# Complex queries
asktocmd "How do I use grep to search for multiple patterns?"

2. Interactive Mode

Great for multiple questions or learning sessions:

asktocmd -i

This starts an interactive session where you can:

  • Ask multiple questions
  • Get immediate responses
  • Type 'exit' to quit

📋 Example Queries

# File operations
asktocmd "How do I recursively search for files?"

# Process management
asktocmd "How do I kill a process using a specific port?"

# System information
asktocmd "How can I check system resource usage?"

🛠 Advanced Usage

# Get help
asktocmd --help

# Check version
asktocmd --version

# Update API key
asktocmd set-api-key NEW_API_KEY

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/new-feature
  3. Commit your changes: git commit -am 'Add new feature'
  4. Push to the branch: git push origin feature/new-feature
  5. Submit a pull request

🐛 Bug Reports

Found a bug? Please report it on our issues page with:

  • A clear description of the issue
  • Steps to reproduce
  • Expected vs actual behavior

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Pranav

💖 Support

If you find asktocmd helpful:

  • ⭐ Give it a star on GitHub
  • 📢 Share it with your fellow developers
  • 🐦 Follow the creator on Twitter for updates

🙏 Acknowledgments

  • Google Gemini AI for powering the responses
  • The open-source community for inspiration and support

Happy command-line querying! 🎉