A fast and efficient command-line note-taking tool built with Go. Snip helps you capture, organize, and search your notes.
Snip
A fast and efficient command-line note-taking tool built with Go. Snip helps you capture, organize, and search your notes.
β¨ Features
Current Functionality
- π Create Notes: Quickly create new notes with title and content
- π List Notes: View all your notes with chronological sorting options
- π Search Notes: Full-text search across all notes using SQLite FTS4
- βοΈ Edit Notes: Update existing notes using your preferred editor
- π Get Notes: Retrieve specific notes by ID with markdown rendering support
- ποΈ Delete Notes: Remove notes you no longer need
- π·οΈ Tags: Organize notes with custom tags
- βοΈ Patch Notes: Update note titles and manage tags
- π€ Export Notes: Export notes to JSON and Markdown formats
- π₯ Import Notes: Import notes(markdown) from files and directories
- πΌοΈ Markdown Preview: Render markdown content beautifully in the terminal
- β‘ Fast Performance: SQLite database with optimized indexes (90-127ns operations)
- π§ Editor Integration: Supports nano, vim, vi, or custom
$EDITOR - π§ͺ Comprehensive Testing: Full test coverage with performance benchmarks
Command Examples
# Create a new note
snip create "Meeting Notes"
Create a new note quickly
snip create "World" --message "Hello!"
List all notes (newest first)
snip list
List notes chronologically (oldest first)
snip list --asc
List with verbose information
snip list --verbose
Search for notes containing specific terms
snip find "meeting"
Edit an existing note
snip update 1
Get a specific note by ID
snip show 1
Get a note with markdown rendering
snip show 1 --render
Delete a specific note by ID
snip delete 1
Patch/update a note's title
snip patch 1 --title "New Title"
Patch/update a note's tags
snip patch 1 --tag "work important"
List notes with tags
snip list --tag "work"
Export notes to JSON format
snip export --format json
Export notes to Markdown format
snip export --format markdown
Export notes created since a specific date
snip export --since "2024-01-01"
Import notes from a directory
snip import /path/to/notes/directory
Show editor information and available options
snip editor
π Installation
Package Managers
Scoop (Windows)
# Add the bucket
scoop bucket add snip https://github.com/matheuzgomes/Snip
Install snip
scoop install snip
Update snip
scoop update snip
Homebrew (macOS)
# Add the tap
brew tap matheuzgomes/homebrew-Snip
Install snip
brew install --cask snip-notes
Update snip
brew upgrade --cask snip-notes
β οΈ macOS Security Note:
If macOS blocks the app with "cannot be opened because the developer cannot be verified":
# Option 1: Remove quarantine attribute
xattr -d com.apple.quarantine /opt/homebrew/bin/snip
Option 2: Allow in System Settings
Go to: System Settings > Privacy & Security > Allow "snip"
Install With Go
You can install the snip binary directly using Go (requires Go 1.20+):
go install github.com/matheuzgomes/Snip@v1.1.0 (specific version)
The binary will be placed in $GOBIN (or $GOPATH/bin), make sure that directory is in your PATH.
Direct Download
Pre-compiled binaries are available in the releases page for:
- Linux: AMD64 and ARM64
- Windows: AMD64
From Source
git clone https://github.com/matheuzgomes/Snip.git
cd Snip
go build -o snip main.go
sudo mv snip /usr/local/bin/
ποΈ Data Storage
Snip stores your notes in a SQLite database located at ~/.snip/notes.db. The database includes:
- Main Table: Stores notes with metadata (ID, title, content, timestamps)
- Tags Table: Stores custom tags for organizing notes
- Notes-Tags Table: Many-to-many relationship between notes and tags
- FTS Table: Full-text search index for fast searching
- Automatic Triggers: Keeps search index synchronized with your notes
π§ Configuration
Editor Selection
Snip automatically detects your preferred editor with cross-platform support:
Windows:
- Visual Studio Code, Notepad++, Sublime Text, Atom, Micro, Nano, Vim, Notepad
- Visual Studio Code, Sublime Text, Atom, Nano, Vim, Vi, Open
- Nano, Vim, Vi, Micro, Visual Studio Code
$EDITORenvironment variable- Platform-specific editor detection
- Smart fallback to basic editors
Check Available Editors:
snip editor
Database Location
The database is automatically created at ~/.snip/notes.db. You can backup your notes by copying this file.
π οΈ Development
Prerequisites
- Go 1.21 or later
- SQLite3 development libraries (for CGO builds)
- mingw-w64 (for Windows cross-compilation)
Building
git clone https://github.com/matheuzgomes/Snip.git
cd Snip
go mod download
go build -o snip main.go
Running Tests
# Run all tests
make test
Run performance benchmarks
make bench
Run tests with verbose output
go test -v ./internal/test/...
πΊοΈ Roadmap
Coming Soon
ποΈ Delete Notes: Remove notes you no longer needβ Done!π·οΈ Tags: Organize notes with custom tagsβ Done!βοΈ Patch Notes: Update note titles and manage tagsβ Done!π€ Export: Export notes to various formats (Markdown, JSON, etc.)β Done!π₯ Import: Import notes from files and directoriesβ Done!π§ͺ Testing: Comprehensive test suite with benchmarksβ Done!πΌοΈ Markdown Preview: Visualize rendered Markdown so you can see your notes as they'd appear formattedβ Done!
Performance Metrics
Snip v1.1.0 delivers exceptional performance:
- β‘ Sub-microsecond Operations: Core operations run in 90-127 nanoseconds
- πΎ Memory Efficient: Only 56 bytes per operation with 3 allocations
- π§ͺ 100% Test Coverage: Comprehensive test suite with performance benchmarks
- π Benchmarking: Built-in performance monitoring with
make bench
Release Automation
We're using GoReleaser for:
- β Automated Builds: Cross-platform binary generation (Linux AMD64/ARM64, Windows AMD64)
- β Release Management: Automated GitHub releases
- β Package Distribution: Scoop, Homebrew, and Winget package managers
- β Cross-compilation: Windows binaries built with mingw-w64
- β CGO Support: SQLite integration with proper CGO compilation
- β CI/CD Pipeline: Automated testing and release pipeline