An intelligent AI-powered shell command agent that converts natural language to secure shell commands using LangGraph orchestration.
- Natural Language Processing: Convert everyday language to precise shell commands
- Multi-Layer Security: Comprehensive validation and safety checks
- Cross-Platform Support: Windows (PowerShell), Linux (Bash), and macOS
- Real-time Execution: Interactive command confirmation and execution
- OS-Aware Commands: Generates platform-specific commands automatically
- Rich Terminal UI: Beautiful, syntax-highlighted interface
- LangGraph Workflow: Sophisticated AI orchestration pipeline
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β User Input βββββΆβ OS Detection βββββΆβ LangGraph β
β Natural Lang β β & Context β β Workflow β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Command ββββββ AI Command ββββββ Groq API β
β Execution β β Generator β β LLM β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Result β β Safety β β User β
β Display β β Checker β β Confirmation β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
| Component | Technology |
|---|---|
| AI Framework | LangChain + LangGraph |
| LLM Provider | Groq API |
| Language | Python 3.10+ |
| CLI Interface | Rich Terminal Library |
| Command Execution | PowerShell, Bash |
| Validation | Custom Security Layer |
- Python 3.10 or higher
- Groq API key (free at console.groq.com)
- Windows PowerShell, Linux Bash, or macOS Terminal
git clone https://github.com/srrishtea/what-the-shell.git
cd what-the-shellpip install -r requirements.txtEdit config/settings.py and add your Groq API key:
GROQ_API_KEY = "your_groq_api_key_here"python main.pyUser: "list all python files in current directory"
AI: Get-ChildItem -Filter "*.py" -Recurse
User: "show disk usage of folders here"
AI: Get-ChildItem | Measure-Object -Property Length -Sum
User: "find files modified today"
AI: Get-ChildItem -Recurse | Where-Object {$_.LastWriteTime -ge (Get-Date).Date}
- Type
helpfor available commands - Type
statusto view system information - Type
osto change operating system preference - Type
quitorexitto close application
On first run, the application will ask you to select your preferred OS:
- Windows (PowerShell/CMD)
- Linux (Bash/Shell)
- macOS (Bash/Shell)
- Auto-detect
The application includes multiple security layers:
- Command validation and sanitization
- User confirmation for all commands
- OS-specific command generation
- Safe execution environment
what-the-shell/
βββ main.py # Application entry point
βββ config/
β βββ settings.py # Configuration management
βββ agents/
β βββ command_generator.py # AI command generation
β βββ safety_checker.py # Security validation
β βββ executor.py # Command execution
βββ graph/
β βββ shell_graph.py # LangGraph workflow
βββ utils/
β βββ prompts.py # AI prompts
β βββ validators.py # Input validation
βββ images/ # Documentation assets
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
- Input Validation: Sanitizes user input and commands
- Command Whitelisting: Only allows safe, pre-approved commands
- Pattern Blacklisting: Blocks dangerous command patterns
- User Confirmation: Requires explicit approval before execution
- Resource Monitoring: Tracks CPU and memory usage
- Execution Limits: Enforces timeouts and resource constraints
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Plugin System: Extensible command modules
- Command History: Persistent command storage
- Multi-Language Support: Support for additional languages
- Web Interface: Browser-based UI option
- Docker Integration: Containerized deployment
- Team Collaboration: Shared command libraries
Issue: ImportError: cannot import name 'ChatGroq'
Solution: Install langchain-groq: pip install langchain-groq
Issue: Commands fail with PowerShell errors Solution: Ensure you're running with appropriate permissions
Issue: API rate limiting Solution: Check your Groq API usage and upgrade plan if needed
This project is licensed under the MIT License - see the LICENSE file for details.
- LangChain for the AI framework
- Groq for ultra-fast LLM inference
- Rich for beautiful terminal interfaces
- The open-source community for inspiration and support
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: Contact Us
Made with β€οΈ by @srrishtea
β Star this repository if you find it helpful!
