Snip (snippets) is a command-line tool for managing your snippets using a local SQLite database.
This command installs the binary in your GOBIN directory (default: ~/go/bin
). It also creates a SQLite database file at a fixed location in your home directory: ~/.config/snip/local.db
.
go install github.com/iamhectorsosa/snip@latest
Note: This tool is currently implemented only for macOS (Darwin). Support for other operating systems has not been implemented yet.
Manage snippets with the same known patterns as aliases. Calling snippets automatically copies them to your system clipboard. Snip can import and export from/to CSV, supporting both local and remote paths/URLs for flexibility.
Here are some basic commands:
# Creates a snippet
❯ snip [key='value']
# Calls a snippets
❯ snip [key]
# Export snippets
❯ snip export --path ~/
# Import snippets
❯ snip import --url https://gist..
# List of snippets
❯ snip ls
SNIP Found 6 snippets...
KEY VALUE
grep-s grep -rn "$1" .
gh-rm-b git branch | grep -v "^\*" | xargs git branch -d
gh-config git config --list | grep -E "user.email|user.name|user.signingkey|commit.gpgsign"
ls-h ls -d .*
gh-rm rm -rf .git
go-bin ls -l ~/go/bin
Run the help command to get an updated list of all commands.
❯ snip help
Snip is a CLI tool for managing your snippets.
To get a snippet, use: snip [key] [...$1]
To add snippets, use: snip [key='value']
Usage:
snip [key] [...$1] | [key='value'] [flags]
snip [command]
Available Commands:
delete Delete a snippet
export Export all snippets
help Help about any command
import Import snippets
ls List all snippets
reset Reset all snippets
update Update a snipppet
- Clone the repository:
gh repo clone iamhectorsosa/snip
cd snip
- Build the project:
CGO_ENABLED=1 go build -v -o snip .