logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·01.11.26
← Back to news

Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

Original article
yamafaktory.github.io|29 points|12 comments|by yamafaktory|Jul 23, 2026

Whetuu: A Zero-Config, Cross-Shell Prompt in Zig

whetū /ˈfɛ.tuː/ — derived from the Māori word for "star" — is an opinionated, zero-configuration prompt designed to work across multiple shells, engineered entirely in the Zig language. 󰦥

The core philosophy is simplicity: a single compiled binary produces one curated prompt experience that is identical for every user.

There are no configuration files, no themes to tweak, and no parameters to tune.

It is compatible with fish, bash, and zsh, boasting a render speed of approximately 2ms2\text{ms}2ms.

Whetuu Prompt Demo


🚀 Installation

Getting started requires only a single command for macOS and Linux users.

  • Detects host platform
  • Verifies download via SHA256SUMS
  • Installs binary to ~/.whetuu/bin
  • Appends two lines to your active shell configuration
curl --proto '=https' --tlsv1.2 -fsSL https://yamafaktory.github.io/whetuu/install.sh | sh

Alternative Setup Methods

  • Dry Run: Execute the installer with WHETUU_NO_MODIFY=1 to see the required config lines without applying them.
  • Manual Init: Run whetuu init <shell> to generate the integration script and identify the target config file.

🎨 Prompt Anatomy

The prompt utilizes Nerd Font glyphs for language logos, git branches, and the primary prompt character. Segments are dynamic; they only appear when relevant.

Segment Details

SegmentDescriptionVisual Nuance
user_hostuser@hostBold Green normally; Bold Red for root or SSH sessions.
directoryCurrent pathShows the anchor and as many trailing folders as the width allows.
git branchCurrent branchMagenta text with a branch glyph; shows (detached) if applicable.
git stateActive operationsYellow text for (rebasing 2/7), (merging), or (cherry-picking).
git statusRepo healthA bracketed group: [conflicts, stashes, staged, modified, untracked, ahead, behind].
languageToolchain versionBrand-colored logo and version for 39 different tools/languages.
cmd_durationExecution timeTimer glyph appears if the last command took ≥2s\ge 2\text{s}≥2s.
characterThe prompt endA purple star (or the current language's brand color).

🔍 The History Picker

By pressing the Up Arrow, users access a sophisticated history picker. To keep the list clean, only commands that exited successfully are recorded.

Features

  • Context Awareness: Defaults to the current directory's history, falling back to global history if the local list is empty.
  • Visuals: Rows feature syntax highlighting. Colors for flags, paths, and operators are pulled from your existing terminal theme.
  • Smart Truncation: Long commands are truncated in the middle (using …) rather than the end, ensuring unique prefixes remain visible.

Picker Controls

  • Ctrl+G: Toggle between directory-specific and global history.
  • Tab: Copy the current selection into the search bar for editing.
  • Esc: Cancel and return to the command line.

🛠️ Command Reference

While the shell hook handles most tasks, whetuu provides a few manual commands:

  1. whetuu init fish|bash|zsh: Outputs the integration script for eval or source.
  2. whetuu paths: Displays the locations of the version cache and history store.

Note: whetuu paths will explicitly mark missing files rather than hiding them until the first command is cached/recorded. It requires $HOME or XDG variables to be set to function.


⚡ Performance

Because a prompt runs before every single command, speed is critical. Whetuu achieves its ≈2ms\approx 2\text{ms}≈2ms render time by using std.Io to run all disk-reading modules concurrently.

Benchmarks

Measured with hyperfine on an i9-13900H (ReleaseFast).

ScenarioTotal Render TimeBottleneck
No repo / No toolchain2.3ms2.3\text{ms}2.3msN/A
Zig repo (35 files)3.0ms3.0\text{ms}3.0msZig version probe (3.1ms3.1\text{ms}3.1ms)
Monorepo (8259 files)20.2ms20.2\text{ms}20.2msGit status (19.3ms19.3\text{ms}19.3ms)

Worst-Case Scenario: If git hangs for 30 seconds, the prompt will still return in approximately 257ms257\text{ms}257ms due to the concurrent execution of the toolchain probe (≈200ms\approx 200\text{ms}≈200ms) and git (≈250ms\approx 250\text{ms}≈250ms).


🛡️ Security & Privacy

Since a prompt has visibility into every command, Whetuu is designed with a strict security posture:

  • Zero Networking: The binary contains no HTTP clients, sockets, or synchronization logic.
  • Strict Permissions: The history store is created with mode 600 and reset to this on every write.
  • XDG Compliance: Data is stored in ~/.cache/whetuu/versions and other XDG-compliant paths, separate from the installation directory.
  • Easy Removal: Running rm -rf ~/.whetuu removes the application without deleting your history.
  • Privacy Mode: Starting any command with a leading space prevents it from being recorded in the history.

Subprocess Logic: Whetuu only ever spawns two types of subprocesses: git and the specific toolchain version probe.