pet

Command-line snippet manager written in Go. Save, tag, search, and run shell command snippets with parameters, stored in TOML and synced via Gist or GitLab.

install· Homebrew

pet is a command-line snippet manager written in Go, inspired by memo. It stores commands you rarely use or can't easily recall, along with descriptions and tags, so you can find them later instead of digging through shell history. Snippets are created with pet new (or pet new --multiline for multiline commands) and managed through subcommands such as list, search, exec, clip, edit, configure, and sync.

Snippets can include parameters written as <param> or <param=default_value>, including multiple default values per parameter. Snippets live in a TOML file that you can edit directly with pet edit, and a snippet can also store a command's output (displayed by pet list but not searchable). The config supports a custom editor, sort order, the shell command used to run snippets, an output format string, and multiple snippet directories or files. Interactive selection uses fzf or peco.

Shell integration is documented for bash, zsh, and fish. The README provides a prev function that registers the previous command with pet new, and a key binding (for example Ctrl-s in zsh) that runs pet search and puts the chosen snippet on the current command line, like Ctrl-r. Because the command lands in the shell buffer, running it adds it to shell history and lets you chain commands. A --raw mode lets you expand parameters with native shell editing instead of the built-in dialog. Snippets can be filtered by tag with -t, and an fzf alt+s binding can save a command from history.

pet can sync the snippet file through GitHub Gist, GitHub Enterprise, or GitLab Snippets, with an optional auto_sync setting that syncs on edits. The selected snippet can be copied to the clipboard with pet clip (the README mentions pbcopy on macOS). It is aimed at developers and operators who work across many tools and want a searchable, shareable set of commands.

Installation

# via Homebrew
brew install pet

Alternatives & related tools

add a badge to your README

Maintain pet? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/pet.svg)](https://www.trmn.sh/tools/pet?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/pet?utm_source=badge"><img src="https://www.trmn.sh/badge/pet.svg" alt="Featured on trmn" height="20"></a>