Simple & intuitive command line utility to store cheat sheet snippets
People who work with command line prompts (a.k.a terminal) often need to memorise long commands, parameters or configuration values. When it's too much to remember we start digging into command help manuals, or search through cheatsheet artefacts such as online notes or jungles of post-its on our desks, in which cases we are taken out of our workflow and context, generally resulting in a loss of our focus and time.
A tool for saving short notes, cheatsheets for terminal commands (or anything organised by text tags). In other words:
A stupid simple command line utility to save single line code snippets.
brew tap crocodile/tap
brew install dave
# I'd like to remember what ls -l does
dave remember ls "ls -l" "Lists directory contents in a long format."
(Tag is just a text look up identifier. Can be the name of the command or anything else.)
# Tell me what the remembered snippets are for ls
dave tellme ls
dave remember [tag] [snippet] [description]
or in short format:
dave r [tag] [snippet] [description]
or interactively via input prompts:
dave r # follow the input prompts
dave tellme [tag]
or in short format:
dave t [tag]
(This will attempt to open the csv file containing the snippets with the application associated with it on your computer.)
dave show
or in short format:
dave s
dave help
or in short format:
dave h
dave version
or in short format:
dave v
Snippets by default are saved in the dave.csv file located in the $HOME/.smart-snippets hidden folder.
-
Make sure that the $HOME environment variable is set.
-
To change where the
$HOME/.smart-snippets/dave.csv
file gets saved, move it to the desired location then update the filepath variable in the$HOME/.smart-snippets/dave.conf
file.Example:
#!/bin/bash
filepath=$HOME"/Documents/smart-snippets/dave.csv" # Changed from filepath=$HOME"/.smart-snippets/dave.csv"