|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Ohmyzsh||156,988||1||3||2 days ago||1||December 07, 2014||633||mit||Shell|
|🙃 A delightful community-driven (with 2,100+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.|
|Terminal||88,167||14 hours ago||1,544||mit||C++|
|The new Windows Terminal and the original Windows console host, all in the same place!|
|Tldr||43,631||18 hours ago||232||other||Markdown|
|📚 Collaborative cheatsheets for console commands|
|Bat||40,348||1||35||2 days ago||37||September 10, 2022||177||apache-2.0||Rust|
|A cat(1) clone with wings.|
|Cheat.sh||34,865||18 days ago||114||mit||Python|
|the only cheat sheet you need|
|Lazygit||33,632||2||16 hours ago||209||July 18, 2022||443||mit||Go|
|simple terminal UI for git commands|
|Httpie||27,018||1,645||42||a day ago||55||May 06, 2022||143||bsd-3-clause||Python|
|🥧 HTTPie for Terminal — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.|
|Awesome Shell||26,944||8 days ago||82||cc0-1.0|
|A curated list of awesome command-line frameworks, toolkits, guides and gizmos. Inspired by awesome-php.|
|Fd||26,885||2 days ago||24||May 29, 2022||78||apache-2.0||Rust|
|A simple, fast and user-friendly alternative to 'find'|
|Modern Unix||25,548||2 months ago||83|
|A collection of modern/faster/saner alternatives to common unix commands.|
Compose shell commands to build terminal applications
Rat was developed as part of an effort to build a tig-like application with very little opinionated UI logic, delegating instead to the capabilities of shell commands like
git log with its
Shell commands are executed and the output is captured and displayed in pagers. Configurable annotators parse through the output, adding annotations that can be acted upon to run other shell commands.
WARNING: THIS IS ALL SUPER EXPERIMENTAL AND IS PROBABLY GOING TO CHANGE A LOT
$ go get github.com/ericfreese/rat $ go build && go install
Rat is configured through a file
ratrc in your home config directory (
~/.config/rat by default).
Rat pagers can be opened in one or more "modes". A mode is a configuration of "annotators" and "key bindings":
First you'll need to set up some keybindings. Add the following to your
ratrc and modify as desired:
bindkey C-r reload bindkey j cursor-down bindkey k cursor-up bindkey C-e scroll-down bindkey C-y scroll-up bindkey C-d page-down bindkey C-u page-up bindkey g,g cursor-first-line bindkey S-g cursor-last-line bindkey S-j parent-cursor-down bindkey S-k parent-cursor-up bindkey q pop-pager bindkey S-q quit bindkey M-1 show-one bindkey M-2 show-two bindkey M-3 show-three
ctrl+c will always quit.
mode keyword starts a mode definition.
mode <name> ... end
Inside of a mode definition, the
annotate keyword starts an annotation definition.
mode <name> annotate <type> <class> -- <options> end
type: The annotator type. Can be "match", "regex", or "external".
class: The class to apply to any annotations that this annotator finds.
typeis "match", this should be a shell command that outputs newline-delimited strings that the annotator will search for.
typeis "regex", this should define a regular expression to search for (Golang regular expressions are supported).
typeis "external", this should be the name of an executable located in
~/.config/rat/annotators/that will be executed and sent the content of the pager via STDIN. The executable should print annotations to STDOUT in a specific binary format:
bindkey keyword starts a keybinding definition.
mode <name> bindkey <key> [<annotation-classes>] [<new-pager-mode>] -- <action> end bindkey <key> <action> bindkey <key> <new-pager-mode> -- <cmd>
key: A key combination that will trigger this action when pressed. Modifiers are added with
lib/key_event.gofor a list of supported named keys.
action: A named action to run when the key is pressed. See action.go for a list of available actions.
annotation-classes: This action will only be triggered if annotations of these classes are present on the current line. If omitted, keybinding will work anywhere in the pager. These should be comma-delimited.
new-pager-mode: If the action will create a new pager, this defines the mode(s) to use when creating that pager.
cmd: A shell command to run when the specified key combination is pressed. Annotation values will be exported to the command process as variables named for their annotation class. The default is to open a new pager showing the output of the shell command, but several special prefixes can be used to specify different actions to be taken:
!: Do not open a new pager. Execute the command and reload the current pager.
!, but confirm with the user first (will have to press 'y' for yes or 'n' for no).
>: Like the default, open a new pager with the contents of the shell command, but also set up a parent-child relationship so that the parent cursor can be moved up and down from inside the child pager with the
Note: Keybindings that are not inside of a mode definition will always be available and do not have the special prefix behavior described above.
source keyword imports configuration rules from another file.
file: The path (relative to the rat config directory) to a file that contains valid rat configuration instructions
Add the following to your
ratrc to build a simple file viewer/manager:
mode files # Find all files (not directories) in the current directory and # annotate with the class "file". annotate match file -- ls -a1p | grep -v / # When the cursor is on a line with an annotation of class "file" and # the `enter` key is pressed, run `cat` with the value of the # annotation (the filename) and display the output in a new pager with # mode "preview". bindkey enter file preview -- >cat $file # When the cursor is on a line with an annotation of class "file" and # the `e` key is pressed, open the selected file in vim. bindkey e file -- !vim $file # When the cursor is on a line with an annotation of class "file" and # Shift + `x` is pressed, delete the file if the user confirms it. bindkey S-x file -- ?!rm $file end
rat --mode files --cmd 'ls -al' to try it out. You should see the output of
ls -al. Move your cursor to a line with a regular file on it and press Enter to view its contents. Try out the other keybindings. Try tweaking some things.
examples/ directory for more configuration examples.
rat [--mode=<mode>] [--cmd=<command>]
--mode defaults to
--cmd is not provided, rat will read from STDIN.
Dependencies are managed using
This project is licensed under MIT license. For the full text of the license, see the LICENSE file.