Core Language
Go 1.22+
Why Go:- Single static binary distribution
- Excellent standard library for databases and HTTP
- Fast compile times for rapid iteration
- Strong concurrency primitives (used for async API calls)
- Cross-platform support without additional dependencies
- Interfaces for component abstraction
- Goroutines for non-blocking database queries
- Context for API call cancellation
- Generics avoided (Go 1.22 compatibility)
TUI Framework
Bubble Tea v1.2.4
github.com/charmbracelet/bubbletea Elm-inspired TUI framework implementing the Model-Update-View pattern.- Messages: Immutable data representing events
- Commands: Functions that produce messages asynchronously
- Model: Application state
- View: Pure function that renders state to string
tea.WithAltScreen()- Full-screen TUI modetea.WindowSizeMsg- Responsive layouttea.KeyMsg- Keyboard input handlingtea.Batch()- Run multiple commands in parallel
Bubble Tea’s message-passing architecture makes state changes explicit and traceable, eliminating entire classes of bugs common in imperative UIs.
Bubbles v0.20.0
github.com/charmbracelet/bubbles Pre-built TUI components for common UI patterns. Components used in toni:textinput
Single-line text input with cursor, selection, validationUsed in: Visit and restaurant forms
textarea
Multi-line text editing with scrollingUsed in: Notes fields
table
Sortable, scrollable table with row selectionUsed in: Visits, restaurants, want-to-visit lists
help
Context-aware help systemUsed in: Modal help overlay (
? key)table component with:
- Dynamic column visibility toggling
- Multi-level sorting (primary + secondary keys)
- Filter-by-value on selected cell
- Column-jump shortcuts (
/+ number)
internal/ui/table_controls.go
Lip Gloss v1.0.0
github.com/charmbracelet/lipgloss Style definitions and layout for terminal UIs.- Composable styles: Build complex designs from simple rules
- Adaptive colors: Gracefully degrade for limited color terminals
- Layout primitives:
JoinVertical,JoinHorizontal,Place - Rendering optimization: Caches styled strings to avoid recomputation
- Primary:
#7D56F4(purple) - Success:
#04B575(green) - Error:
#FF6F61(red) - Muted:
#6C7A89(gray) - Text: Adapts to terminal theme
lipgloss.Width()/lipgloss.Height()- Measure rendered stringslipgloss.Place()- Center content in terminalansi.Truncate()- Safely truncate ANSI-styled text
Database
modernc.org/sqlite v1.34.4
modernc.org/sqlite Pure Go SQLite driver - no CGO required. Why modernc.org/sqlite over mattn/go-sqlite3:- Zero C dependencies: Simpler builds, easier cross-compilation
- Single binary: No need for system SQLite libraries
- Cross-platform: Works identically on all platforms
- Performance: Comparable to CGO-based drivers for toni’s workload
- Foreign keys:
restaurant_id REFERENCES restaurants(id) - Check constraints:
rating BETWEEN 1 AND 10 - Automatic timestamps:
DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')) - Indexes on frequently queried columns
internal/db/db.go:10
Query patterns:
- Prepared statements via
db.Query()anddb.Exec() - Transactions for multi-step operations (undo/redo)
LEFT JOINfor denormalized list views
External APIs
Yelp Fusion API v3
developers.yelp.com Restaurant autocomplete powered by Yelp’s business search. Integration details:- Endpoint:
GET /v3/businesses/search - Authentication: Bearer token in
Authorizationheader - Rate limit: 10,000 calls/month (free tier)
- Timeout: 5 seconds per request
internal/search/yelp.go
Dependencies (from go.mod)
Direct Dependencies
Key Transitive Dependencies
Terminal handling:github.com/charmbracelet/x/ansi- ANSI escape code utilitiesgithub.com/charmbracelet/x/term- Terminal feature detectiongithub.com/muesli/termenv- Cross-platform terminal capabilitiesgithub.com/mattn/go-isatty- TTY detection
github.com/mattn/go-runewidth- Unicode width calculationgithub.com/rivo/uniseg- Unicode segmentationgithub.com/lucasb-eyer/go-colorful- Color space conversions
github.com/atotto/clipboard- Cross-platform clipboard access
modernc.org/libc- C standard library in Gomodernc.org/mathutil- Math utilitiesmodernc.org/memory- Memory management
github.com/qeesung/image2ascii- Image to ASCII conversiongithub.com/nfnt/resize- Image resizing
github.com/google/uuid- UUID generationgithub.com/dustin/go-humanize- Human-friendly formattinggolang.org/x/sync- Synchronization primitives
Build Tools
Go Toolchain
Build command:-ldflags: Set version string at compile time-o: Output binary name
CGO_ENABLED=0- Disable CGO for static binariesGOOS- Target operating system (linux, darwin, windows)GOARCH- Target architecture (amd64, arm64)
GitHub Actions
Workflow:.github/workflows/release.yml
Build matrix:
linux/amd64,linux/arm64darwin/amd64,darwin/arm64windows/amd64,windows/arm64
- Checkout repository at release tag
- Setup Go 1.23
- Build with version from tag
- Package as
.tar.gzor.zip - Upload to GitHub release
- Generate SHA256 checksums
Development Dependencies
toni has zero test files currently. The project prioritizes rapid iteration and manual testing in the terminal.
github.com/stretchr/testify- Test assertionsgithub.com/DATA-DOG/go-sqlmock- Mock databasegithub.com/charmbracelet/x/exp/teatest- Bubble Tea testing utilities
Runtime Requirements
User Environment
Minimum:- Terminal emulator (any)
- 72×18 character display
- Basic ANSI color support (optional)
- True color terminal (iTerm2, Kitty, Alacritty, Windows Terminal)
- Unicode font with emoji support
- 100×30+ display for comfortable viewing
- Linux (any distribution)
- macOS 10.15+
- Windows 10+ (with Windows Terminal recommended)
Technology Philosophy
Minimal Dependencies
Only 4 direct dependencies, all from trusted sources (Charm + modernc.org)
Zero CGO
Pure Go for trivial cross-compilation and distribution
Stable Versions
All dependencies pinned to stable 1.x releases
Standard Library First
Use stdlib (database/sql, net/http, encoding/json) before third-party
- Go: Minimum 1.22 for modern generics and standard library features
- Dependencies: Follow semver, update quarterly
- No pre-release or unstable dependencies