AI-powered terminal assistant that provides command suggestions and chat capabilities.
- π€ Natural Language to Commands: Convert natural language requests to bash commands
- π¬ Chat Mode: Direct conversation with AI
- β‘ Multi-Session Support: Run multiple terminal sessions simultaneously
- π‘οΈ Safety Indicators: Visual warnings for dangerous commands
- π Mode Switching: Switch between execution and chat modes
- π Session Management: Join, detach, and switch between sessions
git clone <repository-url>
cd halpdesk
pip install -e .Option A: Local install from built .deb (for testing):
- Download the latest
.debfrom GitHub Actions artifacts or build locally:bash scripts/build_deb.sh 0.1.0 sudo dpkg -i dist/halpdesk_0.1.0_amd64.deb
- Enable the daemon as a user service (run as the target user):
systemctl --user daemon-reload systemctl --user enable --now halpdesk.service
Option B: Build from a GitHub release tarball (stable):
# Build .deb from a tag (uses public repo tarball)
gem install --no-document fpm
bash scripts/build_deb_from_release.sh v0.1.0 asharalam11/HALpdesk
sudo dpkg -i dist/halpdesk_0.1.0_amd64.deb
systemctl --user daemon-reload && systemctl --user enable --now halpdesk.serviceOption C: APT repository (recommended for users):
- Host an APT repo (Cloudsmith, PackageCloud, or Aptly).
- Publish the
.debbuilt by CI on tags (workflow uploads to the GitHub Release; mirror it to your repo). - Users add your signed repo and run
apt install halpdesk.
Option A: Local formula tap (for testing):
- Edit
packaging/homebrew/halpdesk.rbto point to a released tarball URL and SHA256. - Install:
brew install --formula packaging/homebrew/halpdesk.rb
- Run the daemon on login:
brew services start halpdesk
Option B: Dedicated tap (recommended):
- Create
yourorg/homebrew-halpdeskand publishhalpdesk.rbthere. - Users install with:
brew tap yourorg/halpdesk brew install halpdesk
- Python 3.8+
- Either Ollama running locally OR OpenAI API key
-
Start the daemon:
halpdesk-daemon
-
Start HAL in a terminal:
halp
-
Try some commands:
HAL> list files Suggested: ls -la π’ Press Enter to execute, or type your own command HAL> /chat HAL (chat)> What does ls do?
- Check daemon health:
curl -s http://127.0.0.1:8080/health - Inspect provider and connectivity:
curl -s http://127.0.0.1:8080/diagnostics | jq(or omit| jq)
halp- Start new session or join existinghalp list- List all active sessionshalp join <session_id>- Join existing sessionhalp new- Force create new session
/sessions- List all sessions/switch <id>- Switch to different session/detach- Detach from session (keeps running)/chat- Switch to chat mode/exec- Switch to execution mode/help- Show helpexit- Exit session
You can configure the daemon endpoint and the CLI via a config file or environment variables.
Config file (optional): ~/.config/halpdesk/config.toml
Example:
[server]
# Preferred: set a unified endpoint
endpoint = "http://127.0.0.1:8080"
# Or set host/port individually
# host = "127.0.0.1"
# port = 8080
[client]
# Where the `halp` CLI reaches the daemon
daemon_url = "http://127.0.0.1:8080"Environment overrides:
export HALPDESK_DAEMON_ENDPOINT="http://127.0.0.1:8080" # or use HALPDESK_DAEMON_HOST/PORT
export HALPDESK_DAEMON_URL="http://127.0.0.1:8080" # used by halp CLI
export OPENAI_API_KEY="your-key-here" # if using OpenAI
export ANTHROPIC_API_KEY="your-key-here" # if using Claude
export OLLAMA_HOST="http://localhost:11434" # if using Ollama
export HALPDESK_OLLAMA_BIN="/usr/local/bin/ollama" # optional: binary path for auto-start
export HALPDESK_OLLAMA_AUTOSTART=1 # set 0/false to disable
Provider configuration (optional) in `~/.config/halpdesk/config.toml`:
```toml
[providers]
default = "ollama" # or "openai" / "claude"
[providers.openai]
base_url = "https://api.openai.com/v1"
model = "gpt-3.5-turbo"
[providers.claude]
base_url = "https://api.anthropic.com"
model = "claude-3-haiku-20240307"
[providers.ollama]
base_url = "http://localhost:11434"
model = "llama2"
# optional: where to find the 'ollama' binary; if omitted, PATH is used
# binary = "/usr/local/bin/ollama"
Ollama auto-start: When the default or selected provider is Ollama and the server
is not reachable at `providers.ollama.base_url`, the daemon attempts to launch
`ollama serve` in the background (respecting `OLLAMA_HOST` derived from the URL).
## Architecture
Terminal 1 ββ Terminal 2 ββΌββ HALpdesk Daemon ββ Ollama/OpenAI Terminal 3 ββ
Each terminal maintains its own session with independent context and history.
## Safety Features
Commands are analyzed for safety:
- π’ Safe commands
- π‘ Caution required
- π΄ Potentially dangerous
## Development
```bash
pip install -e ".[dev]"
pytest