This project is a modern, conversational command-line shell that understands natural language. You can type plain English like "list all the folders on my desktop" or standard Linux commands like ls -a, and the AI will translate it into the correct command for your operating system and execute it.
The user interface is built with Textual, providing a rich, app-like experience in your terminal. The core intelligence is powered by a locally-run, open-source Large Language Model using Ollama.
- Natural Language Understanding: Ask the shell to perform tasks in plain English.
- Cross-Platform Translation: Type Linux commands like
lson Windows, and the AI will correctly translate them to PowerShell'sGet-ChildItem. - Multi-Layered Architecture:
- Layer 1 (Cache): Provides instant responses for common commands (
ls,pwd,dir, etc.). - Layer 2 (Rule Engine): Uses regular expressions to quickly handle simple, structured requests (e.g., "create folder 'x' on desktop").
- Layer 3 (LLM): Uses a local AI model (
phi-3:mini) for complex and novel queries, taught via few-shot prompting.
- Layer 1 (Cache): Provides instant responses for common commands (
- TUI Interface: A rich, user-friendly terminal interface built with Textual.
- Local & Private: All AI processing is done locally via Ollama, so your data and commands never leave your machine.
Follow these steps to get the AI Shell running on your local machine.
- Python 3.8+
- Ollama (Download here)
-
Clone the Repository:
git clone <your-repository-url> cd <your-repository-name>
-
Set Up Virtual Environment:
- Create the environment:
python -m venv venv
- Activate the environment:
- On Windows (PowerShell):
.\venv\Scripts\Activate.ps1 - On macOS/Linux:
source venv/bin/activate
- On Windows (PowerShell):
- Create the environment:
-
Install Dependencies:
pip install -r requirements.txt
-
Download the AI Model: Pull the recommended model using Ollama. This will download a few gigabytes.
ollama pull phi3:mini
-
Activate Your Virtual Environment (if you haven't already).
-
Launch the Application: Use the Textual runner to start the shell.
textual run main.py
For debugging, you can use
textual run --dev main.pyand press F12 to see console output. -
Interact with the Shell: Once the application is running, you can type your requests into the input box at the bottom and press Enter.
Example Queries:
ls -alist all files on my desktopcreate a new folder named "project_alpha" in my documentslist all text files sorted by size- To leave the application, simply type
exit.