Transform your natural language into executable shell commands, right in your terminal. Never forget a command again.
Demo.mov
Demo.2.mov
CommandLineGenius is a native macOS command-line tool that bridges the gap between human intent and machine instruction. Instead of struggling to remember the exact syntax for find
, grep
, awk
, or git
commands, you simply describe what you want to do in plain English. The assistant uses a powerful, locally-run AI to generate the precise command and places it directly into your terminal prompt, ready for you to execute.
This project is built on the principle of local-first AI, ensuring your data remains private, your workflow is fast, and you have a powerful assistant even when you're offline.
- Natural Language to Command: Convert complex requests like "find all files larger than 50MB in my downloads folder" into find ~/Downloads -size +50M.
- Multi-Mode Architecture: Use flags like --git to switch the AI's context, providing highly accurate, domain-specific commands for different tools.
- Seamless Shell Integration: The generated command is injected directly into your Zsh or Bash prompt, feeling like a native feature of your terminal.
- 100% Local & Private: Powered by Ollama and codellama, all AI processing happens on your machine. No data ever leaves your computer.
- Blazingly Fast: Built in native Swift for optimal performance on macOS.
- Install Homebrew
- Brew Install Ollama
- Pull Codellama 7b or 13b using Ollama
- Download the tool here => Download
- Copy the Provided Tool Into Below Folder
~/usr/local/bin/
- Integrate with shell
- Start Using CommandLineGenius
To enable the AI command, you need to add a small function to your shell's configuration file.
For Zsh users (default on modern macOS):
-
Open your Zsh configuration file: open ~/.zshrc
-
Add the following function to the end of the file:
# CommandLineGenius AI() { local cmd cmd=$(CommandLineGenius "$@") if [[ -n "$cmd" ]]; then print -z -- "$cmd" fi }
-
Restart your terminal or run source ~/.zshrc. That's it!
For Bash users:
-
Open your Bash configuration file: open ~/.bash_profile
-
Add the following function to the end of the file:
AI() { local cmd cmd=$(CommandLineGenius "$@") if [[ -n "$cmd" ]]; then READLINE_LINE="$cmd" READLINE_POINT=${#cmd} fi }
-
Restart your terminal or run source ~/.bash_profile.
You're all set! Try it out: AI --git "revert the last commit"
This project is in its early stages, and there is a massive opportunity to build something truly special for the developer community. Your contributions are not just welcome—they are essential.
- Shape a Powerful Tool: You have the chance to influence the core functionality and direction of an exciting developer tool.
- Dive into Local AI: Get hands-on experience with modern, on-device Large Language Models in a practical, real-world application.
- Work with Native macOS Tech: Sharpen your Swift and command-line development skills on a project that's built for performance.
We have a roadmap of exciting features and improvements. Here are a few ideas to get you started:
- 🧠 Add More Modes: The multi-mode architecture is built to be extended! Add new modes with specialized prompts for tools like docker, kubectl, ffmpeg, or any other complex CLI.
- 💡 Refine Prompts: The "brain" of our assistant is the prompt. Can you refine the existing prompts to handle more complex or ambiguous user requests?
- 🐞 Bug Squashing & Performance: Find and fix bugs or profile the code to make it even faster and more reliable.
- Fork the repository on GitHub.
- Clone your fork: git clone https://github.com/jadhavsharad/CommandLineGenius.git
- Create a new branch: git checkout -b feature/your-awesome-feature
- Make your changes and commit them with clear, descriptive messages.
- Push to your branch: git push origin feature/your-awesome-feature
- Open a Pull Request and describe the changes you've made.
Ready to start hacking? Here’s how to set up your local development environment.
-
Prerequisites:
- Xcode (latest version from the Mac App Store)
- Homebrew (For Ollama)
- codellama (7b or 13b) Model
-
Clone the Repository:
git clone https://github.com/YOUR-USERNAME/CommandLineGenius.git cd CommandLineGenius
-
Set up the AI Model:
This will download and set up the codellama modelbrew install ollama ollama pull codellama:7b
If you want to use 13b
ollama pull codellama:13b
-
Build in Xcode:
- Open the CommandLineGenius.xcodeproj file in Xcode.
- Ensure the "My Mac" target is selected.
- Build the project using Product > Build (or Cmd + B).
- You can run the tool directly from Xcode to test changes.