clisnips

A command-line snippets manager.


Keywords
snippet, snippets, cli, tui, python
License
GPL-3.0+
Install
pip install clisnips==0.6.0

Documentation

clisnips

clisnips is a command-line snippets manager.

xkcd/tar

It provides a graphical command-line user interface in which you can save, search and recall your commands.

Installation

clisnips requires python 3.11 or higher.

1. Install clisnips

The recommended way is to use pipx:

pipx install clisnips

2. Install shell key-bindings

# 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.

Usage

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.