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.
# 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?"
- 🤖 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
To install asktocmd globally:
npm install -g asktocmd
Verify the installation:
asktocmd --version
asktocmd requires a Gemini API key to function. Here's how to get started:
-
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
-
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
- The key is stored in
asktocmd offers two modes of operation:
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?"
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
# 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?"
# Get help
asktocmd --help
# Check version
asktocmd --version
# Update API key
asktocmd set-api-key NEW_API_KEY
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create your feature branch:
git checkout -b feature/new-feature
- Commit your changes:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature/new-feature
- Submit a pull request
Found a bug? Please report it on our issues page with:
- A clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
This project is licensed under the MIT License - see the LICENSE file for details.
Pranav
If you find asktocmd helpful:
- ⭐ Give it a star on GitHub
- 📢 Share it with your fellow developers
- 🐦 Follow the creator on Twitter for updates
- Google Gemini AI for powering the responses
- The open-source community for inspiration and support
Happy command-line querying! 🎉