How shobrook/wut works
wut is a terminal-output explanation CLI: a user runs it after a command, the CLI validates the tmux/screen and model configuration, gathers shell history, and requests an explanation or answer from a configured LLM before displaying Markdown. The sampled code shows shell/context/explanation calls and provider dispatch; several context-building internals are omitted, so those relationships are not expanded. README-documented provider options are retained as separate integrations.
Main entry points: utils.py Explain and dispatch · wut.py wut CLI · prompts.py Prompt templates
Components 15
CLI entry
- wut CLI
wut/wut.py
Terminal context
- Shell detection
wut/utils.py - Pane capture
wut/utils.py - Command history
wut/utils.py - Context assembly
wut/utils.py
Prompt and inference
- Prompt templates
wut/prompts.py - Explain and dispatch
wut/utils.py - Markdown formatting
wut/utils.py
LLM providers
- OpenAI client
wut/utils.py - Anthropic client
wut/utils.py - Ollama client
wut/utils.py
Other components
- Terminal user
- OpenAI service
- Anthropic service
- Ollama model
Connections 16
- Terminal user → wut CLI: runs
README.md - wut CLI → Shell detection: detects shell
wut/wut.py - wut CLI → Context assembly: gathers context
wut/wut.py - wut CLI → Explain and dispatch: requests explanation
wut/wut.py - Shell detection → Pane capture
wut/utils.py - Pane capture → Command history
wut/utils.py - Command history → Context assembly
wut/utils.py - Prompt templates → Explain and dispatch: supplies templates
wut/utils.py - Explain and dispatch → OpenAI client: dispatches
wut/utils.py - Explain and dispatch → Anthropic client: dispatches
wut/utils.py - Explain and dispatch → Ollama client: dispatches
wut/utils.py - OpenAI client → OpenAI service: requests completion
wut/utils.py - Anthropic client → Anthropic service: requests message
wut/utils.py - Ollama client → Ollama model: requests chat
wut/utils.py - Explain and dispatch → Markdown formatting: formats response
wut/utils.py - Markdown formatting → wut CLI: returns for display
wut/wut.py