https://github.com/ju1ius/clisnips
A command-line snippets manager.
https://github.com/ju1ius/clisnips
cli python snippets tui
Last synced: 10 months ago
JSON representation
A command-line snippets manager.
- Host: GitHub
- URL: https://github.com/ju1ius/clisnips
- Owner: ju1ius
- License: gpl-3.0
- Created: 2014-06-05T03:34:47.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2023-11-24T13:20:45.000Z (over 2 years ago)
- Last Synced: 2025-09-02T22:52:17.612Z (10 months ago)
- Topics: cli, python, snippets, tui
- Language: Python
- Homepage:
- Size: 919 KB
- Stars: 15
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clisnips
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.
## Installation
clisnips requires python 3.11 or higher.
### 1. Install clisnips
The recommended way is to use [pipx](https://pypa.github.io/pipx/):
```sh
pipx install clisnips
```
### 2. Install shell key-bindings
```sh
# 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][fts5-ref].
Please have a look at [the docs][docs-folder] for getting started on
[writing your own snippets][creating-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:
```sh
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.
[quick-tour]: https://github.com/ju1ius/clisnips/blob/master/snippets/quick-tour.toml
[docs-folder]: https://github.com/ju1ius/clisnips/blob/master/docs/
[creating-snippets]: https://github.com/ju1ius/clisnips/blob/master/docs/creating-snippets.md
[fts5-ref]: https://www.sqlite.org/fts5.html#full_text_query_syntax