Skip to content

21prnv/asktocmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asktocmdimagei

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! 🎉

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published