Skip to content
Snipline CLI is the command-line tool for Snipline
CSS Crystal JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Snipline CLI

Snipline CLI is the command-line tool for Snipline.

SnipCLI Preview

Snipline CLI allows you to search and run commands from your Snipline account directly through the command-line. It is also possible to use this for free without a Snipline account (See the documentation on using without a Snipline Account).


Homebrew (MacOS and Linux)

Snipline CLI is available through Homebrew for MacOS and Linux.

brew install snipline/snipline/snipcli

Snapcraft (Linux)

Linux users can download via Snapcraft

sudo snap install snipcli --beta

From source

Snipline CLI requires Crystal 0.29.0 to be installed to install from source

# Install dependencies
# Build app
crystal build src/ -o snipcli --release


Syncing to Snipline

Log-in to your Snipline account and sync your snippets.

Follow login instructions (Enter email and token)

snipline login

Download snippets from your account

snipline sync

This will create two files on your system: ~/.config/snipline/config.toml and ~/.config/snipline/snippets.json.

Searching snippets

A basic search can be done with the search command.

snipline search <searchterm>

Search options include field, and limit. See snipcli search --help for more information

Web interface

Snipline CLI comes with a lightweight web interface. To use it run

snipcli web

You can then view and edit snippets through a web browser. By default this works locally on port 9876, however, you can specify it to be accessible remotely with the following arguments.

snipcli web -p 3000 -b

Using Snipline CLI without a Snipline Account

Snipline CLI can be used without an active Snipline account. But requires either manually entering data in the ~/.config/snipline/snippets.json file or using the web interface.

To generate the initial configuration files use the init command.

snipcli init

At this moment the web interface does not support CRUD commands and manual entry is required.

Here is an example ~/.config/snipline/snipets.json` file to get started.

Note that id of null means that it has not been synced to a Snipline account. It will be lost if snipcli sync is ever run to fetch snippets from Snipline.

            "name":"Symlink directory",
            "real-command":"ln -s #{[Source]} #{[Destination]}",
            "tags":["file", "linux"]


See the Installation section on building from source.

Set log levels for additional development output.

crystal build src/ -o snipcli
env LOG_LEVEL=DEBUG ./snipcli search git

To change the config file location (For testing) use the CONFIG_FILE environment variable.

env CONFIG_FILE=./spec/fixtures/config.toml ./snipcli search git


See the Contributing guide for details.


  • More tests.
  • Create snippets through web interface.
  • Edit snippets through web interface.
  • Delete snippets through web interface.
  • More documentation (Including usage without a Snipline account).
  • Table formatting for search results.


You can’t perform that action at this time.