Skip to content

slompo/huginn

Repository files navigation

Huginn

A cognitive terminal multiplexer written in Rust. Wraps your shell and AI assistants with a dynamic HUD to prevent context-switching fatigue.

The Name

In Norse mythology, Odin had two ravens: Huginn (Old Norse: "Thought") and Muninn ("Memory"). Each day at dawn, Odin sent them flying across all nine worlds. At evening, they returned to perch on his shoulders and whisper everything they had seen and heard into his ears.

Huginn represents Thought - the active processing and analysis of information. Just as Odin's raven brought him knowledge from across the world, this tool brings context and awareness to your terminal workflow. The HUD acts as Huginn's whispers, keeping you informed without pulling you away from your task.

Muninn (Memory) would be the scrollback buffer - preserving the history of what has passed. Together, they give you both the present moment (Thought) and the past (Memory) to make better decisions.

Features

  • Terminal UI with HUD: Three-panel layout showing context and status at the top
  • Shell Integration: Wraps your default shell (zsh, bash, fish) in a PTY
  • Session Multiplexing: Toggle between Shell and AI assistant views with :t
  • AI Assistant Support: Run Claude Code, Aider, or any CLI AI tool in parallel
  • Smart HUD Status: LLM-powered TL;DR of what the AI is currently doing
  • Mouse Selection: Click and drag to select text, auto-copies on release
  • Scrollback Navigation: Shift+Up/Down or mouse scroll to navigate history
  • Full ANSI Support: Colors, bold, italic, underline, and more
  • Configurable: JSON-based configuration with native TUI settings screen
  • Cross-platform: Works on macOS, Linux, and Windows

Requirements

  • Rust 1.75 or later
  • Cargo (included with Rust)

Check your version:

rustc --version

Update if needed:

rustup update stable

Installation

From Release (Recommended)

curl -sSL https://github.com/slompo/huginn/releases/latest/download/huginn-installer.sh | sh

This installs to ~/.cargo/bin/huginn.

From Source

git clone https://github.com/slompo/huginn.git
cd huginn
cargo build --release

The binary will be at target/release/huginn.

Troubleshooting

If build fails, try:

cargo clean && cargo build --release

Usage

Run Huginn:

cargo run --release

Keyboard Shortcuts

Press : to enter command mode, then:

Command Action
:t Toggle between Shell and AI views
:c Open configuration screen
:r Force HUD refresh (re-summarize)
:q Quit
:? Show commands

Mouse Navigation

Action Result
Click + Drag Select text (auto-copies on release)
Scroll Up/Down Navigate scrollback history
Shift + Up/Down Navigate scrollback history

Config screen:

Shortcut Action
Tab / Next field
Shift+Tab / Previous field
Enter Save configuration
Esc Back to main view

Configuration

Configuration is stored at ~/.config/huginn/config.json:

{
  "shell_command": "zsh",
  "shell_args": [],
  "ai_command": "claude",
  "ai_args": [],
  "summarizer_command": "ollama",
  "summarizer_args": ["run", "llama3.2"],
  "shortcuts": {
    "toggle_view": "ctrl+shift+t",
    "force_refresh": "ctrl+shift+r",
    "open_config": "ctrl+shift+c",
    "quit_app": "ctrl+shift+q"
  }
}

Summarizer Configuration

The HUD can use an LLM to generate context-aware summaries. Configure your preferred summarizer:

Using Ollama:

{
  "summarizer_command": "ollama",
  "summarizer_args": ["run", "llama3.2"]
}

Using Claude CLI:

{
  "summarizer_command": "claude",
  "summarizer_args": []
}

Architecture

┌─────────────────────────────────────────────────────────────┐
│  HUD (30% TL;DR | 20% Scroll | 50% AI Status)              │  3 lines
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  Main View                                                  │  Flexible
│  (Shell / AI / Config)                                      │
│                                                             │
├─────────────────────────────────────────────────────────────┤
│  Footer (Dynamic shortcuts)                                 │  1 line
└─────────────────────────────────────────────────────────────┘

HUD Layout

  • Left (30%): TL;DR of the first AI prompt or current view name
  • Center (20%): Scroll indicator when navigating history
  • Right (50%): AI status TL;DR (LLM-generated summary of current activity)

Development Status

Phase 1: TUI Infrastructure ✅

  • Terminal UI with HUD, main view, and footer
  • Configuration system with JSON persistence
  • Config screen with text input fields
  • Event loop with keyboard shortcuts

Phase 2: PTY Integration ✅

  • Real shell integration via portable-pty
  • PTY rendering in main view
  • Non-blocking PTY reading with background thread

Phase 3: VT100 Parsing ✅

  • ANSI escape sequence parsing (via vt100 crate)
  • Proper color and cursor support
  • Text attribute rendering (bold, italic, underline, etc.)

Phase 4: Session Multiplexing ✅

  • Dual PTY sessions (Shell + AI)
  • Toggle between Shell and AI with :t
  • State preservation between views
  • Both sessions process output simultaneously

Phase 5: LLM Summarization ✅

  • Background HUD updates via LLM (ollama, claude, etc.)
  • Context extraction from terminal content
  • Periodic summarization (every 30 seconds)
  • Manual refresh with :r command
  • Graceful fallback when LLM unavailable

Phase 6: Enhanced UX ✅

  • Mouse-based text selection with auto-copy
  • Scrollback navigation (mouse and keyboard)
  • Smart AI status with LLM-generated TL;DR
  • ChildKiller for clean process termination

License

MIT License - see LICENSE for details.

Releases

Releases are automated via cargo-dist. Binaries are available for:

Platform Architecture
macOS x86_64 (Intel), aarch64 (M1/M2)
Linux x86_64, aarch64
Windows x86_64

Download from GitHub Releases.

About

A cognitive terminal multiplexer written in Rust. Wraps your shell and AI assistants with a dynamic HUD to prevent context-switching fatigue.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors