IDE and terminal snippets
What is Pet? An introduction to knqyf263's command-line snippet manager
Pet is a simple command-line snippet manager. It lets you save, tag, search and execute command-line snippets from the terminal. It was built because complex or rarely used commands are hard to remember and hard to find in shell history.
- Tool
- Pet
- Made by
- knqyf263
- Official site
- github.com/knqyf263/pet
- Category
- IDE and terminal snippets
Who makes Pet
Pet is made by knqyf263. The official website is the project's GitHub repository, linked below.
Official website: github.com/knqyf263/pet
What Pet is for
Pet is for keeping commands you cannot easily remember. Shell history holds a lot of noise, and a command you ran once months ago is hard to retrieve. Pet gives those commands a dedicated store where you can save them, attach tags, search them and run them again.
Snippets can contain parameters with default values, and a parameter can have one or several defaults. Multiline commands are supported, so longer command sequences can be saved as a single snippet.
Who Pet is for
The vendor describes the audience as developers who work across many command-line tools. If you regularly use commands with long flag lists or commands you touch only occasionally, a searchable collection saves repeated lookups.
Pet is written in Go and distributed as binary releases.
Notable capabilities
Pet covers the full loop from capturing a command to running it again, with options for syncing and sharing.
- Saving, tagging, searching and executing command-line snippets, with tags for faster searching.
- Parameters with one or several default values.
- Multiline command support.
- Snippets stored in an easily edited TOML config file.
- New snippets created with the pet new command.
- Shell config for registering the previous command easily in bash or zsh, and registering commands from history when using fzf.
- Parameter expansion in the shell rather than in the built-in TUI dialog.
- Sync via Gist or GitLab Snippets, plus sharing via Gist.
How Pet fits IDE and terminal snippets
In the category of IDE and terminal snippets, Pet is the terminal side. It works with commands rather than source code, and it lives in the shell instead of inside an editor.
In Snipspire's wider niche of snippet managers, code paste and developer snippet tools, it is a personal command library with optional sync and sharing. Syncing through Gist or GitLab Snippets keeps snippets available beyond a single machine, and Gist can also be used to share them.
A few smaller details are worth knowing. On macOS, snippets can be copied to the clipboard with pbcopy. Command output can be stored with a snippet, but it is not searched.
Frequently asked questions
What is Pet used for?
Pet is used to save, tag, search and execute command-line snippets. It was built because complex or rarely used commands are hard to remember and find in shell history.
Who develops Pet?
Pet is developed by knqyf263. It is written in Go and distributed as binary releases.
Where does Pet store snippets?
Snippets are stored in an easily edited TOML config file. They can sync via Gist or GitLab Snippets.
Does Pet support parameters?
Yes. Snippets can contain parameters with one or several default values. Parameters can be expanded in the shell rather than the built-in TUI dialog.
Does Pet work with bash, zsh and fzf?
Shell config lets you register the previous command easily in bash or zsh. Pet can also register commands from history when using fzf.
Snipspire is independent and is not affiliated with knqyf263. Product names belong to their owners. Features change; confirm details on the official website.