Skip to main content

A secure, zero-bloat CLI companion that turns natural language and error logs into executable commands.

Project description

hey-cli

Your terminal buddy that turns plain English into shell scripts — and runs them for you.

PyPI Python License Release


hey is a terminal-native AI assistant that translates plain English into executable shell commands using a locally-hosted LLM via Ollama. Your data never leaves your machine.

$ hey find all python files modified in the last 24 hours
● Thinking...

▶ find . -name "*.py" -mtime -1 -type f

Run this command? [Y/n]:

Features

  • 100% Local & Private — All reasoning happens on your machine via Ollama. No API keys, no cloud, no telemetry.
  • Cross-Platform Intelligence — Detects your OS (macOS/Linux/Windows) and generates the correct flags. Won't suggest xargs -d on BSD or apt on Arch.
  • Agentic Context Gathering — Ask "is Docker running?" and hey silently runs diagnostics, reads the output, and answers in plain English.
  • Security Governance — Dangerous commands (rm -rf, mkfs, DROP TABLE) are intercepted and require explicit confirmation before execution.
  • Pipe-Friendly — Pipe error logs directly: npm run build 2>&1 | hey what is causing this error?
  • Conversational Memory — Remembers your recent interactions for follow-up questions.

Installation

hey requires Ollama running locally. Install it first, then choose your platform:

macOS (Homebrew)

brew tap sinsniwal/hey-cli
brew install hey-cli

macOS & Linux (curl)

curl -sL https://raw.githubusercontent.com/sinsniwal/hey-cli/main/install.sh | bash

Windows (Scoop)

scoop install https://raw.githubusercontent.com/sinsniwal/hey-cli/main/scoop/hey-cli.json

Windows (PowerShell Installer)

Invoke-WebRequest -Uri "https://raw.githubusercontent.com/sinsniwal/hey-cli/main/install.ps1" -OutFile "$env:TEMP\hey_install.ps1"; & "$env:TEMP\hey_install.ps1"

Windows (Standalone Binary)

Download hey.exe from the latest release. No Python required.

pip / pipx

pipx install hey-cli-python

Note: After installation, pull the default model: ollama pull gpt-oss:20b-cloud


Usage

hey <your objective in plain English>

Examples

Command What happens
hey list all running docker containers Generates and runs docker ps
hey is port 8080 in use? Silently runs lsof -i :8080, reads output, answers in English
hey forcefully delete all .pyc files Generates find . -name "*.pyc" -delete, pauses for confirmation
hey compress this folder into a tar.gz Generates the correct tar command for your OS
npm run build 2>&1 | hey what broke? Reads piped stderr and explains the error
hey --clear Wipes conversational memory

Execution Levels

Level Flag Behavior
0 --level 0 Dry-run — shows the command but never executes
1 (default) Supervised — safe commands auto-run, risky ones ask for confirmation
2 --level 2 Unrestricted — executes everything without confirmation
3 --level 3 Troubleshooter — iteratively debugs until the objective is resolved

Security

Safety is enforced at runtime via a local governance engine (~/.hey-rules.json):

  • Blockedrm -rf /, mkfs, :(){ :|:& };: are permanently rejected.
  • Explicit Confirm — High-risk operations (rm, truncate, DROP) require typing a keyword to authorize.
  • Y/N Confirm — Moderate-risk operations require a quick y.
  • Auto-Run — Safe diagnostics (ls, cat, grep, git status) execute immediately.

Initialize or customize your rules:

hey --init

OS Skills

hey ships with built-in knowledge for macOS, Ubuntu/Debian, Arch Linux, Fedora/RHEL, Windows PowerShell, FreeBSD, and ChromeOS.

Want to improve it for your OS? Add a Markdown file to hey_cli/skills/ with plain-English rules (e.g., "On Alpine, use apk add instead of apt install"). The engine loads them dynamically at runtime.

Pull requests for new OS skills are welcome!


Architecture

hey "your question"
    │
    ▼
┌──────────────┐     ┌──────────────────┐
│  CLI Parser  │────▶│ Governance Check │
└──────────────┘     └────────┬─────────┘
                              │
                    ┌─────────▼──────────┐
                    │  Ollama (local LLM)│
                    │  localhost:11434   │
                    └─────────┬──────────┘
                              │
                    ┌─────────▼──────────┐
                    │  Command Runner    │
                    │  (execute / confirm)│
                    └────────────────────┘
  • Zero external API calls — communicates with Ollama via localhost:11434 using Python's built-in urllib.
  • Zero compiled dependencies — the only runtime dependency is rich (for terminal formatting).
  • Pure Python 3.9–3.14 — no C extensions, no Rust, no build tools required.

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit changes: git commit -m "feat: add my feature"
  4. Push and open a Pull Request

See RELEASING.md for maintainer release instructions.


License

MIT — Mohit Singh Sinsniwal

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

hey_cli_python-1.0.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hey_cli_python-1.0.4-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file hey_cli_python-1.0.4.tar.gz.

File metadata

  • Download URL: hey_cli_python-1.0.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for hey_cli_python-1.0.4.tar.gz
Algorithm Hash digest
SHA256 a763a410c26ee494250dcb706bdc549a81f9d5bbb135e08c624b2ca215321df9
MD5 bce20354dd0c82cb04b3c78618c8f22b
BLAKE2b-256 a8ed5bd2c48ee546de6ababc5cb93b1cfea441c50b1cc4cd0c2f39f9e2ac7e0d

See more details on using hashes here.

File details

Details for the file hey_cli_python-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: hey_cli_python-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for hey_cli_python-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3d926300815c3d8c5c208c790ee10a54197baa8d00a74611b15303867b888ef0
MD5 f89803733c3f3a6b7ab51beab7129e4e
BLAKE2b-256 ebb79a9e37a985756fcb895c2c7360a16f6c7e658cc49ae109a17d629c87086e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page