AI-powered terminal assistant that suggests or executes bash commands from natural language.
Project description
hai
A friendly shell assistant powered by LLMs
hai (pronounce like "hi") is a thin, context-aware wrapper around bash that brings natural language command generation directly to your terminal. Stop context-switching to look up git commands, bash syntax, or flags—just ask hai.
🎯 Quick Start
# Hit Ctrl+Shift+H and type naturally
"Show me files modified in the last 24 hours"
# Or use the @hai prefix
$ @hai commit just README.md to main, I'm on feature-branch
✨ Features
- Seamless Integration: Invoke with
Ctrl+Shift+Hor@haiprefix - Context-Aware: Knows your CWD, git state, history, and environment
- Local-First: Supports Ollama and local models to minimize API costs
- Dual-Layer Output: See both LLM reasoning and command execution
- Smart Execution: Handles multi-step workflows with confidence-based confirmation
- Safe by Design: Permission framework inspired by Claude Code
🚀 Status
Current Version: Pre-release (v0.1 in development)
hai follows an agile development approach with frequent version increments. See the PRD for the full roadmap.
Roadmap
- v0.1 - Proof of Concept: Basic invocation, single LLM provider, dual-layer output
- v0.2 - Enhanced Context: History, session context, hybrid memory model
- v0.3 - Smart Execution: Confidence scoring, auto-execute vs. confirm
- v0.4 - Permissions Framework: Granular control over command execution
- v0.5 - Error Handling: Automatic retry with model upgrade for debugging
- v1.0 - Production Ready: Polished, tested, documented, secure
See PRD.md for complete requirements and technical architecture.
🛠️ Installation
# Coming soon - v0.1 in development
pip install hai-cli
📖 Usage
Invocation Methods
-
Keyboard Shortcut (recommended):
# Press Ctrl+Shift+H, then type your request "Find all TypeScript files that import React"
-
Prefix Mode:
$ @hai what's taking up the most disk space?
Example Interactions
Simple query:
$ @hai show me large files in home directory
[Conversation Layer]
I'll search for large files using find and sort by size.
[Execution Layer]
$ find ~ -type f -exec du -h {} + | sort -rh | head -20
Multi-step workflow:
$ @hai commit just README.md to main, I'm on feature-branch
[Conversation Layer]
I'll stash changes, switch to main, commit README.md, and return.
Workflow (4 steps):
1. git stash push -m "temp stash"
2. git checkout main
3. git add README.md && git commit -m "Update README"
4. git checkout feature-branch && git stash pop
Execute? [Y/n]: y
[Execution Layer]
[... commands execute ...]
[Conversation Layer]
✓ Done! Back on feature-branch with working changes restored.
🔧 Configuration
# ~/.hai/config.yaml
provider: "ollama" # openai | anthropic | ollama | local
model: "llama3.2"
providers:
openai:
api_key: "sk-..."
model: "gpt-4o-mini"
anthropic:
api_key: "sk-ant-..."
model: "claude-sonnet-4-5"
ollama:
base_url: "http://localhost:11434"
model: "llama3.2"
context:
include_history: true
include_git_state: true
🎯 Design Philosophy
- Seamless Integration - Feel like a natural extension of bash
- Local-First - Support local/Ollama models for cost-effective daily use
- Safety - Clear permission boundaries, confidence-based execution
- Transparency - Always show what's happening (thinking + doing)
- Agile Evolution - Ship working increments frequently
🤝 Contributing
Contributions welcome! This project is in early development. See PRD.md for the vision and roadmap.
📝 License
This project is licensed under the GNU Affero General Public License v3.0 - see LICENSE for details.
🔗 Links
🙏 Inspiration
Built with a similar agile approach to parallel-cc - small version increments, frequent shipping, validate as we go.
Status: 🚧 Under Active Development | v0.1 Coming Soon
Say "hai" to your new shell assistant! 👋
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hai_sh-0.0.1.tar.gz.
File metadata
- Download URL: hai_sh-0.0.1.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cc7668e51b3d311c8e1202ed6a7450e7a146c26798ae940adb4c67bec0bb9dd
|
|
| MD5 |
7d8bab635e6861ae4ed630b6d4214905
|
|
| BLAKE2b-256 |
1131074995680be8d93ddbc5bfa9c57ac4f08bf1a7dd9fd46b5646e662a6bc4b
|
File details
Details for the file hai_sh-0.0.1-py3-none-any.whl.
File metadata
- Download URL: hai_sh-0.0.1-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca57c56beb1ba75d40b5e7ffee36c56bf56e79d0500f8fb402f465908627cb35
|
|
| MD5 |
4474fc5f5667632ef41f88666f1ebf1c
|
|
| BLAKE2b-256 |
834367defc5fdd63de80a218d986dfebc7ddac26cf73fbafc8f27c4ca6093d7d
|