Gary is a Haskell-based AI assistant that runs in your terminal. It uses OpenAI's GPT-4.1 model to respond to your queries and can execute shell commands on your behalf. Think of Gary as your helpful intern who's surprisingly efficient and weirdly fast.
- Interactive terminal-based chat interface
- Executes shell commands on request
- Maintains conversation history
- Provides helpful responses using OpenAI's GPT-4.1 model
-
Clone this repository:
git clone https://github.com/yourusername/gary.git cd gary -
Build the project using Stack:
stack build
Before running Gary, you need to set your OpenAI API key as an environment variable:
export OPENAI_KEY=your_openai_api_key_hereYou can add this to your shell profile file (.bashrc, .zshrc, etc.) to make it persistent.
Run Gary using Stack:
stack runThis will start an interactive session where you can chat with Gary. The prompt will show your current directory:
🛠️ gary>
Type your questions or commands and press Enter. Gary will respond and can execute shell commands when asked.
Ask Gary for information:
🛠️ gary> What's the current time?
Ask Gary to run a command:
🛠️ gary> List all files in the current directory
Ask Gary to help with a task:
🛠️ gary> Create a simple "Hello World" Haskell program
gary/: Main executable packageapp/Main.hs: Core application logic
format/: Text formatting library used by Garysrc/Text/: Text formatting utilities
This project uses Stack for building and dependency management. Some useful Stack commands:
stack build: Build the projectstack run: Run the Gary executablestack ghci: Start a GHCI session with the project loadedstack test: Run the test suite (if tests are added)
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.