DEV Community

William Eduard M. Chua
William Eduard M. Chua

Posted on

whaeh: The Zero-Friction Terminal Copilot for Your Pipes

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

When you're knee-deep in terminal outputs, scrolling through hundreds of lines of log files, Kubernetes pod descriptions, or sprawling man pages breaks your flow state. Copy-pasting logs into a web browser AI tool or managing bulky CLI chat interfaces slows you down.

whaeh (pronounced like that reaction when your command fails) is a lightweight, zero-dependency Go CLI tool that integrates seamlessly into standard Unix pipes (|). You pipe any stdout or stderr stream into whaeh alongside a natural language prompt, and it acts as an immediate terminal co-processor.

What problem does it solve?

  • Instant Command Flag Discovery: Instead of searching through long man pages, pipe them straight to whaeh (e.g., man yt-dlp | whaeh "give me the command to download video as mp4").

  • Live Incident & Log Debugging: Intercept errors and debug live workloads without context switching (e.g., kubectl logs nginx-test | whaeh "what's the issue" or kubectl describe pod nginx-test | whaeh "why is this pod failing").

  • Terminal Stream Summarization: Distill large text dumps, build outputs, or trace files into quick action items right inside your shell.

Demo

Code

Whaeh logo

whaeh

whaeh is a Unix-style CLI for asking an AI about piped input or files.

Installation

Requirements

Install from source

git clone https://github.com/veenoise/whaeh.git
cd whaeh
go install .
Enter fullscreen mode Exit fullscreen mode

The whaeh executable is installed in Go's binary directory. Make sure that directory is on your PATH, then verify the installation:

whaeh version
Enter fullscreen mode Exit fullscreen mode

To build a local executable instead:

go build -o whaeh .
Enter fullscreen mode Exit fullscreen mode

Quick start

Ollama is the default provider and uses http://localhost:11434. Make sure Ollama is running and that the selected model is available:

ollama pull llama3.2
whaeh "find the relevant command"
Enter fullscreen mode Exit fullscreen mode

Ask about piped input or a file:

man tar | whaeh "how do I create a gzipped archive?"
whaeh --file README.md "summarize this"
Enter fullscreen mode Exit fullscreen mode

For a one-off provider or model, use command-line flags:

whaeh --provider ollama
…
Enter fullscreen mode Exit fullscreen mode

How I Built It

whaeh is written in Go to guarantee instant startup times, zero external runtime dependencies, and cross-platform binary compatibility across Linux, macOS, and Windows.

  • Open-Source Local Inference: Built with first-class support for Ollama, allowing developers to run open-weight models locally (such as Gemma) for fully offline, air-gapped terminal operations.

  • Flexible Multi-Provider Backend: Includes native adapter interfaces to toggle dynamically between local Ollama models and cloud APIs like Gemini or OpenAI, depending on performance needs or available resources.

  • Unix Pipe Architecture: Utilizes standard Go os.Stdin buffer processing to capture piped terminal streams alongside command-line arguments without blocking stdout or corrupting ANSI formatting.

┌─────────────────────────┐
│ Piped Terminal Output   │
│ (logs, man pages, etc.) │
└────────────┬────────────┘
             │
             ▼
      [ stdin stream ]
             │
             ├───────────────────┐
             ▼                   ▼
   ┌──────────────────┐  ┌───────────────┐
   │ Prompt Arguments │  │ whaeh CLI     │
   │ ("why is it down")│  │ (Go Binary)   │
   └──────────────────┘  └───────┬───────┘
                                 │
                   ┌─────────────┴─────────────┐
                   ▼                           ▼
        [ Local Ollama / Gemma ]      [ Cloud APIs (Gemini/OpenAI) ]
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

In systems engineering and infrastructure operations, terminal output often contains sensitive operational data: internal IP addresses, database schemas, environment variables, or trace tokens.

  1. Air-Gapped Data Privacy: Sending live system logs or kubectl describe outputs to external third-party endpoints is a major security risk for enterprise infrastructure. Running whaeh backed by local, open-weight models via Ollama guarantees that sensitive telemetry never leaves the machine.

  2. Zero Latency & Cost Controls: Pipe operations happen thousands of times a day. Open models eliminate pay-per-token pricing models and network round-trips, turning whaeh into a instantaneous, cost-free utility.

  3. Custom Model Fine-Tuning: Open-source architectures enable engineering teams to fine-tune local models on internal company documentation, runbooks, and proprietary CLI flags.

Prize Categories

  • Best use of Gemma

Top comments (0)