A Rust-based TUI application that helps you discover and understand your Homebrew-installed tools. It indexes local man/help pages into a vector store and uses a local Ollama model to recommend tools and usage examples based on your query.
- π¦ Package Discovery: Automatically lists all Homebrew-installed packages
- π€ AI-Powered Recommendations: Uses local Ollama to suggest tools based on your needs
- π‘ Usage Examples: Provides practical command-line examples for recommended tools
- β¨οΈ Interactive TUI: Clean, intuitive terminal interface built with Ratatui
Before running this application, ensure you have:
-
Rust (1.70 or later)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Homebrew (macOS package manager)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Ollama (local LLM runtime)
brew install ollama
-
Ollama Models
ollama pull all-minilm ollama pull qwen3-coder:480b-cloud
-
Clone the repository and enter the directory:
git clone <repo_url> cd mac-aid
-
Build the project:
cargo build --release
-
Run the application:
cargo run --release
- Enter: Submit your query
- Esc: Clear input
- q: Quit
- Ctrl + r: Rebuild knowledge base
- Shift + R: Reload index data
- β/β: Scroll response
Run a one-shot query directly from the terminal (no TUI, no RAG retrieval):
mac-aid how to compress file
mac-aid "convert image format"This uses local Ollama with the configured generation model and prints the answer to stdout.
Try asking questions like:
- "I need to process JSON files"
- "How can I convert images to different formats?"
- "Show me tools for monitoring network traffic"
- "I want to edit videos from the command line"
- "What tools can help me work with Docker?"
ββββββββββββββββββββββββββββββββββββββββββββββββ
β Enter your need β
β [type your query here] β
ββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β Status: Ready / Indexing progress messages β
ββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β π‘ Recommendation β
β AI suggestions and usage examples appear hereβ
ββββββββββββββββββββββββββββββββββββββββββββββββ
The interactive query model is set in src/main.rs and defaults to qwen3-coder:480b-cloud:
let ollama = OllamaClient::new("qwen3-coder:480b-cloud".to_string());Pull and set any model you prefer by updating this line.
Models are configured in ~/.mac-aid/config.json and auto-created on first run:
{
"ollama_model": "qwen3-coder:480b-cloud",
"embedding_model": "all-minilm"
}If your Ollama instance is running on a different host/port, edit src/ollama.rs:
impl OllamaClient {
pub fn new(model: String) -> Self {
Self {
client: Client::new(),
base_url: "http://your-host:port".to_string(),
model,
}
}
}Make sure Homebrew is installed and accessible in your PATH:
which brew
brew --version-
Ensure Ollama is running:
ollama serve
-
Verify the model is available:
ollama list
-
Test the API manually:
curl http://localhost:11434/api/generate -d '{ "model": "qwen3-coder:480b-cloud", "prompt": "Hello", "stream": false }'
### Non-blocking rebuild/reload
- Rebuild and reload run in the background; the TUI stays responsive.
- Queries made during rebuild/reload skip RAG retrieval and directly use Ollama.
## Development
### Project Structure
src/ βββ main.rs βββ app.rs βββ ui.rs βββ brew.rs βββ indexer.rs βββ vector_store.rs βββ rag.rs βββ langchain_integration.rs βββ kb_builder.rs βββ log.rs
Additional docs:
- Chinese README:
README.zh-CN.md
### Building for Development
```bash
cargo build
cargo run
cargo test- Database:
~/.mac-aid/commands.db - Logs:
~/.mac-aid/error.log,~/.mac-aid/info.log
MIT
Contributions are welcome! Please feel free to submit issues or pull requests.