A CLI/TUI-based scratchpad application for quickly storing notes, todos, and thoughts. Built with Go and charm.sh tools.
- Daily Scratchpad: Automatically creates a new scratchpad for each day
- TUI Interface: Beautiful terminal user interface using charm.sh/bubbletea
- Markdown Support: Write notes in markdown format with rich rendering
- Calendar View: Browse and select historical scratchpads with TUI
- Notebook View: Browse all scratchpads with markdown rendering and navigation
- External Editor Integration: Use your preferred editor (vim, VSCode, etc.)
- Auto-save: Content is automatically saved when you exit the editor
- Clean Daily Reset: Each day starts with a fresh scratchpad
- Vim-style Navigation: Familiar key bindings throughout the interface
- Go 1.24.4 or later
git clone https://github.com/pders01/sp.git
cd sp
go build -o sp ./cmd/spgo install ./cmd/sp# Open today's scratchpad
sp
# Open calendar view to select a date
sp --calendar
# Open notebook view to browse all scratchpads
sp --notebookThe application uses your preferred editor for editing scratchpads. It will:
- Check
$EDITORenvironment variable first - Check
$VISUALenvironment variable as fallback - Use platform-specific defaults (vim, nano, etc.)
Supported editors include:
- Terminal editors: vim, nvim, nano, micro, emacs
- GUI editors: VSCode, Sublime Text, Atom, gedit, kate
- Platform editors: Notepad (Windows), TextEdit (macOS)
To set your preferred editor:
export EDITOR=vim
# or
export EDITOR="code --wait"- Arrow Keys: Navigate through dates
- Enter: Select a date and open its scratchpad
- Ctrl+C or Esc: Exit calendar without selection
The notebook view provides a full-screen interface for browsing all scratchpads with rich markdown rendering:
- Page Navigation:
←/h(previous),→/l(next) - Content Scrolling:
↑/k(up),↓/j(down) - Page Scrolling:
Ctrl+u(page up),Ctrl+d(page down),b/f(full page) - Jump to:
g(top),G(bottom) - Quit:
qorCtrl+c
The interface automatically shows neighboring dates in the footer and provides smooth navigation between pages.
Scratchpads are stored as JSON files in ~/.sp/ directory:
~/.sp/
├── 2024-01-15.json
├── 2024-01-16.json
└── 2024-01-17.json
Each file contains:
- Date
- Content (markdown text)
- Creation timestamp
- Last modified timestamp
sp/
├── cmd/sp/
│ └── main.go # CLI entry point with Cobra integration
├── internal/
│ ├── editor/
│ │ └── editor.go # External editor integration
│ ├── scratchpad/
│ │ └── scratchpad.go # Core scratchpad logic
│ └── tui/
│ ├── calendar.go # Calendar view component
│ └── notebook.go # Notebook view component
├── go.mod
└── README.md
github.com/charmbracelet/bubbletea- TUI frameworkgithub.com/charmbracelet/bubbles- TUI components (viewport, textarea)github.com/charmbracelet/lipgloss- Stylinggithub.com/charmbracelet/glamour- Markdown renderinggithub.com/spf13/cobra- CLI frameworkgithub.com/stretchr/testify- Testing framework
go build -o sp ./cmd/spgo test ./...-
TUI calendar view for browsing historical entries -
External editor integration -
Notebook view with markdown rendering -
Vim-style navigation controls -
Comprehensive test coverage - Search functionality across all scratchpads
- Export scratchpads to different formats
- Tags and categories
- Backup and sync functionality
- Custom themes and styling
- Keyboard shortcuts customization
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT