Your Intelligent Command-Line Copilot
Transform natural language into powerful shell commands with AI
π Quick Start β’ π Documentation β’ π€ Contributing β’ π Issues
AI Shell is an intelligent, multi-modal command-line assistant that bridges the gap between natural language and complex shell operations. Powered by Large Language Models (LLMs), it translates your requests into executable commands, provides conversational guidance, and integrates with specialized tools like the Metasploit Framework.
Whether you're a beginner learning the command line or a seasoned expert looking to accelerate your workflow, AI Shell adapts to your needs.
- π Multi-Modal Architecture: Three distinct operating modes for different use cases
- π§ Advanced LLM Integration: Support for both cloud (Gemini) and local (Ollama) models
- π Security-First Design: Built-in command validation and user confirmation
- π¬ Conversational Memory: Context-aware responses with chat history
- π οΈ Tool Integration: Native support for penetration testing workflows
- π Learning Capability: Feedback loop for continuous improvement
Transform natural language into precise shell commands.
> find all files larger than 100MB in my home directory
β find ~ -type f -size +100M
Conversational partner for complex command-line tasks with explanations and guidance.
You: How can I check which processes are using the most memory?
Assistant: On Linux, you can use the 'ps' command combined with 'sort':
```bash
ps aux --sort=-%mem | head -n 10
This lists all running processes, sorts them by memory usage in descending order, and shows the top 10.
### 3. Metasploit Assistant Mode
Your personal cybersecurity expert with direct msfconsole integration.
Assistant: You can search for Log4j exploits using the 'search' command:
```bash
search cve:2021-44228
Would you like me to run this command for you?
## π Quick Start
### Prerequisites
- **Python 3.9+**
- **Metasploit Framework** (optional, for Metasploit mode)
- **Ollama** (optional, for local LLMs)
### Installation
#### Option 1: From Source (Recommended)
```bash
# Clone the repository
git clone https://github.com/GizzZmo/Ai_shell.git
cd Ai_shell
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .
Linux/Mac:
chmod +x install.sh
./install.sh
Windows:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
.\install.ps1
-
Copy the example configuration:
cp config.yaml.example config.yaml
-
Set your API key (for Gemini):
export GEMINI_API_KEY="your_api_key_here"
-
For local LLMs, install Ollama:
# Install Ollama (Linux) curl -fsSL https://ollama.ai/install.sh | sh # Pull a model ollama pull llama3
# Interactive mode selection
ai-shell
# Direct modes
ai-shell --mode translator
ai-shell --mode assistant
ai-shell --mode metasploit
# Specify provider
ai-shell --provider local
ai-shell --provider gemini --api-key your_key
# Use custom config
ai-shell --config myconfig.yaml
The config.yaml
file allows you to customize AI Shell's behavior:
llm:
provider: gemini # or 'local'
gemini:
api_key: ""
model: gemini-1.5-flash
local:
host: localhost
port: 11434
model: llama3
security:
require_confirmation: true
dangerous_commands:
- rm -rf
- format
- dd if=
logging:
level: INFO
file: ai_shell.log
GEMINI_API_KEY
: Your Google Gemini API keyAI_SHELL_CONFIG
: Path to custom configuration file
- Command Validation: Blocks dangerous commands
- User Confirmation: Requires approval before execution
- Input Sanitization: Protects against command injection
- Configurable Restrictions: Customizable safety lists
ai_shell/
βββ ai_shell/ # Main package
β βββ main.py # Application entry point
β βββ config.py # Configuration management
β βββ llm.py # LLM integration
β βββ executor.py # Command execution and security
β βββ ui.py # User interface utilities
βββ tests/ # Test suite
βββ docs/ # Documentation (coming soon)
βββ setup.py # Package setup
βββ requirements.txt # Dependencies
# Install development dependencies
pip install pytest pytest-cov black flake8
# Run all tests
python -m pytest
# Run with coverage
python -m pytest --cov=ai_shell
# Format code
black ai_shell/ tests/
# Check style
flake8 ai_shell/ tests/
- API Keys: Store securely using environment variables
- Command Review: Always review before execution
- Local LLMs: Consider for sensitive environments
- Network Security: Be cautious with cloud providers
We welcome contributions! See CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini for powerful language model capabilities
- Ollama community for local LLM support
- Metasploit Framework for penetration testing integration
- Issues: GitHub Issues
- Discussions: GitHub Discussions
You: ? search for exploits related to the log4j vulnerability