Bro β Lightweight CLI assistant powered by Groq (primary) via LangChain, built on Bun. The codebase is written in TypeScript for improved type safety and maintainability.
Bro is a terminal-based AI assistant that runs locally using Groq for fast inference. It features web search capabilities, streaming responses, and a clean CLI interface.
| Category | Technologies |
|---|---|
| Runtime | Bun 1.0+ |
| Language | TypeScript 5+ |
| AI Framework | LangChain |
| LLM Provider | Groq (primary) |
| Web Search | Tavily (preferred) / DuckDuckGo (fallback) |
| UI | ora (spinners), chalk/colors |
| Validation | Zod |
bro/
βββ agent.ts # LangChain agent with tools & streaming
βββ llm.ts # Groq ChatGroq configuration
βββ tools.ts # Web search tools (Tavily + DuckDuckGo)
βββ ui.ts # CLI output formatting
βββ nonInteractive.ts # Non-interactive mode handler
βββ install # Install script (sets up API keys, symlink)
βββ uninstall # Uninstall script
βββ update # Update script
βββ package.json
βββ tsconfig.json
βββ README.md
- Linux or macOS (Windows not officially supported)
- Bun (required β used as both runtime and package manager)
- Supported shells: bash, zsh
- A
GROQ_API_KEY(required) β get one at console.groq.com - A
TAVILY_API_KEY(optional) β enables higher-quality web search, get one at tavily.com
# Clone the repository
git clone https://github.com/oovaa/bro.git
cd bro
# Verify Bun is installed
bun --version
# Install Bun from https://bun.sh/docs/installation if needed
# Run the install script (interactive, prompts for API keys)
./install
# Or non-interactive:
# ./install <GROQ_API_KEY> [TAVILY_API_KEY]The install script:
- Installs dependencies via
bun install - Prompts for
GROQ_API_KEY(required) andTAVILY_API_KEY(optional) - Creates symlink in
~/.local/bin/bro - Adds API keys to your shell config (
.bashrcor.zshrc)
broStarts an interactive chat session. Type your questions and press Enter. Press Ctrl+C to exit.
bro "tell me about quantum computing"Runs a single query and exits.
| Variable | Required | Description |
|---|---|---|
GROQ_API_KEY |
Yes | Groq API key for LLM inference |
TAVILY_API_KEY |
No | Tavily API key for web search (falls back to DuckDuckGo) |
Bro uses Groq with the following models:
| Role | Model | Purpose |
|---|---|---|
| Primary | openai/gpt-oss-120b |
Main LLM for responses |
| Fallback | llama-3.1-8b-instant |
Backup if primary unavailable |
Model fallback is handled automatically via LangChain's modelFallbackMiddleware.
| Provider | When Used |
|---|---|
| Tavily | When TAVILY_API_KEY is set (higher quality) |
| DuckDuckGo | Fallback when Tavily not configured |
# Pull latest changes
git pull origin main
# Re-run install to update dependencies and symlink
./install# Install dependencies
bun install
# Type-check
bun run tsc --noEmit
# Test locally
./bro "test question"
# Run in interactive mode
./bro./uninstallRemoves:
- Symbolic link (
~/.local/bin/bro) - Environment variables from shell config
- Local dependencies
| Issue | Solution |
|---|---|
bro: command not found |
Ensure ~/.local/bin is in your PATH, or re-run ./install |
GROQ_API_KEY not set |
Run ./install again or manually add to .bashrc/.zshrc |
| Bun not found | Install Bun: curl -fsSL https://bun.sh/install | bash |
| Type errors | Run bun run tsc --noEmit to diagnose |
See CONTRIBUTING.md for detailed guidelines.
Quick start:
- Fork and clone
bun install- Make changes in TypeScript (
.tsfiles) bun run tsc --noEmit- Test:
./bro "test" - Submit PR
MIT License - see LICENSE for details.
Omar Abdulrahim
GitHub: @oovaa