pet for Mac
Pet - CLI Snippet Manager
pet — overview
Pet - CLI Snippet Manager
Motivation
pet is a simple command-line snippet manager (inspired by memo).
I have a hard time remembering complex command or ones that I rarely use. Moreover, it is difficult to find them in shell history.
It's time to let go of the expectation of remembering every command, and focus on productivity and finding the right commands as fast as possible. It's fun when you're 2 years in and work with 2 tools, but less so when you're a decade in and work across backend/frontend/infrastructure with tons of tools. You most probably relate to this if you're a developer.
pet is a simple tool that allows you to save, tag, search, and execute command-line snippets easily! It's now nearly 8 years old and is used by many developers around the world.
pet is written in Go, and therefore you can just grab the binary releases and drop it in your $PATH.
You can use variables (` or ) in snippets.
TOC Main features Parameters Examples Register the previous command easily bash zsh fish Select snippets at the current line (like C-r) (RECOMMENDED) bash zsh fish Copy snippets to clipboard Features Edit snippets Sync snippets Hands-on Tutorial Usage Snippet Configuration Selector option Tag Sync Auto Sync Installation Binary macOS / Homebrew RedHat, CentOS Debian, Ubuntu Archlinux Build Migration Contribute
Main features pet has the following features. Register your command snippets easily. Use variables (with one or several default values) in snippets. Search snippets interactively Run snippets directly. Edit snippets easily (config is just a TOML file). Sync snippets via Gist or GitLab Snippets automatically.
Creating a snippet
You can create a snippet by running pet new.
To see all available arguments, run pet new --help.
Multiline commands can be entered by using the multiline argument pet new --multiline
You can use also use variables in snippets, these are called parameters. More information on that in the next section.
You can also tag snippets to search for them faster. More information on that in the tag section.
Parameters There are ways of entering parameters.
They can contain default values: Hello defined by the equal sign.
They can even contain where the default value would be spaces & = signs>.
Default values just can't .
They can also contain multiple default values: Hello
The values in this case would be :Hello John_||_Sam_||_Jane Doe = special #chars_|>
Examples Some examples are shown below.
Register the previous command easily By adding the following config to .bashrc or .zshrc, you can easily register the previous command.
bash prev function
zsh prev function
fish See below for details. https://github.com/otms61/fish-pet
Select snippets at the current line (like C-r) (RECOMMENDED)
Details
简单的命令行片段管理器
How to install pet
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- Run this command:
Latest 10 releases
Last updated 2024-12-08; current version v1.0.1, with the latest 10 releases listed.
| Version | Released | Type | Size | macOS | Windows | Linux |
|---|---|---|---|---|---|---|
| v1.0.1 | 2024-12-08 | Stable | 4.2 MB | Download | Download | Download |
| v1.0.0 | 2024-11-28 | Stable | 3.9 MB | Download | Download | Download |
| v0.9.1 | 2024-10-29 | Stable | 3.9 MB | Download | Download | Download |
| v0.9.0 | 2024-08-19 | Stable | 3.9 MB | Download | Download | Download |
| v0.8.4 | 2024-05-08 | Stable | 3.8 MB | Download | Download | Download |
| v0.8.1 | 2024-05-02 | Stable | 3.8 MB | Download | Download | Download |
| v0.7.1 | 2024-04-20 | Stable | 3.8 MB | Download | Download | Download |
| v0.7.0 | 2024-03-05 | Stable | 3.8 MB | Download | Download | Download |
| v0.6.3 | 2024-02-25 | Stable | 3.8 MB | Download | Download | Download |
| v0.6.2 | 2024-02-17 | Stable | 3.8 MB | Download | Download | Download |
Data from GitHub Releases; stable releases first, each group sorted newest first.
Prebuilt bottle platforms
Official Homebrew bottles cover:
- Apple silicon · latest macOS
- Apple silicon · macOS 26 Tahoe
- Apple silicon · macOS 15 Sequoia
- Apple silicon · macOS 14 Sonoma
- Intel · macOS 14 Sonoma
- Linux · ARM64
- Linux · x86_64
Compared with similar apps
Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| pet | v1.0.1 | MIT | CLI | 26 |
| openssl@4 | openssl-4.1.0 | Apache-2.0 | CLI | 494,798 |
| xz | v5.8.4 | 0BSD AND GPL-2.0-or-later | CLI | 346,605 |
| pkgconf | pkgconf-3.0.10 | ISC | CLI | 311,054 |
Similar apps: Command-line Tools
openssl@4
Cryptography and SSL/TLS Toolkitxz
General-purpose data compression with high compression ratiopkgconf
pkgconf is a program which helps to configure compiler and linker flags for development…node
Node.js is an open-source, cross-platform JavaScript runtime environment.gh
GitHub command-line toolcmake
CMake is a cross-platform, open-source build system generator.Categories: Command-line Tools