Snipline CLI allows you to organise and use your favourite shell commands from the terminal. It can optionally sync to your Snipline account.
Snipline CLI is available through Homebrew for MacOS and Linux.
brew install snipline/snipline/snipcli
Linux users can download via Snapcraft
sudo snap install snipcli --beta
Snipline CLI requires Crystal 0.30.1 to be installed to install from source
# Clone the repo git clone firstname.lastname@example.org:snipline/snipcli.git # Checkout the latest release git checkout <tagname - e.g. 0.3.1> # Make sure you have the same Crystal installed that's required in shard.yml crystal -v # Install dependencies shards # Build app crystal build src/snipline_cli.cr -o snipcli --release -o snipcli ./snipcli --version
Upgrading Snipline CLI depends on your method of installation
# Homebrew brew upgrade snipline/snipline/snipcli # Snapcraft snap refresh # From Source git pull origin master git checkout <tagname - e.g. 0.3.1> crystal -v # confirm Crystal is the same as shard.yml requirement shards crystal build src/snipline_cli.cr -o snipcli --release -o snipcli ./snipcli --version
Snipline CLI can be used without an active Snipline account.
To generate the initial configuration files use the
The above command will generate a
config.toml file and a
snippets.json file in your
Log-in to your Snipline account and sync your snippets.
Follow login instructions (Enter email and token)
A basic search can be done with the
If you wish to pre-filter the results you can do so by adding a search term and specify the field to search on.
snipcli search <searchterm> --field=tags
Search options include
snipcli search --help for more information
Note that as of 0.2.0 it's not possible to search and copy to clipboard from a Linux VM/SSH session. Use
run to run the command directly from your terminal session.
You can create a new snippet by using the
new command. This will open a TOML file in the text editor of your preference. Once closed it will attempt to add it to your
snippets.json file and sync to your Snipline Account.
As of 0.3.0 the web interface has been removed infavour of the new TUI.
See the Installation section on building from source.
Set log levels for additional development output.
crystal build src/snipline_cli.cr -o snipcli env LOG_LEVEL=DEBUG ./snipcli search git
To change the config file location (For testing) use the
CONFIG_FILE environment variable.
There is an example already in place for testing located in
env CONFIG_FILE=./config.spec.toml crystal spec
See the Contributing guide for details.
--dry-runflag to see what will change during sync.
--verboseflag to see what has changed during sync.
synccommand now migrates the Sqlite database.
newcommand to create new snippets from command line.
searchcommand to run the selected snippet
searchcommand now copies the selected snippet instead of running.