Skip to content

A command-line tool that lets you use plain English to run Linux commands safely and interactively. Powered by an AI language model, it translates your requests into shell commands, reviews them for safety, and only executes them with your approval.

Notifications You must be signed in to change notification settings

jaichandra15/shell-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🧠 AI Natural Language Shell

A command-line tool that lets you use plain English to run Linux commands safely and interactively.
Powered by an AI language model, it translates your requests into shell commands, reviews them for safety, and only executes them with your approval.


πŸš€ Features

  • πŸ—£οΈ Natural Language Input – Type what you want to do in Englishβ€”no need to remember complex shell syntax.
  • πŸ€– AI-Powered Translation – Converts your prompt into a Linux shell command.
  • πŸ”’ Safety First – Reviews generated commands for dangerous patterns before execution.
  • πŸ›‘ Interactive Confirmation – Always asks before running any command.
  • 🧩 Extensible Design – Easily add features or integrate with different AI providers (OpenAI, Groq, etc.).

⚑ Quick Start

1. Clone the Repository

git clone https://github.com/yourusername/ai-shell.git
cd ai-shell

2. Install Dependencies

pip install -r requirements.txt

3. Configure Your API Key

Edit the ai script and set your API key for your AI provider (OpenAI, Groq, etc.).

export GROQ_API_KEY="your-api-key"  # or OPENAI_API_KEY

4. Make the Tool Executable

chmod +x ai

5. Add to Your PATH or Add Alias

mv ai ~/.local/bin/
echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc
source ~/.bashrc
alias ai="./ai"

πŸ§ͺ Usage

ai "Show all files modified today"

πŸ’¬ Sample Interactive Output:

Suggested command: find . -type f -newermt today
Execute this command? (y/n): y
Output:
./report.txt
./notes/meeting.txt

🎯 Interactive Points

  • Prompt – Enter your request in plain English.
  • Review – See the suggested shell command before it runs.
  • Approve or Cancel – Type y to execute, n to cancel.
  • Error Feedback – Get a clear message if the command is unsafe or fails.

πŸ› οΈ Troubleshooting

Issue Solution
Command not found Ensure ai is in your PATH and is executable
API errors Check your API key and internet connectivity
Permission denied Run chmod +x ai to make the script executable

🀝 Contributing

  • Fork the repository and submit pull requests.
  • Suggest features or improvements via issues.

πŸ“„ License

This project is licensed under the MIT License.


Enjoy a safer, smarter, and more intuitive Linux command-line experience!

About

A command-line tool that lets you use plain English to run Linux commands safely and interactively. Powered by an AI language model, it translates your requests into shell commands, reviews them for safety, and only executes them with your approval.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages