Work in powershell or bash with a codriver at your side. Auto-intent discovery allows you to just type either commands or questions or requests of the ai and it will handle it. Treat it like a normal terminal, but ask for ai help when you want.
💬 Type a shell command directly, ask the ai a question, or ask the ai to run a command for you. Intent is discovered in real time.
⌨️ Pipe your command along with a '?' to ai to ask it about the output. eg. 'dir |? how many files are in here?'
📗 Add file(s) to your conversation context with @, eg. '@mycode.ps1 @mynotes.txt'
💾 Save the last AI response with save, eg. 'save mycode.py'
🔁 gpt-4.1 or llm -- Model selection
⬅️ reset - Resets conversation history.
👋 exit -- Quit
📝 Added new feature: Command execution now captures both stdout and stderr, ensuring errors are seen by the AI
To get started with TerminalCodriver, follow these steps:
- Clone the repository:
git clone https://github.com/stavrostzagadouris/TerminalCodriver.git
- Navigate to the project directory:
cd TerminalCodriver - Install dependencies:
Make sure you have Python installed on your system. Then, install required libraries using pip:
pip install -r requirements.txt
Create a .env file in the root of your project directory based on the example.env file. At a minimum, you need to provide your OpenAI API key.
# example.env content
OPEN_AI_KEY="your_openai_api_key_here"
# Optional: For LM Studio integration
# lmstudioIP="127.0.0.1"
# lmstudioPort="1234"
# lmstudioModel="your-lm-studio-model-name"
# Optional: Default model to use at startup
# defaultModel="gpt-4.1"
# Optional: Model for classifying user intent (e.g., a smaller, faster model)
# classifyingModel="gpt-4.1-nano"
Key variables:
OPEN_AI_KEY: Your API key for OpenAI services.lmstudioIP: (Optional) The IP address where your LM Studio instance is running.lmstudioPort: (Optional) The port your LM Studio instance is listening on.lmstudioModel: (Optional) The name of the model loaded in your LM Studio instance. Cosmetic only, not actually useddefaultModel: (Optional) Specifies the AI model to use by default when the Codriver starts.classifyingModel: (Optional) A dedicated model for classifying user input intent (e.g.,gpt-4.1-nanofor faster classification).
To run TerminalCodriver, simply execute the following command in your terminal:
python codriver.pyOnce running, you can interact with the Codriver in several ways:
Type any standard shell command, and the Codriver will execute it directly:
ls -lAsk the Codriver a question, and it will provide an answer:
how do I list all running processes on Linux?Tell the Codriver what you want to achieve, and it will suggest and run the appropriate command (after your confirmation):
tell me how much space is left on my C driveThe Codriver will respond:
Codriver: I would like to run this command:
Get-PSDrive C:
May I? y/n
If you type y and press Enter, the command will be executed.
Analyze the output of a command or ask a follow-up question based on it using the |? syntax:
dir |? how many files are in here?The Codriver will run dir, capture its output, and then send both the command and its output to the AI along with your question. If the initial command fails, the AI will attempt to suggest a fix.
- To use the OpenAI
gpt-4.1model:gpt-4.1
- To connect to your local LM Studio instance:
llm
To clear the current conversation context:
resetThis project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit pull requests or open issues.
