# knqyf263/pet

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/knqyf263-pet).**

5,270 stars · 246 forks · Go · MIT

## Links

- GitHub: https://github.com/knqyf263/pet
- awesome-repositories: https://awesome-repositories.com/repository/knqyf263-pet.md

## Topics

`command-line` `go` `golang` `linux` `snippets` `standalone`

## Description

Pet is a command-line snippet manager used for storing, tagging, and executing frequently used shell commands and scripts. It functions as an interactive command selector and a shell history capture tool, allowing users to extract one-off commands from their history and save them as reusable snippets.

The tool distinguishes itself by integrating a git-synced configuration manager, which uses remote git provider APIs and access tokens to keep snippet collections consistent across multiple devices. It also features an interactive search interface that supports tag-based categorization for browsing and launching saved commands.

The system supports shell workflow automation through dynamic parameter expansion, prompting for user input or applying default values before executing commands in a native shell process. Snippets are organized via tag-based indexing and stored in local flat-files, with support for managing collections across multiple directories and project-specific configurations.

The project is written in Go and can be compiled into a standalone executable binary for local installation.

## Tags

### Development Tools & Productivity

- [Terminal Command Snippets](https://awesome-repositories.com/f/development-tools-productivity/snippet-management-tools/reusable-content-snippets/terminal-command-snippets.md) — Provides a system for storing and organizing frequently used terminal commands to avoid memorizing complex flags.
- [Code Snippet Execution](https://awesome-repositories.com/f/development-tools-productivity/code-snippet-execution.md) — Runs saved command snippets directly in the shell with support for parameter expansion. ([source](https://github.com/knqyf263/pet#readme))
- [Snippet Search](https://awesome-repositories.com/f/development-tools-productivity/command-options/snippet-search.md) — Provides an interactive selector to locate saved commands and filter results by tags. ([source](https://github.com/knqyf263/pet#readme))
- [Git-Based Configuration Synchronization](https://awesome-repositories.com/f/development-tools-productivity/git-based-configuration-synchronization.md) — Synchronizes snippet collections across multiple devices using remote Git provider APIs and access tokens.
- [Git-Synced Configuration Managers](https://awesome-repositories.com/f/development-tools-productivity/git-synced-configuration-managers.md) — Integrates a Git-synced manager to keep snippet collections consistent across multiple devices.
- [Interactive Command Interfaces](https://awesome-repositories.com/f/development-tools-productivity/interactive-command-interfaces.md) — Provides a searchable interface for browsing saved snippets and launching them with parameters.
- [Local Shell Executions](https://awesome-repositories.com/f/development-tools-productivity/shell-command-execution/local-shell-executions.md) — Spawns native shell processes to run expanded snippet strings directly within the user terminal.
- [Shell Command Search](https://awesome-repositories.com/f/development-tools-productivity/shell-command-search.md) — Enables quick discovery of shell snippets through interactive filtering and tag-based categorization.
- [Cross-Device Synchronization](https://awesome-repositories.com/f/development-tools-productivity/snippet-management-tools/reusable-content-snippets/terminal-command-snippets/cross-device-synchronization.md) — Keeps terminal command libraries consistent across multiple devices using remote Git synchronization.
- [History Capturing](https://awesome-repositories.com/f/development-tools-productivity/terminal-shell-cli/terminal-cli-enhancements/shell-terminal-utilities/general-enhancements-tooling/terminal-utilities/shell-configuration-customization/shell-history-managers/history-capturing.md) — Provides the capability to capture and save one-off commands from shell history as reusable snippets. ([source](https://github.com/knqyf263/pet#readme))
- [Interactive Selection Interfaces](https://awesome-repositories.com/f/development-tools-productivity/terminal-text-interaction/interactive-selection-interfaces.md) — Provides a searchable terminal interface to visually browse and select command snippets.
- [Dynamic Parameter Expansion](https://awesome-repositories.com/f/development-tools-productivity/code-snippet-execution/dynamic-parameter-expansion.md) — Implements dynamic parameter expansion that prompts for user input or applies default values before executing shell commands. ([source](https://github.com/knqyf263/pet#readme))
- [Label-Based Categorization](https://awesome-repositories.com/f/development-tools-productivity/label-based-categorization.md) — Enables organizing and filtering shell snippets using metadata labels to group them by function. ([source](https://github.com/knqyf263/pet/blob/main/README.md))
- [History Capture](https://awesome-repositories.com/f/development-tools-productivity/shell-history-importers/history-capture.md) — Extracts commands from shell history to be saved as reusable and documented snippets.
- [History-to-Snippet Conversion](https://awesome-repositories.com/f/development-tools-productivity/shell-history-managers/history-to-snippet-conversion.md) — Allows users to extract one-off commands from shell history and save them as reusable snippets.
- [Shell Workflow Optimizers](https://awesome-repositories.com/f/development-tools-productivity/shell-workflow-optimizers.md) — Speeds up repetitive terminal tasks by executing saved command sequences with dynamic parameters.
- [Snippet Collection Loading](https://awesome-repositories.com/f/development-tools-productivity/snippet-collection-loading.md) — Supports loading commands from multiple directories and project-specific configuration files. ([source](https://github.com/knqyf263/pet/blob/main/README.md))

### Data & Databases

- [Snippet Synchronization](https://awesome-repositories.com/f/data-databases/local-databases/remote-synchronization/snippet-synchronization.md) — Synchronizes local snippet files with remote Git providers using access tokens. ([source](https://github.com/knqyf263/pet#readme))
- [Flat-File Storage](https://awesome-repositories.com/f/data-databases/flat-file-storage.md) — Uses flat-file storage to ensure snippet collections are portable and human-readable.
- [Item Tagging and Organization](https://awesome-repositories.com/f/data-databases/tag-based-search/item-tagging-and-organization.md) — Organizes snippets with metadata labels to enable filtered searching and logical grouping.

### Software Engineering & Architecture

- [Dynamic Parameter Prompts](https://awesome-repositories.com/f/software-engineering-architecture/recursive-variable-expansion/shell-variable-expansions/dynamic-parameter-prompts.md) — Implements dynamic parameter expansion by prompting for user input or applying defaults before executing snippets.
