rat is an experiment in composing shell commands to build interactive, text-based interfaces—think “tig-style” navigation with as little custom UI logic as possible. Rather than reimplementing features, it delegates work to existing tools: a shell command generates output, a pager displays it, and “annotators” attach actions to recognized patterns. For example, a mode might run git log --graph and annotate commit hashes so hitting a key can open a diff, check out a branch, or run a follow-up command. Another mode could list files or search results and let you act on selected lines, chaining shell operations together. The design encourages small, composable behaviors that feel like browsing within structured terminal output, while retaining the power of the underlying CLI. It’s a hacker-friendly approach to interactive workflows: leverage the ecosystem of commands you already trust, add a thin layer of annotations, and turn static listings into a navigable, actionable interface.
Features
- Modes: you can define “modes” composed of annotators + keybindings for specific behavior in a pager view
- Annotators: types include match, regex, or external, to identify ranges in command output to mark as clickable/interactive parts
- Keybindings: able to map keys to actions operating on those annotated lines (like open file, delete, preview etc.)
- Composition: can chain or combine shell commands, feed their output, etc.
- Configuration is via a ratrc file (in ~/.config/rat by default) to customize modes, annotators, keybindings etc.
- Experimental, evolving; output displayed via pagers; emphasizes delegating much of functionality to existing shell commands rather than re-writing functionality internally