clisnips is a command-line snippets manager.
It provides a graphical command-line user interface in which you can save, search and recall your commands.
clisnips requires python 3.11 or higher.
The recommended way is to use pipx:
pipx install clisnips
# For bash
clisnips key-bindings bash
# For zsh
clisnips key-bindings zsh
Then:
- Either open a new shell or source your shell rc file,
- and type the
Alt+s
keyboard shortcut to open the snippets library.
Clisnips stores snippets in a local SQLite database, using an FTS5 table to enable full-text search. The search input accepts the whole FTS5 full-text query syntax.
Please have a look at the docs for getting started on writing your own snippets.
You may also read the quick-tour, a small TOML file containing some example snippets. You can import it in your snippets database by running:
clisnips import snippets/quick-tour.toml
In addition to its TUI, clisnips comes with a bunch of other subcommands
to help you manage your snippets. Please run clisnips --help
to read the CLI documentation.