Skip to content

avanboxel/snippy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snippy

A simple offline snippet manager for code snippets.

Installation

go install github.com/avanboxel/snippy@latest

Or build from source:

git clone https://github.com/avanboxel/snippy.git
cd snippy
go build -o snippy

Usage

Add a snippet

# Add from command line
snippy add "fmt.Println(\"Hello World\")" --lang go --tags example,basic

# Add from stdin
echo "console.log('Hello World')" | snippy add --lang js --tags example

# Add from file
snippy add --lang go --tags example < app.js

List snippets

# List all snippets
snippy list

# List a single snippet by id
snippy list --id 123
snippy list -i 123

# Filter by language
snippy list --lang go
snippy list -l go

# Filter by tags
snippy list --tags example
snippy list -t example

# Search by part of code
snippy list --search "Hello World"
snippy list -s "Hello World"

Clean snippets

# Clean all snippets
snippy clean

# Clean snippet by id
snippy clean --id 1234
snippy clean -i 1234

# Clean all snippets by language
snippy clean --lang go
snippy clean -l go

# Clean all snippets by tags
snippy clean --tags example
snippy clean -t example

# Clean all snippets by part of code
snippy clean --search "Hello World"
snippy clean -s "Hello World"

License

MIT

About

A simple offline CLI snippet manager written in Golang

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages