···66[](go.mod)
7788Noteleaf is a unified personal productivity CLI that combines task management, note-taking, and media tracking in one place.
99-It provides TaskWarrior-inspired task management with additional support for notes, articles, books, movies, and TV shows - all built with Golang & Charm.sh libs. Inspired by TaskWarrior & todo.txt CLI applications.
99+It provides TaskWarrior-inspired task management with additional support for notes, articles, books, movies, and TV shows, all built with Golang & Charm.sh libs.
1010+Inspired by TaskWarrior & todo.txt CLI applications.
10111112## Why?
12131313-- **Fragmented productivity tools**: Instead of juggling multiple apps for tasks, notes, reading lists, and media queues, Noteleaf provides a single CLI interface
1414-- **Terminal-native workflow**: For developers and power users who prefer staying in the terminal, Noteleaf offers rich TUIs without leaving your command line
1515- - **Lightweight and fast**: No desktop apps or web interfaces - just a fast, focused CLI tool
1414+- **Fragmented Ecosystem**: Instead of juggling multiple apps for tasks, notes, reading lists, and media queues, Noteleaf provides a single CLI interface
1515+- **Terminal-native**: For developers and power users who prefer staying in the terminal, Noteleaf offers rich TUIs without leaving your command line
1616+ - **Lightweight**: No desktop apps or web interfaces, just a fast, focused CLI tool
1617- **Unified data model**: Tasks, notes, and media items can reference each other, creating a connected knowledge and productivity system
17181818-## Getting started
1919-2020-### Prerequisites
2121-2222-Go v1.24+
1919+## Getting Started
23202424-### Installation
2121+### Quick Install
25222623```sh
2724git clone https://github.com/stormlightlabs/noteleaf
···3027go install
3128```
32293333-### Basic usage
3434-3535-```sh
3636-# Initialize the application
3737-noteleaf setup
3838-3939-# Add sample data for exploration
4040-noteleaf setup seed
4141-4242-# Create your first task
4343-noteleaf task add "Learn Noteleaf CLI"
4444-4545-# View tasks
4646-noteleaf task list
4747-4848-# Create a note
4949-noteleaf note add "My first note"
5050-5151-# Add a book to your reading list
5252-noteleaf media book add "The Name of the Wind"
5353-5454-# Generate docs
5555-noteleaf docgen --format docusaurus --out ./website/docs/manual
5656-```
5757-5858-## Status
5959-6060-**Status**: Work in Progress (MVP completed)
6161-6262-### Completed
3030+### First Steps
63316464-- Task management with projects and tags
6565-- Note-taking system
6666-- Article parsing from URLs
6767-- Media tracking (books, movies, TV shows)
6868-6969-### Planned
7070-7171-- Time tracking integration
7272-- Advanced search and filtering
7373-- Export/import functionality
7474-- Plugin system
3232+For a comprehensive walkthrough including task management, time tracking, notes, and media tracking, see the [Quickstart Guide](website/docs/Quickstart.md).
+191
Taskfile.yml
···11+version: '3'
22+33+vars:
44+ BINARY_NAME: noteleaf
55+ BUILD_DIR: ./tmp
66+ CMD_DIR: ./cmd
77+ COVERAGE_FILE: coverage.out
88+ COVERAGE_HTML: coverage.html
99+ VERSION_PKG: github.com/stormlightlabs/noteleaf/internal/version
1010+1111+ # Git version detection
1212+ GIT_COMMIT:
1313+ sh: git rev-parse --short HEAD 2>/dev/null || echo "none"
1414+ GIT_TAG:
1515+ sh: git describe --tags --exact-match 2>/dev/null || echo ""
1616+ GIT_DESCRIBE:
1717+ sh: git describe --tags --always --dirty 2>/dev/null || echo "dev"
1818+ BUILD_DATE:
1919+ sh: date -u +"%Y-%m-%dT%H:%M:%SZ"
2020+2121+tasks:
2222+ default:
2323+ desc: Show available tasks
2424+ silent: true
2525+ cmds:
2626+ - task --list
2727+2828+ test:
2929+ desc: Run all tests
3030+ cmds:
3131+ - go test ./...
3232+3333+ coverage:
3434+ desc: Generate HTML coverage report
3535+ cmds:
3636+ - go test -coverprofile={{.COVERAGE_FILE}} ./...
3737+ - go tool cover -html={{.COVERAGE_FILE}} -o {{.COVERAGE_HTML}}
3838+ - echo "Coverage report generated at {{.COVERAGE_HTML}}"
3939+4040+ cov:
4141+ desc: Show coverage in terminal
4242+ cmds:
4343+ - go test -coverprofile={{.COVERAGE_FILE}} ./...
4444+ - go tool cover -func={{.COVERAGE_FILE}}
4545+4646+ build:
4747+ desc: Build binary (simple build without version injection)
4848+ cmds:
4949+ - mkdir -p {{.BUILD_DIR}}
5050+ - go build -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_DIR}}
5151+ - echo "Built {{.BUILD_DIR}}/{{.BINARY_NAME}}"
5252+5353+ build:dev:
5454+ desc: Build binary with dev version (includes git commit hash)
5555+ vars:
5656+ VERSION: "{{.GIT_DESCRIBE}}"
5757+ LDFLAGS: "-X {{.VERSION_PKG}}.Version={{.VERSION}} -X {{.VERSION_PKG}}.Commit={{.GIT_COMMIT}} -X {{.VERSION_PKG}}.BuildDate={{.BUILD_DATE}}"
5858+ cmds:
5959+ - mkdir -p {{.BUILD_DIR}}
6060+ - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_DIR}}
6161+ - 'echo "Built {{.BUILD_DIR}}/{{.BINARY_NAME}} (version: {{.VERSION}})"'
6262+6363+ build:rc:
6464+ desc: Build release candidate binary (requires git tag with -rc suffix)
6565+ vars:
6666+ VERSION: "{{.GIT_TAG}}"
6767+ LDFLAGS: "-X {{.VERSION_PKG}}.Version={{.VERSION}} -X {{.VERSION_PKG}}.Commit={{.GIT_COMMIT}} -X {{.VERSION_PKG}}.BuildDate={{.BUILD_DATE}}"
6868+ preconditions:
6969+ - sh: '[ -n "{{.GIT_TAG}}" ]'
7070+ msg: "No git tag found. Create a tag with 'git tag v1.0.0-rc1' first."
7171+ - sh: 'echo "{{.GIT_TAG}}" | grep -q "\-rc"'
7272+ msg: "Git tag must contain '-rc' for release candidate builds (e.g., v1.0.0-rc1)"
7373+ cmds:
7474+ - mkdir -p {{.BUILD_DIR}}
7575+ - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_DIR}}
7676+ - 'echo "Built {{.BUILD_DIR}}/{{.BINARY_NAME}} (version: {{.VERSION}})"'
7777+7878+ build:prod:
7979+ desc: Build production binary (requires clean semver git tag)
8080+ vars:
8181+ VERSION: "{{.GIT_TAG}}"
8282+ LDFLAGS: "-X {{.VERSION_PKG}}.Version={{.VERSION}} -X {{.VERSION_PKG}}.Commit={{.GIT_COMMIT}} -X {{.VERSION_PKG}}.BuildDate={{.BUILD_DATE}}"
8383+ preconditions:
8484+ - sh: '[ -n "{{.GIT_TAG}}" ]'
8585+ msg: "No git tag found. Create a tag with 'git tag v1.0.0' first."
8686+ - sh: 'echo "{{.GIT_TAG}}" | grep -qE "^v?[0-9]+\.[0-9]+\.[0-9]+$"'
8787+ msg: "Git tag must be a clean semver version (e.g., v1.0.0 or 1.0.0) without prerelease suffix"
8888+ - sh: '[ -z "$(git status --porcelain)" ]'
8989+ msg: "Working directory must be clean (no uncommitted changes) for production builds"
9090+ cmds:
9191+ - mkdir -p {{.BUILD_DIR}}
9292+ - go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.BINARY_NAME}} {{.CMD_DIR}}
9393+ - 'echo "Built {{.BUILD_DIR}}/{{.BINARY_NAME}} (version: {{.VERSION}})"'
9494+9595+ clean:
9696+ desc: Remove build artifacts and coverage files
9797+ cmds:
9898+ - rm -f {{.COVERAGE_FILE}} {{.COVERAGE_HTML}}
9999+ - rm -rf {{.BUILD_DIR}}
100100+ - echo "Cleaned build artifacts"
101101+102102+ lint:
103103+ desc: Run linters (go vet and go fmt)
104104+ cmds:
105105+ - go vet ./...
106106+ - go fmt ./...
107107+108108+ check:
109109+ desc: Run linters and coverage tests
110110+ cmds:
111111+ - task: lint
112112+ - task: cov
113113+114114+ deps:
115115+ desc: Download and tidy dependencies
116116+ cmds:
117117+ - go mod download
118118+ - go mod tidy
119119+120120+ run:
121121+ desc: Build and run the application
122122+ deps: [build]
123123+ cmds:
124124+ - '{{.BUILD_DIR}}/{{.BINARY_NAME}}'
125125+126126+ status:
127127+ desc: Show Go version, module info, and dependencies
128128+ silent: true
129129+ cmds:
130130+ - echo "=== Go Version ==="
131131+ - go version
132132+ - echo ""
133133+ - echo "=== Module Info ==="
134134+ - go list -m
135135+ - echo ""
136136+ - echo "=== Dependencies ==="
137137+ - go list -m all
138138+139139+ dev:
140140+ desc: Full development workflow (clean, lint, test, build)
141141+ cmds:
142142+ - task: clean
143143+ - task: lint
144144+ - task: test
145145+ - task: build
146146+147147+ docs:generate:
148148+ desc: Generate documentation in all formats
149149+ cmds:
150150+ - go run tools/docgen.go -output website/docs/manual -format docusaurus
151151+ - go run tools/docgen.go -output docs/manual -format man
152152+ - echo "Documentation generated"
153153+154154+ docs:man:
155155+ desc: Generate man pages
156156+ cmds:
157157+ - mkdir -p docs/manual
158158+ - go run tools/docgen.go -output docs/manual -format man
159159+ - echo "Man pages generated in docs/manual"
160160+161161+ docs:serve:
162162+ desc: Start docusaurus development server
163163+ dir: website
164164+ cmds:
165165+ - npm run start
166166+167167+ version:show:
168168+ desc: Display current version information
169169+ silent: true
170170+ cmds:
171171+ - echo "Version info:"
172172+ - 'echo " Git tag: {{.GIT_TAG}}"'
173173+ - 'echo " Git commit: {{.GIT_COMMIT}}"'
174174+ - 'echo " Git describe: {{.GIT_DESCRIBE}}"'
175175+ - 'echo " Build date: {{.BUILD_DATE}}"'
176176+177177+ version:validate:
178178+ desc: Validate git tag format for releases
179179+ cmds:
180180+ - |
181181+ if [ -z "{{.GIT_TAG}}" ]; then
182182+ echo "No git tag found"
183183+ exit 1
184184+ fi
185185+ if echo "{{.GIT_TAG}}" | grep -qE "^v?[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$"; then
186186+ echo "Valid version tag: {{.GIT_TAG}}"
187187+ else
188188+ echo "Invalid version tag: {{.GIT_TAG}}"
189189+ echo "Expected format: v1.0.0 or v1.0.0-rc1"
190190+ exit 1
191191+ fi
···24242525### Business Logic
26262727-**Handlers** - Business logic resides in `internal/handlers/` with one handler per domain (TaskHandler, NoteHandler, ArticleHandler, etc.). Handlers receive repository dependencies through constructor injection.
2727+**Handlers** - Business logic resides in `internal/handlers/` with one handler per domain (TaskHandler, NoteHandler, ArticleHandler, etc.).
2828+Handlers receive repository dependencies through constructor injection.
28292930**Services** - Domain-specific operations in `internal/services/` handle complex business workflows and external integrations.
3031···34353536### Content Management
36373737-**Articles** - Web scraping using `gocolly/colly` with domain-specific extraction rules stored in `internal/articles/rules/`. Articles are parsed to markdown and stored with dual file references (markdown + HTML).
3838+**Articles** - Web scraping using `gocolly/colly` with domain-specific extraction rules stored in `internal/articles/rules/`.
3939+Articles are parsed to markdown and stored with dual file references (markdown + HTML).
38403941**Tasks** - Todo/task management inspired by TaskWarrior with filtering, status tracking, and interactive TUI views.
4042···64666567### Technology Choices
66686767-**Go over Rust** - Go was selected for its simplicity, excellent CLI ecosystem (Cobra, Charm libraries), and faster development velocity. While Rust + Ratatui would provide better memory safety and potentially superior performance, Go's straightforward concurrency model and mature tooling ecosystem made it the pragmatic choice for rapid prototyping and iteration.
6969+**Go over Rust** - Go was selected for its simplicity, excellent CLI ecosystem (Cobra, Charm libraries), and faster development velocity.
7070+While Rust + Ratatui would provide better memory safety and potentially superior performance, Go's straightforward concurrency model and mature tooling ecosystem made it the pragmatic choice for rapid prototyping and iteration.
68716969-**SQLite over PostgreSQL** - SQLite provides zero-configuration deployment and sufficient performance for single-user CLI applications. The embedded database eliminates setup complexity while supporting full SQL features needed for filtering and querying. PostgreSQL would add deployment overhead without meaningful benefits for this use case.
7272+**SQLite over PostgreSQL** - SQLite provides zero-configuration deployment and sufficient performance for single-user CLI applications.
7373+The embedded database eliminates setup complexity while supporting full SQL features needed for filtering and querying.
7474+PostgreSQL would add deployment overhead without meaningful benefits for this use case.
70757171-**Repository Pattern over Active Record** - Repository interfaces enable clean separation between business logic and data access, facilitating testing through dependency injection. This pattern scales better than Active Record for complex domain logic while maintaining clear boundaries between layers.
7676+**Repository Pattern over Active Record** - Repository interfaces enable clean separation between business logic and data access, facilitating testing through dependency injection.
7777+This pattern scales better than Active Record for complex domain logic while maintaining clear boundaries between layers.
72787379### Architectural Tradeoffs
74807575-**CommandGroup Interface** - Centralizes command registration while enabling modular command organization. The pattern requires additional abstraction but provides consistent dependency injection and testing capabilities across all command groups.
8181+**CommandGroup Interface** - Centralizes command registration while enabling modular command organization.
8282+The pattern requires additional abstraction but provides consistent dependency injection and testing capabilities across all command groups.
76837777-**Handler-based Business Logic** - Business logic in handlers rather than rich domain models keeps the codebase simple and avoids over-engineering. While this approach may not scale to complex business rules, it provides clear separation of concerns for the current feature set.
8484+**Handler-based Business Logic** - Business logic in handlers rather than rich domain models keeps the codebase simple and avoids over-engineering.
8585+While this approach may not scale to complex business rules, it provides clear separation of concerns for the current feature set.
78867979-**Dual Storage for Articles** - Articles store both markdown and HTML versions to balance processing speed with format flexibility. This doubles storage requirements but eliminates runtime conversion overhead and preserves original formatting.
8787+**Dual Storage for Articles** - Articles store both markdown and HTML versions to balance processing speed with format flexibility.
8888+This doubles storage requirements but eliminates runtime conversion overhead and preserves original formatting.
80898190### Component Interactions
82918383-**Handler โ Repository โ Database** - Request flow follows a linear path from CLI commands through business logic to data persistence. This pattern ensures consistent validation and error handling while maintaining clear separation of concerns.
9292+**Handler โ Repository โ Database** - Request flow follows a linear path from CLI commands through business logic to data persistence.
9393+This pattern ensures consistent validation and error handling while maintaining clear separation of concerns.
84948585-**TUI State Management** - Bubbletea's unidirectional data flow provides predictable state updates for interactive components. The model-view-update pattern ensures consistent UI behavior across different terminal environments.
9595+**TUI State Management** - Bubbletea's unidirectional data flow provides predictable state updates for interactive components.
9696+The model-view-update pattern ensures consistent UI behavior across different terminal environments.
86978787-**Configuration and Migration** - Application startup validates configuration and runs database migrations before initializing handlers. This fail-fast approach prevents runtime errors and ensures consistent database schema across deployments.
9898+**Configuration and Migration** - Application startup validates configuration and runs database migrations before initializing handlers.
9999+This fail-fast approach prevents runtime errors and ensures consistent database schema across deployments.
···4455## Overview
6677-The codebase follows Go's standard testing practices with specialized testing utilities for complex scenarios. Tests use the standard library along with carefully selected dependencies like faker for data generation and BubbleTea for TUI testing. This approach keeps dependencies minimal while providing robust testing infrastructure for interactive components and complex integrations.
77+The codebase follows Go's standard testing practices with specialized testing utilities for complex scenarios.
88+Tests use the standard library along with carefully selected dependencies like faker for data generation and BubbleTea for TUI testing.
99+This approach keeps dependencies minimal while providing robust testing infrastructure for interactive components and complex integrations.
810911### Organization
10121111-Each package contains its own test files alongside the source code. Test files are organized by functionality and mirror the structure of the source code they test. The codebase includes four main test utility files that provide specialized testing infrastructure:
1313+Each package contains its own test files alongside the source code. Test files are organized by functionality and mirror the structure of the source code they test.
1414+The codebase includes four main test utility files that provide specialized testing infrastructure:
12151316- `internal/services/test_utilities.go` - HTTP mocking and media service testing
1417- `internal/repo/test_utilities.go` - Database testing and data generation
···19222023### Handler Creation
21242222-Tests create real handler instances using temporary databases to ensure test isolation. Factory functions handle both database setup and handler initialization, returning both the handler and a cleanup function.
2525+Tests create real handler instances using temporary databases to ensure test isolation.
2626+Factory functions handle both database setup and handler initialization, returning both the handler and a cleanup function.
23272428### Database Isolation
25292626-Tests use temporary directories and environment variable manipulation to create isolated database instances. Each test gets its own temporary SQLite database that is automatically cleaned up after the test completes.
3030+Tests use temporary directories and environment variable manipulation to create isolated database instances.
3131+Each test gets its own temporary SQLite database that is automatically cleaned up after the test completes.
27322828-The `setupCommandTest` function creates a temporary directory, sets `XDG_CONFIG_HOME` to point to it, and initializes the database schema. This ensures tests don't interfere with each other or with development data.
3333+The `setupCommandTest` function creates a temporary directory, sets `XDG_CONFIG_HOME` to point to it, and initializes the database schema.
3434+This ensures tests don't interfere with each other or with development data.
29353036### Resource Management
31373232-Tests properly manage resources using cleanup functions returned by factory methods. The cleanup function handles both handler closure and temporary directory removal. This pattern ensures complete resource cleanup even if tests fail.
3838+Tests properly manage resources using cleanup functions returned by factory methods.
3939+The cleanup function handles both handler closure and temporary directory removal.
4040+This pattern ensures complete resource cleanup even if tests fail.
33413442### Error Handling
35433636-Tests use `t.Fatal` for setup errors that prevent test execution and `t.Error` for test assertion failures. Fatal errors stop test execution while errors allow tests to continue checking other conditions.
4444+Tests use `t.Fatal` for setup errors that prevent test execution and `t.Error` for test assertion failures.
4545+Fatal errors stop test execution while errors allow tests to continue checking other conditions.
37463847### Context Cancellation
39484040-Error case testing frequently uses context cancellation to simulate database and network failures. The pattern creates a context, immediately cancels it, then calls the function under test to verify error handling. This provides a reliable way to test error paths without requiring complex mock setups or external failure injection.
4949+Error case testing frequently uses context cancellation to simulate database and network failures.
5050+The pattern creates a context, immediately cancels it, then calls the function under test to verify error handling.
5151+This provides a reliable way to test error paths without requiring complex mock setups or external failure injection.
41524253### Command Structure
43544444-Command group tests verify cobra command structure including use strings, aliases, short descriptions, and subcommand presence. Tests check that commands are properly configured without executing their logic.
5555+Command group tests verify cobra command structure including use strings, aliases, short descriptions, and subcommand presence.
5656+Tests check that commands are properly configured without executing their logic.
45574658### Interface Compliance
47594848-Tests verify interface compliance using compile-time checks with blank identifier assignments. This ensures structs implement expected interfaces without runtime overhead.
6060+Tests verify interface compliance using compile-time checks with blank identifier assignments.
6161+This ensures structs implement expected interfaces without runtime overhead.
49625063## Test Infrastructure
51645265### Test Utility Frameworks
53665454-The codebase provides comprehensive testing utilities organized by layer and functionality. Each test utility file contains specialized helpers, mocks, and test infrastructure for its respective domain.
6767+The codebase provides comprehensive testing utilities organized by layer and functionality.
6868+Each test utility file contains specialized helpers, mocks, and test infrastructure for its respective domain.
55695670#### Database Testing Utilities
5771···105119106120#### TUI Testing with BubbleTea Framework
107121108108-The TUI testing framework addresses the fundamental challenge of testing interactive terminal applications in a deterministic, concurrent environment. BubbleTea's message-passing architecture creates unique testing requirements that standard Go testing patterns cannot adequately address.
122122+The TUI testing framework addresses the fundamental challenge of testing interactive terminal applications in a deterministic, concurrent environment.
123123+BubbleTea's message-passing architecture creates unique testing requirements that standard Go testing patterns cannot adequately address.
109124110110-The framework implements a controlled execution environment that replaces BubbleTea's typical program loop with a deterministic testing harness. Rather than running an actual terminal program, the "testing suite" directly manages model state transitions by simulating the Update/View cycle. This approach eliminates the non-deterministic behavior inherent in real terminal interactions while preserving the exact message flow patterns that production code experiences.
125125+The framework implements a controlled execution environment that replaces BubbleTea's typical program loop with a deterministic testing harness.
126126+Rather than running an actual terminal program, the "testing suite" directly manages model state transitions by simulating the Update/View cycle.
127127+This approach eliminates the non-deterministic behavior inherent in real terminal interactions while preserving the exact message flow patterns that production code experiences.
111128112112-State verification relies on function composition patterns where test conditions are expressed as closures that capture specific model states. The `WaitFor` mechanism uses polling with configurable timeouts, addressing the async nature of BubbleTea model updates without creating race conditions. This pattern bridges imperative test assertions with BubbleTea's declarative update model.
129129+State verification relies on function composition patterns where test conditions are expressed as closures that capture specific model states.
130130+The `WaitFor` mechanism uses polling with configurable timeouts, addressing the async nature of BubbleTea model updates without creating race conditions.
131131+This pattern bridges imperative test assertions with BubbleTea's declarative update model.
113132This is inspired by front-end/TS/JS testing patterns.
114133115134The framework's I/O abstraction layer replaces terminal input/output with controlled buffers that implement standard Go interfaces.
116116-This design maintains interface compatibility while providing complete control over timing and content. The controlled I/O system captures all output for later verification and injects precise input sequences, enabling complex interaction testing without external dependencies.
135135+This design maintains interface compatibility while providing complete control over timing and content.
136136+The controlled I/O system captures all output for later verification and injects precise input sequences, enabling complex interaction testing without external dependencies.
117137118138Concurrency management uses channels and context propagation to coordinate between the testing framework and the model under test.
119119-The suite manages goroutine lifecycle and ensures proper cleanup, preventing test interference and resource leaks. This architecture supports testing of models that perform background operations or handle async events.
139139+The suite manages goroutine lifecycle and ensures proper cleanup, preventing test interference and resource leaks.
140140+This architecture supports testing of models that perform background operations or handle async events.
120141121142#### HTTP Service Mocking
122143···134155135156### Single Root Test
136157137137-The preferred test organization pattern uses a single root test function with nested subtests using `t.Run`. This provides clear hierarchical organization and allows running specific test sections while maintaining shared setup and context. This pattern offers several advantages: clear test hierarchy with logical grouping, ability to run specific test sections, consistent test structure across the codebase, and shared setup that can be inherited by subtests.
158158+The preferred test organization pattern uses a single root test function with nested subtests using `t.Run`.
159159+This provides clear hierarchical organization and allows running specific test sections while maintaining shared setup and context.
160160+This pattern offers several advantages: clear test hierarchy with logical grouping, ability to run specific test sections, consistent test structure across the codebase, and shared setup that can be inherited by subtests.
138161139162### Integration vs Unit Testing
140163141141-The codebase emphasizes integration testing over heavy mocking by using real handlers and services to verify actual behavior rather than mocked interactions. The goal is to catch integration issues while maintaining test reliability.
164164+The codebase emphasizes integration testing over heavy mocking by using real handlers and services to verify actual behavior rather than mocked interactions.
165165+The goal is to catch integration issues while maintaining test reliability.
142166143167### Static Output
144168···146170147171### Standard Output Redirection
148172149149-For testing functions that write to stdout, tests use a pipe redirection pattern with goroutines to capture output. The pattern saves the original stdout, redirects to a pipe, captures output in a separate goroutine, and restores stdout after the test. This ensures clean output capture without interfering with the testing framework.
173173+For testing functions that write to stdout, tests use a pipe redirection pattern with goroutines to capture output.
174174+The pattern saves the original stdout, redirects to a pipe, captures output in a separate goroutine, and restores stdout after the test.
175175+This ensures clean output capture without interfering with the testing framework.
150176151177## Utilities
152178···189215190216## Testing CLI Commands
191217192192-Command group tests focus on structure verification rather than execution testing. Tests check command configuration, subcommand presence, and interface compliance. This approach ensures command trees are properly constructed without requiring complex execution mocking.
218218+Command group tests focus on structure verification rather than execution testing.
219219+Tests check command configuration, subcommand presence, and interface compliance. This approach ensures command trees are properly constructed without requiring complex execution mocking.
193220194221### CommandGroup Interface Testing
195222196196-The CommandGroup interface enables testable CLI architecture. Tests verify that command groups implement the interface correctly and return properly configured cobra commands. This pattern separates command structure from command execution.
223223+The CommandGroup interface enables testable CLI architecture. Tests verify that command groups implement the interface correctly and return properly configured cobra commands.
224224+This pattern separates command structure from command execution.
197225198226Interface compliance is tested using compile-time checks within the "Interface Implementations" subtest, ensuring all command structs properly implement the CommandGroup interface without runtime overhead.
199227200228## Performance Considerations
201229202202-Tests avoid expensive operations in setup functions. Handler creation uses real instances but tests focus on structure verification rather than full execution paths. This keeps test suites fast while maintaining coverage of critical functionality.
230230+Tests avoid expensive operations in setup functions. Handler creation uses real instances but tests focus on structure verification rather than full execution paths.
231231+This keeps test suites fast while maintaining coverage of critical functionality.
203232204233The single root test pattern allows for efficient resource management where setup costs can be amortized across multiple related test cases.
205234
···10101111### CORE
12121313-- [ ] Ensure **all documented subcommands** exist and work:
1313+- [x] Ensure **all documented subcommands** exist and work:
1414 - Tasks: add, list, view, update, edit, delete, projects, tags, contexts, done, start, stop, timesheet
1515 - Notes: create, list, read, edit, remove
1616 - Books: add, list, reading, finished, remove, progress, update
1717 - Movies: add, list, watched, remove
1818 - TV: add, list, watching, watched, remove
1919 - Articles: add, list, view, read, remove
2020-- [ ] Confirm all **aliases** work (`todo`, `ls`, `rm`, etc.).
2121-- [ ] Verify **flags** and argument parsing match man page (priority, project, context, due, tags, etc.).
2222-- [ ] Implement or finish stubs (e.g. `config management` noted in code).
2020+- [x] Confirm all **aliases** work (`todo`, `ls`, `rm`, etc.).
2121+- [x] Verify **flags** and argument parsing match man page (priority, project, context, due, tags, etc.).
2222+- [x] Implement or finish stubs (e.g. `config management` noted in code).
23232424### Task Management Domain
25252626-- [ ] Verify tasks can be created with all attributes (priority, project, context, due date, tags).
2727-- [ ] Confirm task listing supports interactive and static modes.
2828-- [ ] Implement status filtering (`pending`, `completed`, etc.).
2929-- [ ] Validate time tracking (start/stop) writes entries and timesheet summarizes correctly.
3030-- [ ] Ensure update supports add/remove tags and all fields.
3131-- [ ] Test interactive editor (`task edit`).
2626+- [x] Verify tasks can be created with all attributes (priority, project, context, due date, tags).
2727+- [x] Confirm task listing supports interactive and static modes.
2828+- [x] Implement status filtering (`pending`, `completed`, etc.).
2929+- [x] Validate time tracking (start/stop) writes entries and timesheet summarizes correctly.
3030+- [x] Ensure update supports add/remove tags and all fields.
3131+- [x] Test interactive editor (`task edit`).
32323333### Notes Domain
34343535-- [ ] Implement note creation from:
3535+- [x] Implement note creation from:
3636 - Inline text
3737 - File (`--file`)
3838 - Interactive input (`--interactive`)
3939-- [ ] Verify note list interactive TUI works, static list fallback works.
4040-- [ ] Confirm filtering by tags and `--archived`.
4141-- [ ] Ensure notes can be opened, edited in `$EDITOR`, and deleted.
3939+- [x] Verify note list interactive TUI works, static list fallback works.
4040+- [x] Confirm filtering by tags and `--archived`.
4141+- [x] Ensure notes can be opened, edited in `$EDITOR`, and deleted.
42424343### Media Domains
44444545#### Books
46464747-- [ ] Implement search + add (possibly external API).
4848-- [ ] Verify list supports statuses (`queued`, `reading`, `finished`).
4949-- [ ] Progress updates (`book progress`) work with percentages.
5050-- [ ] Status update (`book update`) accepts valid values.
4747+- [x] Implement search + add (possibly external API).
4848+- [x] Verify list supports statuses (`queued`, `reading`, `finished`).
4949+- [x] Progress updates (`book progress`) work with percentages.
5050+- [x] Status update (`book update`) accepts valid values.
51515252#### Movies
53535454-- [ ] Implement search + add.
5555-- [ ] Verify `list` with status filtering (`all`, `queued`, `watched`).
5656-- [ ] Confirm `watched`/`remove` commands update correctly.
5454+- [x] Implement search + add.
5555+- [x] Verify `list` with status filtering (`all`, `queued`, `watched`).
5656+- [x] Confirm `watched`/`remove` commands update correctly.
57575858#### TV
59596060-- [ ] Implement search + add.
6161-- [ ] Verify `list` with multiple statuses (`queued`, `watching`, `watched`).
6262-- [ ] Ensure `watching`, `watched`, `remove` commands behave correctly.
6060+- [x] Implement search + add.
6161+- [x] Verify `list` with multiple statuses (`queued`, `watching`, `watched`).
6262+- [x] Ensure `watching`, `watched`, `remove` commands behave correctly.
63636464#### Articles
65656666-- [ ] Implement article parser (XPath/domain-specific rules).
6767-- [ ] Save articles in Markdown + HTML.
6868-- [ ] Verify metadata is stored in DB.
6969-- [ ] Confirm list supports query, author filter, limit.
7070-- [ ] Test article view/read/remove.
6666+- [x] Implement article parser (XPath/domain-specific rules).
6767+- [x] Save articles in Markdown + HTML.
6868+- [x] Verify metadata is stored in DB.
6969+- [x] Confirm list supports query, author filter, limit.
7070+- [x] Test article view/read/remove.
71717272### Configuration & Data
73737474-- [ ] Implement **config management**
7575-- [ ] Define config file format (TOML, YAML, JSON).
7676-- [ ] Set default config/data paths:
7474+- [x] Implement **config management**
7575+- [x] Define config file format (TOML, YAML, JSON).
7676+- [x] Set default config/data paths:
7777 - Linux: `~/.config/noteleaf`, `~/.local/share/noteleaf`
7878 - macOS: `~/Library/Application Support/noteleaf`
7979 - Windows: `%APPDATA%\noteleaf`
8080-- [ ] Implement overrides with environment variables (`NOTELEAF_CONFIG`, `NOTELEAF_DATA_DIR`).
8181-- [ ] Ensure consistent DB schema migrations and versioning.
8080+- [x] Implement overrides with environment variables (`NOTELEAF_CONFIG`, `NOTELEAF_DATA_DIR`).
8181+- [x] Ensure consistent DB schema migrations and versioning.
82828383### Documentation
84848585-- [ ] Finalize **man page** (plaintext + roff).
8686-- [ ] Write quickstart guide in `README.md`.
8787-- [ ] Add examples for each command.
8888-- [ ] Document config file with defaults and examples.
8989-- [ ] Provide developer docs for contributing.
8585+- [x] Finalize **man page** - use `tools/docgen.go` as a dev only command for `website/docs/manual`
8686+- [x] Strictly follow <https://diataxis.fr/>
8787+ - [x] Write quickstart guide in `README.md` & add `website/docs/Quickstart.md`
8888+ - [x] Add examples for each command (`website/docs/examples`)
8989+ - [x] Document config file with defaults and examples in `website/docs/Configuration.md`
9090+ - [x] Provide developer docs for contributing in `docs/dev`
9191+ - [x] Move to `website/docs/development`
90929193### QA
9294
+5-3
internal/services/services.go
···1616 "time"
17171818 "github.com/stormlightlabs/noteleaf/internal/models"
1919+ "github.com/stormlightlabs/noteleaf/internal/version"
1920 "golang.org/x/time/rate"
2021)
2122···2728 // Rate limiting: 180 requests per minute = 3 requests per second
2829 requestsPerSecond int = 3
2930 burstLimit int = 5
3131+)
30323131- // User agent
3232- // TODO: See https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications
3333- userAgent string = "Noteleaf/1.0.0 (info@stormlightlabs.org)"
3333+var (
3434+ // User agent for HTTP requests - uses version information set at build time
3535+ userAgent = version.UserAgent("Noteleaf", "info@stormlightlabs.org")
3436)
35373638// APIService defines the contract for API interactions
···11+# Configuration
22+33+Noteleaf stores its configuration in a TOML file. The configuration file location depends on your operating system and can be overridden with environment variables.
44+55+## Configuration File Location
66+77+### Default Paths
88+99+**Linux:**
1010+1111+```sh
1212+~/.config/noteleaf/.noteleaf.conf.toml
1313+```
1414+1515+**macOS:**
1616+1717+```sh
1818+~/Library/Application Support/noteleaf/.noteleaf.conf.toml
1919+```
2020+2121+**Windows:**
2222+2323+```sh
2424+%APPDATA%\noteleaf\.noteleaf.conf.toml
2525+```
2626+2727+### Environment Variable Override
2828+2929+Set `NOTELEAF_CONFIG` to use a custom configuration file location:
3030+3131+```sh
3232+export NOTELEAF_CONFIG=/path/to/custom/config.toml
3333+```
3434+3535+## Configuration Options
3636+3737+### General Settings
3838+3939+#### date_format
4040+4141+Format for displaying dates throughout the application.
4242+4343+**Type:** String
4444+**Default:** `"2006-01-02"` (ISO 8601)
4545+**Example:**
4646+4747+```toml
4848+date_format = "2006-01-02"
4949+```
5050+5151+Common formats:
5252+5353+- `"2006-01-02"` - ISO format: 2024-03-15
5454+- `"01/02/2006"` - US format: 03/15/2024
5555+- `"02-Jan-2006"` - Short month: 15-Mar-2024
5656+5757+#### color_scheme
5858+5959+Color scheme for terminal output.
6060+6161+**Type:** String
6262+**Default:** `"default"`
6363+**Example:**
6464+6565+```toml
6666+color_scheme = "default"
6767+```
6868+6969+#### default_view
7070+7171+Default view mode for interactive lists.
7272+7373+**Type:** String
7474+**Default:** `"list"`
7575+**Example:**
7676+7777+```toml
7878+default_view = "list"
7979+```
8080+8181+#### default_priority
8282+8383+Default priority for new tasks when not specified.
8484+8585+**Type:** String
8686+**Default:** None
8787+**Options:** `"low"`, `"medium"`, `"high"`, `"urgent"`
8888+**Example:**
8989+9090+```toml
9191+default_priority = "medium"
9292+```
9393+9494+#### editor
9595+9696+Text editor for editing notes and tasks. Falls back to `$EDITOR` environment variable if not set.
9797+9898+**Type:** String
9999+**Default:** None (uses `$EDITOR`)
100100+**Example:**
101101+102102+```toml
103103+editor = "vim"
104104+```
105105+106106+### Data Storage
107107+108108+#### database_path
109109+110110+Custom path to SQLite database file. Leave empty to use default location.
111111+112112+**Type:** String
113113+**Default:** Platform-specific data directory
114114+**Example:**
115115+116116+```toml
117117+database_path = "/custom/path/noteleaf.db"
118118+```
119119+120120+#### data_dir
121121+122122+Directory for storing application data (articles, notes, attachments).
123123+124124+**Type:** String
125125+**Default:** Platform-specific data directory
126126+**Example:**
127127+128128+```toml
129129+data_dir = "/custom/data/directory"
130130+```
131131+132132+You can also use the `NOTELEAF_DATA_DIR` environment variable:
133133+134134+```sh
135135+export NOTELEAF_DATA_DIR=/custom/data/directory
136136+```
137137+138138+#### articles_dir
139139+140140+Directory for storing saved articles.
141141+142142+**Type:** String
143143+**Default:** `<data_dir>/articles`
144144+**Example:**
145145+146146+```toml
147147+articles_dir = "/path/to/articles"
148148+```
149149+150150+#### notes_dir
151151+152152+Directory for storing notes.
153153+154154+**Type:** String
155155+**Default:** `<data_dir>/notes`
156156+**Example:**
157157+158158+```toml
159159+notes_dir = "/path/to/notes"
160160+```
161161+162162+### Archive and Export
163163+164164+#### auto_archive
165165+166166+Automatically archive completed tasks after a specified period.
167167+168168+**Type:** Boolean
169169+**Default:** `false`
170170+**Example:**
171171+172172+```toml
173173+auto_archive = true
174174+```
175175+176176+#### export_format
177177+178178+Default format for exporting data.
179179+180180+**Type:** String
181181+**Default:** `"json"`
182182+**Options:** `"json"`, `"csv"`, `"markdown"`
183183+**Example:**
184184+185185+```toml
186186+export_format = "json"
187187+```
188188+189189+### Synchronization
190190+191191+Synchronization features are planned for future releases.
192192+193193+#### sync_enabled
194194+195195+Enable synchronization with remote server.
196196+197197+**Type:** Boolean
198198+**Default:** `false`
199199+**Example:**
200200+201201+```toml
202202+sync_enabled = false
203203+```
204204+205205+#### sync_endpoint
206206+207207+URL of the synchronization server.
208208+209209+**Type:** String
210210+**Default:** None
211211+**Example:**
212212+213213+```toml
214214+sync_endpoint = "https://sync.example.com/api"
215215+```
216216+217217+#### sync_token
218218+219219+Authentication token for synchronization.
220220+221221+**Type:** String
222222+**Default:** None
223223+**Example:**
224224+225225+```toml
226226+sync_token = "your-secret-token"
227227+```
228228+229229+### API Keys
230230+231231+#### movie_api_key
232232+233233+API key for movie database services (future feature).
234234+235235+**Type:** String
236236+**Default:** None
237237+**Example:**
238238+239239+```toml
240240+movie_api_key = "your-api-key"
241241+```
242242+243243+#### book_api_key
244244+245245+API key for book database services. Currently uses Open Library which doesn't require an API key.
246246+247247+**Type:** String
248248+**Default:** None
249249+**Example:**
250250+251251+```toml
252252+book_api_key = "your-api-key"
253253+```
254254+255255+### AT Protocol / Bluesky Integration
256256+257257+Configuration for publishing content to Bluesky/AT Protocol.
258258+259259+#### atproto_did
260260+261261+Your Decentralized Identifier (DID) on the AT Protocol network.
262262+263263+**Type:** String
264264+**Default:** None
265265+**Example:**
266266+267267+```toml
268268+atproto_did = "did:plc:abcd1234efgh5678"
269269+```
270270+271271+#### atproto_handle
272272+273273+Your Bluesky/AT Protocol handle.
274274+275275+**Type:** String
276276+**Default:** None
277277+**Example:**
278278+279279+```toml
280280+atproto_handle = "username.bsky.social"
281281+```
282282+283283+#### atproto_pds_url
284284+285285+Personal Data Server URL.
286286+287287+**Type:** String
288288+**Default:** None
289289+**Example:**
290290+291291+```toml
292292+atproto_pds_url = "https://bsky.social"
293293+```
294294+295295+#### atproto_access_jwt
296296+297297+Access token for authentication (managed automatically).
298298+299299+**Type:** String
300300+**Default:** None
301301+**Example:**
302302+303303+```toml
304304+atproto_access_jwt = "eyJhbGc..."
305305+```
306306+307307+#### atproto_refresh_jwt
308308+309309+Refresh token for authentication (managed automatically).
310310+311311+**Type:** String
312312+**Default:** None
313313+314314+#### atproto_expires_at
315315+316316+Token expiration timestamp (managed automatically).
317317+318318+**Type:** String (ISO8601)
319319+**Default:** None
320320+321321+## Managing Configuration
322322+323323+### View Current Configuration
324324+325325+```sh
326326+noteleaf config show
327327+```
328328+329329+### Set Configuration Value
330330+331331+```sh
332332+noteleaf config set <key> <value>
333333+```
334334+335335+Examples:
336336+337337+```sh
338338+noteleaf config set editor "nvim"
339339+noteleaf config set default_priority "high"
340340+noteleaf config set date_format "01/02/2006"
341341+```
342342+343343+### Get Configuration Value
344344+345345+```sh
346346+noteleaf config get <key>
347347+```
348348+349349+Example:
350350+351351+```sh
352352+noteleaf config get editor
353353+```
354354+355355+## Example Configuration
356356+357357+Complete example configuration with common settings:
358358+359359+```toml
360360+# General settings
361361+date_format = "2006-01-02"
362362+color_scheme = "default"
363363+default_view = "list"
364364+default_priority = "medium"
365365+editor = "vim"
366366+367367+# Data storage
368368+# database_path = "" # Use default location
369369+# data_dir = "" # Use default location
370370+371371+# Archive and export
372372+auto_archive = false
373373+export_format = "json"
374374+375375+# Synchronization (future feature)
376376+sync_enabled = false
377377+# sync_endpoint = ""
378378+# sync_token = ""
379379+380380+# API keys (optional)
381381+# movie_api_key = ""
382382+# book_api_key = ""
383383+384384+# AT Protocol / Bluesky (optional)
385385+# atproto_did = ""
386386+# atproto_handle = ""
387387+# atproto_pds_url = "https://bsky.social"
388388+```
389389+390390+## Environment Variables
391391+392392+Noteleaf respects the following environment variables:
393393+394394+- `NOTELEAF_CONFIG` - Custom path to configuration file
395395+- `NOTELEAF_DATA_DIR` - Custom path to data directory
396396+- `EDITOR` - Default text editor (fallback if `editor` config not set)
397397+398398+Example:
399399+400400+```sh
401401+export NOTELEAF_CONFIG=~/.config/noteleaf/config.toml
402402+export NOTELEAF_DATA_DIR=~/Documents/noteleaf-data
403403+export EDITOR=nvim
404404+```
+276
website/docs/Quickstart.md
···11+# Quickstart Guide
22+33+This guide will walk you through installing Noteleaf and getting productive with tasks, notes, and media tracking in under 15 minutes.
44+55+## Installation
66+77+### Requirements
88+99+- Go 1.24 or higher
1010+- Git (for cloning the repository)
1111+1212+### Build and Install
1313+1414+Clone the repository and build the binary:
1515+1616+```sh
1717+git clone https://github.com/stormlightlabs/noteleaf
1818+cd noteleaf
1919+go build -o ./tmp/noteleaf ./cmd
2020+```
2121+2222+Optionally, install to your GOPATH:
2323+2424+```sh
2525+go install
2626+```
2727+2828+## Initialize Noteleaf
2929+3030+Set up the database and configuration:
3131+3232+```sh
3333+noteleaf setup
3434+```
3535+3636+This creates:
3737+3838+- Database at `~/.local/share/noteleaf/noteleaf.db` (Linux) or `~/Library/Application Support/noteleaf/noteleaf.db` (macOS)
3939+- Configuration file at `~/.config/noteleaf/config.toml` (Linux) or `~/Library/Application Support/noteleaf/config.toml` (macOS)
4040+4141+### Optional: Add Sample Data
4242+4343+Explore with pre-populated examples:
4444+4545+```sh
4646+noteleaf setup seed
4747+```
4848+4949+## Task Management
5050+5151+### Create Your First Task
5252+5353+```sh
5454+noteleaf task add "Write project proposal"
5555+```
5656+5757+### Add a Task with Priority and Project
5858+5959+```sh
6060+noteleaf task add "Review pull requests" --priority high --project work
6161+```
6262+6363+### List Tasks
6464+6565+Interactive mode with arrow key navigation:
6666+6767+```sh
6868+noteleaf task list
6969+```
7070+7171+Static output for scripting:
7272+7373+```sh
7474+noteleaf task list --static
7575+```
7676+7777+### Mark a Task as Done
7878+7979+```sh
8080+noteleaf task done 1
8181+```
8282+8383+### Track Time
8484+8585+Start tracking:
8686+8787+```sh
8888+noteleaf task start 1
8989+```
9090+9191+Stop tracking:
9292+9393+```sh
9494+noteleaf task stop 1
9595+```
9696+9797+View timesheet:
9898+9999+```sh
100100+noteleaf task timesheet
101101+```
102102+103103+## Note Taking
104104+105105+### Create a Note
106106+107107+Quick note from command line:
108108+109109+```sh
110110+noteleaf note create "Meeting Notes" "Discussed Q4 roadmap and priorities"
111111+```
112112+113113+Create with your editor:
114114+115115+```sh
116116+noteleaf note create --interactive
117117+```
118118+119119+Create from a file:
120120+121121+```sh
122122+noteleaf note create --file notes.md
123123+```
124124+125125+### List and Read Notes
126126+127127+List all notes (interactive):
128128+129129+```sh
130130+noteleaf note list
131131+```
132132+133133+Read a specific note:
134134+135135+```sh
136136+noteleaf note read 1
137137+```
138138+139139+### Edit a Note
140140+141141+Opens in your `$EDITOR`:
142142+143143+```sh
144144+noteleaf note edit 1
145145+```
146146+147147+## Media Tracking
148148+149149+### Books
150150+151151+Search and add from Open Library:
152152+153153+```sh
154154+noteleaf media book add "Project Hail Mary"
155155+```
156156+157157+List your reading queue:
158158+159159+```sh
160160+noteleaf media book list
161161+```
162162+163163+Update reading progress:
164164+165165+```sh
166166+noteleaf media book progress 1 45
167167+```
168168+169169+Mark as finished:
170170+171171+```sh
172172+noteleaf media book finished 1
173173+```
174174+175175+### Movies
176176+177177+Add a movie:
178178+179179+```sh
180180+noteleaf media movie add "The Matrix"
181181+```
182182+183183+Mark as watched:
184184+185185+```sh
186186+noteleaf media movie watched 1
187187+```
188188+189189+### TV Shows
190190+191191+Add a show:
192192+193193+```sh
194194+noteleaf media tv add "Breaking Bad"
195195+```
196196+197197+Update status:
198198+199199+```sh
200200+noteleaf media tv watching 1
201201+```
202202+203203+## Articles
204204+205205+### Save an Article
206206+207207+Parse and save from URL:
208208+209209+```sh
210210+noteleaf article add https://example.com/interesting-post
211211+```
212212+213213+### List Articles
214214+215215+```sh
216216+noteleaf article list
217217+```
218218+219219+Filter by author:
220220+221221+```sh
222222+noteleaf article list --author "Jane Smith"
223223+```
224224+225225+### Read an Article
226226+227227+View in terminal:
228228+229229+```sh
230230+noteleaf article view 1
231231+```
232232+233233+## Configuration
234234+235235+### View Current Configuration
236236+237237+```sh
238238+noteleaf config show
239239+```
240240+241241+### Set Configuration Values
242242+243243+```sh
244244+noteleaf config set editor vim
245245+noteleaf config set default_priority medium
246246+```
247247+248248+### Check Status
249249+250250+View application status and paths:
251251+252252+```sh
253253+noteleaf status
254254+```
255255+256256+## Getting Help
257257+258258+View help for any command:
259259+260260+```sh
261261+noteleaf --help
262262+noteleaf task --help
263263+noteleaf task add --help
264264+```
265265+266266+## Next Steps
267267+268268+Now that you have the basics down:
269269+270270+- Explore advanced task filtering and queries
271271+- Create custom projects and contexts for organizing tasks
272272+- Link notes to tasks and media items
273273+- Set up recurring tasks and dependencies
274274+- Configure the application to match your workflow
275275+276276+For detailed documentation on each command, see the CLI reference in the manual section.
···11+# Media Examples
22+33+Examples of managing your reading lists and watch queues using Noteleaf.
44+55+## Books
66+77+### Adding Books
88+99+Search and add from Open Library:
1010+1111+```sh
1212+noteleaf media book add "The Name of the Wind"
1313+noteleaf media book add "Project Hail Mary"
1414+noteleaf media book add "Dune"
1515+```
1616+1717+Add by author:
1818+1919+```sh
2020+noteleaf media book add "Foundation by Isaac Asimov"
2121+```
2222+2323+Add with specific year:
2424+2525+```sh
2626+noteleaf media book add "1984 by George Orwell 1949"
2727+```
2828+2929+### Viewing Books
3030+3131+List all books:
3232+3333+```sh
3434+noteleaf media book list
3535+```
3636+3737+Filter by status:
3838+3939+```sh
4040+noteleaf media book list --status queued
4141+noteleaf media book list --status reading
4242+noteleaf media book list --status finished
4343+```
4444+4545+### Managing Reading Status
4646+4747+Start reading:
4848+4949+```sh
5050+noteleaf media book reading 1
5151+```
5252+5353+Mark as finished:
5454+5555+```sh
5656+noteleaf media book finished 1
5757+```
5858+5959+### Tracking Progress
6060+6161+Update reading progress (percentage):
6262+6363+```sh
6464+noteleaf media book progress 1 25
6565+noteleaf media book progress 1 50
6666+noteleaf media book progress 1 75
6767+```
6868+6969+Update with page numbers:
7070+7171+```sh
7272+noteleaf media book progress 1 150 --total 400
7373+```
7474+7575+### Book Details
7676+7777+View book details:
7878+7979+```sh
8080+noteleaf media book view 1
8181+```
8282+8383+### Updating Book Information
8484+8585+Update book notes:
8686+8787+```sh
8888+noteleaf media book update 1 --notes "Excellent worldbuilding and magic system"
8989+```
9090+9191+Add rating:
9292+9393+```sh
9494+noteleaf media book update 1 --rating 5
9595+```
9696+9797+### Removing Books
9898+9999+Remove from list:
100100+101101+```sh
102102+noteleaf media book remove 1
103103+```
104104+105105+## Movies
106106+107107+### Adding Movies
108108+109109+Add movie:
110110+111111+```sh
112112+noteleaf media movie add "The Matrix"
113113+noteleaf media movie add "Inception"
114114+noteleaf media movie add "Interstellar"
115115+```
116116+117117+Add with year:
118118+119119+```sh
120120+noteleaf media movie add "Blade Runner 1982"
121121+```
122122+123123+### Viewing Movies
124124+125125+List all movies:
126126+127127+```sh
128128+noteleaf media movie list
129129+```
130130+131131+Filter by status:
132132+133133+```sh
134134+noteleaf media movie list --status queued
135135+noteleaf media movie list --status watched
136136+```
137137+138138+### Managing Watch Status
139139+140140+Mark as watched:
141141+142142+```sh
143143+noteleaf media movie watched 1
144144+```
145145+146146+### Movie Details
147147+148148+View movie details:
149149+150150+```sh
151151+noteleaf media movie view 1
152152+```
153153+154154+### Updating Movie Information
155155+156156+Add notes and rating:
157157+158158+```sh
159159+noteleaf media movie update 1 --notes "Mind-bending sci-fi" --rating 5
160160+```
161161+162162+### Removing Movies
163163+164164+Remove from list:
165165+166166+```sh
167167+noteleaf media movie remove 1
168168+```
169169+170170+## TV Shows
171171+172172+### Adding TV Shows
173173+174174+Add TV show:
175175+176176+```sh
177177+noteleaf media tv add "Breaking Bad"
178178+noteleaf media tv add "The Wire"
179179+noteleaf media tv add "Better Call Saul"
180180+```
181181+182182+### Viewing TV Shows
183183+184184+List all shows:
185185+186186+```sh
187187+noteleaf media tv list
188188+```
189189+190190+Filter by status:
191191+192192+```sh
193193+noteleaf media tv list --status queued
194194+noteleaf media tv list --status watching
195195+noteleaf media tv list --status watched
196196+```
197197+198198+### Managing Watch Status
199199+200200+Start watching:
201201+202202+```sh
203203+noteleaf media tv watching 1
204204+```
205205+206206+Mark as finished:
207207+208208+```sh
209209+noteleaf media tv watched 1
210210+```
211211+212212+Put on hold:
213213+214214+```sh
215215+noteleaf media tv update 1 --status on-hold
216216+```
217217+218218+### TV Show Details
219219+220220+View show details:
221221+222222+```sh
223223+noteleaf media tv view 1
224224+```
225225+226226+### Updating TV Show Information
227227+228228+Update current episode:
229229+230230+```sh
231231+noteleaf media tv update 1 --season 2 --episode 5
232232+```
233233+234234+Add notes and rating:
235235+236236+```sh
237237+noteleaf media tv update 1 --notes "Intense character development" --rating 5
238238+```
239239+240240+### Removing TV Shows
241241+242242+Remove from list:
243243+244244+```sh
245245+noteleaf media tv remove 1
246246+```
247247+248248+## Common Workflows
249249+250250+### Weekend Watch List
251251+252252+Plan your weekend viewing:
253253+254254+```sh
255255+# Add movies
256256+noteleaf media movie add "The Shawshank Redemption"
257257+noteleaf media movie add "Pulp Fiction"
258258+noteleaf media movie add "Forrest Gump"
259259+260260+# View queue
261261+noteleaf media movie list --status queued
262262+```
263263+264264+### Reading Challenge
265265+266266+Track annual reading goal:
267267+268268+```sh
269269+# Add books to queue
270270+noteleaf media book add "The Lord of the Rings"
271271+noteleaf media book add "The Hobbit"
272272+noteleaf media book add "Mistborn"
273273+274274+# Check progress
275275+noteleaf media book list --status finished
276276+noteleaf media book list --status reading
277277+```
278278+279279+### Binge Watching Tracker
280280+281281+Track TV series progress:
282282+283283+```sh
284284+# Start series
285285+noteleaf media tv add "Game of Thrones"
286286+noteleaf media tv watching 1
287287+288288+# Update progress
289289+noteleaf media tv update 1 --season 1 --episode 1
290290+noteleaf media tv update 1 --season 1 --episode 2
291291+292292+# View current shows
293293+noteleaf media tv list --status watching
294294+```
295295+296296+### Media Recommendations
297297+298298+Keep track of recommendations:
299299+300300+```sh
301301+# Add recommended items
302302+noteleaf media book add "Sapiens" --notes "Recommended by John"
303303+noteleaf media movie add "Parasite" --notes "Won Best Picture 2020"
304304+noteleaf media tv add "Succession" --notes "From Reddit recommendations"
305305+306306+# View recommendations
307307+noteleaf media book list --static | grep "Recommended"
308308+```
309309+310310+### Review and Rating
311311+312312+After finishing, add review:
313313+314314+```sh
315315+# Book review
316316+noteleaf media book finished 1
317317+noteleaf media book update 1 \
318318+ --rating 5 \
319319+ --notes "Masterful storytelling. The magic system is one of the best in fantasy."
320320+321321+# Movie review
322322+noteleaf media movie watched 2
323323+noteleaf media movie update 2 \
324324+ --rating 4 \
325325+ --notes "Great cinematography but slow pacing in second act."
326326+327327+# TV show review
328328+noteleaf media tv watched 3
329329+noteleaf media tv update 3 \
330330+ --rating 5 \
331331+ --notes "Best character development I've seen. Final season was perfect."
332332+```
333333+334334+### Genre Organization
335335+336336+Organize by genre using notes:
337337+338338+```sh
339339+noteleaf media book add "Snow Crash" --notes "Genre: Cyberpunk"
340340+noteleaf media book add "Neuromancer" --notes "Genre: Cyberpunk"
341341+noteleaf media book add "The Expanse" --notes "Genre: Space Opera"
342342+343343+# Find by genre
344344+noteleaf media book list --static | grep "Cyberpunk"
345345+```
346346+347347+### Currently Consuming
348348+349349+See what you're currently reading/watching:
350350+351351+```sh
352352+noteleaf media book list --status reading
353353+noteleaf media tv list --status watching
354354+```
355355+356356+### Completed This Month
357357+358358+View completed items:
359359+360360+```sh
361361+noteleaf media book list --status finished
362362+noteleaf media movie list --status watched
363363+noteleaf media tv list --status watched
364364+```
365365+366366+### Clear Finished Items
367367+368368+Archive or remove completed media:
369369+370370+```sh
371371+# Remove watched movies
372372+noteleaf media movie remove 1 2 3
373373+374374+# Remove finished books
375375+noteleaf media book remove 4 5 6
376376+```
377377+378378+## Statistics and Reports
379379+380380+### Reading Statistics
381381+382382+Count books by status:
383383+384384+```sh
385385+echo "Queued: $(noteleaf media book list --status queued --static | wc -l)"
386386+echo "Reading: $(noteleaf media book list --status reading --static | wc -l)"
387387+echo "Finished: $(noteleaf media book list --status finished --static | wc -l)"
388388+```
389389+390390+### Viewing Habits
391391+392392+Track watch queue size:
393393+394394+```sh
395395+echo "Movies to watch: $(noteleaf media movie list --status queued --static | wc -l)"
396396+echo "Shows in progress: $(noteleaf media tv list --status watching --static | wc -l)"
397397+```
+294
website/docs/examples/notes.md
···11+# Note Examples
22+33+Examples of note-taking workflows using Noteleaf.
44+55+## Creating Notes
66+77+### Create Note from Command Line
88+99+```sh
1010+noteleaf note create "Meeting Notes" "Discussed Q4 roadmap and priorities"
1111+```
1212+1313+### Create Note with Tags
1414+1515+```sh
1616+noteleaf note create "API Design Ideas" "REST vs GraphQL considerations" --tags api,design
1717+```
1818+1919+### Create Note from File
2020+2121+```sh
2222+noteleaf note create --file notes.md
2323+```
2424+2525+### Create Note Interactively
2626+2727+Opens your editor for composition:
2828+2929+```sh
3030+noteleaf note create --interactive
3131+```
3232+3333+Specify editor:
3434+3535+```sh
3636+EDITOR=vim noteleaf note create --interactive
3737+```
3838+3939+### Create Note with Multiple Paragraphs
4040+4141+```sh
4242+noteleaf note create "Project Retrospective" "
4343+What went well:
4444+- Good team collaboration
4545+- Met all deadlines
4646+- Quality code reviews
4747+4848+What to improve:
4949+- Better documentation
5050+- More automated tests
5151+- Earlier stakeholder feedback
5252+"
5353+```
5454+5555+## Viewing Notes
5656+5757+### List All Notes
5858+5959+Interactive mode:
6060+6161+```sh
6262+noteleaf note list
6363+```
6464+6565+Static output:
6666+6767+```sh
6868+noteleaf note list --static
6969+```
7070+7171+### Filter by Tags
7272+7373+```sh
7474+noteleaf note list --tags meeting
7575+noteleaf note list --tags api,design
7676+```
7777+7878+### View Archived Notes
7979+8080+```sh
8181+noteleaf note list --archived
8282+```
8383+8484+### Read a Note
8585+8686+Display note content:
8787+8888+```sh
8989+noteleaf note read 1
9090+```
9191+9292+### Search Notes
9393+9494+```sh
9595+noteleaf note search "API design"
9696+noteleaf note search "meeting notes"
9797+```
9898+9999+## Editing Notes
100100+101101+### Edit Note in Editor
102102+103103+Opens note in your editor:
104104+105105+```sh
106106+noteleaf note edit 1
107107+```
108108+109109+With specific editor:
110110+111111+```sh
112112+EDITOR=nvim noteleaf note edit 1
113113+```
114114+115115+### Update Note Title
116116+117117+```sh
118118+noteleaf note update 1 --title "Updated Meeting Notes"
119119+```
120120+121121+### Add Tags to Note
122122+123123+```sh
124124+noteleaf note tag 1 --add important,todo
125125+```
126126+127127+### Remove Tags from Note
128128+129129+```sh
130130+noteleaf note tag 1 --remove draft
131131+```
132132+133133+## Organizing Notes
134134+135135+### Archive a Note
136136+137137+```sh
138138+noteleaf note archive 1
139139+```
140140+141141+### Unarchive a Note
142142+143143+```sh
144144+noteleaf note unarchive 1
145145+```
146146+147147+### Delete a Note
148148+149149+```sh
150150+noteleaf note remove 1
151151+```
152152+153153+With confirmation:
154154+155155+```sh
156156+noteleaf note remove 1 --confirm
157157+```
158158+159159+## Common Workflows
160160+161161+### Quick Meeting Notes
162162+163163+```sh
164164+noteleaf note create "Team Standup $(date +%Y-%m-%d)" --interactive --tags meeting,standup
165165+```
166166+167167+### Project Documentation
168168+169169+```sh
170170+noteleaf note create "Project Architecture" "$(cat architecture.md)" --tags docs,architecture
171171+```
172172+173173+### Research Notes
174174+175175+Create research note:
176176+177177+```sh
178178+noteleaf note create "GraphQL Research" --interactive --tags research,api
179179+```
180180+181181+List all research notes:
182182+183183+```sh
184184+noteleaf note list --tags research
185185+```
186186+187187+### Code Snippets
188188+189189+```sh
190190+noteleaf note create "Useful Git Commands" "
191191+# Rebase last 3 commits
192192+git rebase -i HEAD~3
193193+194194+# Undo last commit
195195+git reset --soft HEAD~1
196196+197197+# Show files changed in commit
198198+git show --name-only <commit>
199199+" --tags git,snippets,reference
200200+```
201201+202202+### Daily Journal
203203+204204+```sh
205205+noteleaf note create "Journal $(date +%Y-%m-%d)" --interactive --tags journal
206206+```
207207+208208+### Ideas and Brainstorming
209209+210210+```sh
211211+noteleaf note create "Product Ideas" --interactive --tags ideas,product
212212+```
213213+214214+List all ideas:
215215+216216+```sh
217217+noteleaf note list --tags ideas
218218+```
219219+220220+## Exporting Notes
221221+222222+### Export Single Note
223223+224224+```sh
225225+noteleaf note export 1 --format markdown > note.md
226226+noteleaf note export 1 --format html > note.html
227227+```
228228+229229+### Export All Notes
230230+231231+```sh
232232+noteleaf note export --all --format markdown --output notes/
233233+```
234234+235235+### Export Notes by Tag
236236+237237+```sh
238238+noteleaf note export --tags meeting --format markdown --output meetings/
239239+```
240240+241241+## Advanced Usage
242242+243243+### Template-based Notes
244244+245245+Create a note template file:
246246+247247+```sh
248248+cat > ~/templates/meeting.md << 'EOF'
249249+# Meeting: [TITLE]
250250+Date: [DATE]
251251+Attendees: [NAMES]
252252+253253+## Agenda
254254+-
255255+256256+## Discussion
257257+-
258258+259259+## Action Items
260260+- [ ]
261261+262262+## Next Meeting
263263+Date:
264264+EOF
265265+```
266266+267267+Use template:
268268+269269+```sh
270270+noteleaf note create --file ~/templates/meeting.md
271271+```
272272+273273+### Linking Notes
274274+275275+Reference other notes in content:
276276+277277+```sh
278278+noteleaf note create "Implementation Plan" "
279279+Based on the design in Note #5, we will:
280280+1. Set up database schema (see Note #12)
281281+2. Implement API endpoints
282282+3. Add frontend components
283283+284284+Related: Note #5 (Design), Note #12 (Schema)
285285+" --tags implementation,plan
286286+```
287287+288288+### Note Statistics
289289+290290+View note count by tag:
291291+292292+```sh
293293+noteleaf note list --static | grep -c "tag:meeting"
294294+```
+482
website/docs/examples/publication.md
···11+# Publication Examples
22+33+Examples of publishing notes to leaflet.pub using the AT Protocol integration.
44+55+## Overview
66+77+The publication system allows you to sync your local notes with leaflet.pub, an AT Protocol-based publishing platform. You can pull drafts from leaflet, publish local notes, and maintain a synchronized writing workflow across platforms.
88+99+## Authentication
1010+1111+### Initial Authentication
1212+1313+Authenticate with your BlueSky account:
1414+1515+```sh
1616+noteleaf pub auth username.bsky.social
1717+```
1818+1919+This will prompt for your app password interactively.
2020+2121+### Authenticate with Password Flag
2222+2323+Provide credentials directly:
2424+2525+```sh
2626+noteleaf pub auth username.bsky.social --password "your-app-password"
2727+```
2828+2929+### Creating an App Password
3030+3131+1. Visit [bsky.app/settings/app-passwords](https://bsky.app/settings/app-passwords)
3232+2. Create a new app password named "noteleaf"
3333+3. Use that password (not your main password) for authentication
3434+3535+### Check Authentication Status
3636+3737+```sh
3838+noteleaf pub status
3939+```
4040+4141+## Pulling Documents from Leaflet
4242+4343+### Pull All Documents
4444+4545+Fetch all drafts and published documents:
4646+4747+```sh
4848+noteleaf pub pull
4949+```
5050+5151+This will:
5252+- Connect to your leaflet account
5353+- Fetch all documents in your repository
5454+- Create new notes for documents not yet synced
5555+- Update existing notes that have changed
5656+5757+### After Pulling
5858+5959+List the synced notes:
6060+6161+```sh
6262+noteleaf pub list
6363+```
6464+6565+View synced notes interactively:
6666+6767+```sh
6868+noteleaf pub list --interactive
6969+```
7070+7171+## Publishing Local Notes
7272+7373+### Publish a Note
7474+7575+Create a new document on leaflet from a local note:
7676+7777+```sh
7878+noteleaf pub post 123
7979+```
8080+8181+### Publish as Draft
8282+8383+Create as draft instead of publishing immediately:
8484+8585+```sh
8686+noteleaf pub post 123 --draft
8787+```
8888+8989+### Preview Before Publishing
9090+9191+See what would be posted without actually posting:
9292+9393+```sh
9494+noteleaf pub post 123 --preview
9595+```
9696+9797+### Validate Conversion
9898+9999+Check if markdown conversion will work:
100100+101101+```sh
102102+noteleaf pub post 123 --validate
103103+```
104104+105105+## Updating Published Documents
106106+107107+### Update an Existing Document
108108+109109+Update a previously published note:
110110+111111+```sh
112112+noteleaf pub patch 123
113113+```
114114+115115+### Preview Update
116116+117117+See what would be updated:
118118+119119+```sh
120120+noteleaf pub patch 123 --preview
121121+```
122122+123123+### Validate Update
124124+125125+Check conversion before updating:
126126+127127+```sh
128128+noteleaf pub patch 123 --validate
129129+```
130130+131131+## Batch Operations
132132+133133+### Publish Multiple Notes
134134+135135+Create or update multiple documents at once:
136136+137137+```sh
138138+noteleaf pub push 1 2 3 4 5
139139+```
140140+141141+This will:
142142+- Create new documents for notes never published
143143+- Update existing documents for notes already on leaflet
144144+145145+### Batch Publish as Drafts
146146+147147+```sh
148148+noteleaf pub push 10 11 12 --draft
149149+```
150150+151151+## Viewing Publications
152152+153153+### List All Synced Notes
154154+155155+```sh
156156+noteleaf pub list
157157+```
158158+159159+Aliases:
160160+```sh
161161+noteleaf pub ls
162162+```
163163+164164+### Filter by Status
165165+166166+Published documents only:
167167+```sh
168168+noteleaf pub list --published
169169+```
170170+171171+Drafts only:
172172+```sh
173173+noteleaf pub list --draft
174174+```
175175+176176+All documents:
177177+```sh
178178+noteleaf pub list --all
179179+```
180180+181181+### Interactive Browser
182182+183183+Browse with TUI interface:
184184+185185+```sh
186186+noteleaf pub list --interactive
187187+noteleaf pub list -i
188188+```
189189+190190+With filters:
191191+```sh
192192+noteleaf pub list --published --interactive
193193+noteleaf pub list --draft -i
194194+```
195195+196196+## Common Workflows
197197+198198+### Initial Setup and Pull
199199+200200+Set up leaflet integration and pull existing documents:
201201+202202+```sh
203203+# Authenticate
204204+noteleaf pub auth username.bsky.social
205205+206206+# Check status
207207+noteleaf pub status
208208+209209+# Pull all documents
210210+noteleaf pub pull
211211+212212+# View synced notes
213213+noteleaf pub list --interactive
214214+```
215215+216216+### Publishing Workflow
217217+218218+Write locally, then publish to leaflet:
219219+220220+```sh
221221+# Create a note
222222+noteleaf note create "My Blog Post" --interactive
223223+224224+# List notes to get ID
225225+noteleaf note list
226226+227227+# Publish as draft first
228228+noteleaf pub post 42 --draft
229229+230230+# Review draft on leaflet.pub
231231+# Make edits locally
232232+noteleaf note edit 42
233233+234234+# Update the draft
235235+noteleaf pub patch 42
236236+237237+# When ready, republish without --draft flag
238238+noteleaf pub post 42
239239+```
240240+241241+### Sync Workflow
242242+243243+Keep local notes in sync with leaflet:
244244+245245+```sh
246246+# Pull latest changes from leaflet
247247+noteleaf pub pull
248248+249249+# Make local edits
250250+noteleaf note edit 123
251251+252252+# Push changes back
253253+noteleaf pub patch 123
254254+255255+# Check sync status
256256+noteleaf pub list --published
257257+```
258258+259259+### Draft Management
260260+261261+Work with drafts before publishing:
262262+263263+```sh
264264+# Create drafts
265265+noteleaf pub post 10 --draft
266266+noteleaf pub post 11 --draft
267267+noteleaf pub post 12 --draft
268268+269269+# View all drafts
270270+noteleaf pub list --draft
271271+272272+# Edit a draft locally
273273+noteleaf note edit 10
274274+275275+# Update on leaflet
276276+noteleaf pub patch 10
277277+278278+# Promote draft to published (re-post without --draft)
279279+noteleaf pub post 10
280280+```
281281+282282+### Batch Publishing
283283+284284+Publish multiple notes at once:
285285+286286+```sh
287287+# Create several notes
288288+noteleaf note create "Post 1" "Content 1"
289289+noteleaf note create "Post 2" "Content 2"
290290+noteleaf note create "Post 3" "Content 3"
291291+292292+# Get note IDs
293293+noteleaf note list --static
294294+295295+# Publish all at once
296296+noteleaf pub push 50 51 52
297297+298298+# Or as drafts
299299+noteleaf pub push 50 51 52 --draft
300300+```
301301+302302+### Review Before Publishing
303303+304304+Always preview and validate before publishing:
305305+306306+```sh
307307+# Validate markdown conversion
308308+noteleaf pub post 99 --validate
309309+310310+# Preview the output
311311+noteleaf pub post 99 --preview
312312+313313+# If everything looks good, publish
314314+noteleaf pub post 99
315315+```
316316+317317+### Cross-Platform Editing
318318+319319+Edit on leaflet.pub, sync to local:
320320+321321+```sh
322322+# Pull changes from leaflet
323323+noteleaf pub pull
324324+325325+# View what changed
326326+noteleaf pub list --interactive
327327+328328+# Make additional edits locally
329329+noteleaf note edit 123
330330+331331+# Push updates back
332332+noteleaf pub patch 123
333333+```
334334+335335+### Status Monitoring
336336+337337+Check authentication and publication status:
338338+339339+```sh
340340+# Check auth status
341341+noteleaf pub status
342342+343343+# List published documents
344344+noteleaf pub list --published
345345+346346+# Count publications
347347+noteleaf pub list --published --static | wc -l
348348+```
349349+350350+## Troubleshooting
351351+352352+### Re-authenticate
353353+354354+If authentication expires:
355355+356356+```sh
357357+noteleaf pub auth username.bsky.social
358358+```
359359+360360+### Check Status
361361+362362+Verify connection:
363363+364364+```sh
365365+noteleaf pub status
366366+```
367367+368368+### Force Pull
369369+370370+Re-sync all documents:
371371+372372+```sh
373373+noteleaf pub pull
374374+```
375375+376376+### Validate Before Publishing
377377+378378+If publishing fails, validate first:
379379+380380+```sh
381381+noteleaf pub post 123 --validate
382382+```
383383+384384+Check for markdown formatting issues that might not convert properly.
385385+386386+## Integration with Notes
387387+388388+### Publishing Flow
389389+390390+```sh
391391+# Create note locally
392392+noteleaf note create "Article Title" --interactive
393393+394394+# Add tags for organization
395395+noteleaf note tag 1 --add published,blog
396396+397397+# Publish to leaflet
398398+noteleaf pub post 1
399399+400400+# Continue editing locally
401401+noteleaf note edit 1
402402+403403+# Sync updates
404404+noteleaf pub patch 1
405405+```
406406+407407+### Import from Leaflet
408408+409409+```sh
410410+# Pull from leaflet
411411+noteleaf pub pull
412412+413413+# View imported notes
414414+noteleaf pub list
415415+416416+# Edit locally
417417+noteleaf note edit 123
418418+419419+# Continue working with standard note commands
420420+noteleaf note read 123
421421+noteleaf note tag 123 --add imported
422422+```
423423+424424+## Advanced Usage
425425+426426+### Selective Publishing
427427+428428+Publish only specific notes with a tag:
429429+430430+```sh
431431+# Tag notes for publication
432432+noteleaf note tag 10 --add ready-to-publish
433433+noteleaf note tag 11 --add ready-to-publish
434434+435435+# List tagged notes
436436+noteleaf note list --tags ready-to-publish
437437+438438+# Publish those notes
439439+noteleaf pub push 10 11
440440+```
441441+442442+### Draft Review Cycle
443443+444444+```sh
445445+# Publish drafts
446446+noteleaf pub push 1 2 3 --draft
447447+448448+# Review on leaflet.pub in browser
449449+# Make edits locally based on feedback
450450+451451+# Update drafts
452452+noteleaf pub push 1 2 3
453453+454454+# When ready, publish (create as non-drafts)
455455+noteleaf pub post 1
456456+noteleaf pub post 2
457457+noteleaf pub post 3
458458+```
459459+460460+### Publication Archive
461461+462462+Keep track of published work:
463463+464464+```sh
465465+# Tag published notes
466466+noteleaf note tag 123 --add published,2024,blog
467467+468468+# List all published notes
469469+noteleaf note list --tags published
470470+471471+# Archive old publications
472472+noteleaf note archive 123
473473+```
474474+475475+## Notes
476476+477477+- Authentication tokens are stored in the configuration file
478478+- Notes are matched by their leaflet record key (rkey)
479479+- The `push` command intelligently chooses between `post` and `patch`
480480+- Draft status is preserved when patching existing documents
481481+- Use `--preview` and `--validate` flags to test before publishing
482482+- Pull regularly to stay synced with changes made on leaflet.pub
+288
website/docs/examples/tasks.md
···11+# Task Examples
22+33+Examples of common task management workflows using Noteleaf.
44+55+## Basic Task Management
66+77+### Create a Simple Task
88+99+```sh
1010+noteleaf task add "Buy groceries"
1111+```
1212+1313+### Create Task with Priority
1414+1515+```sh
1616+noteleaf task add "Fix critical bug" --priority urgent
1717+noteleaf task add "Update documentation" --priority low
1818+```
1919+2020+### Create Task with Project
2121+2222+```sh
2323+noteleaf task add "Design new homepage" --project website
2424+noteleaf task add "Refactor auth service" --project backend
2525+```
2626+2727+### Create Task with Due Date
2828+2929+```sh
3030+noteleaf task add "Submit report" --due 2024-12-31
3131+noteleaf task add "Review PRs" --due tomorrow
3232+```
3333+3434+### Create Task with Tags
3535+3636+```sh
3737+noteleaf task add "Write blog post" --tags writing,blog
3838+noteleaf task add "Server maintenance" --tags ops,backend,infra
3939+```
4040+4141+### Create Task with Context
4242+4343+```sh
4444+noteleaf task add "Call client" --context phone
4545+noteleaf task add "Deploy to production" --context office
4646+```
4747+4848+### Create Task with All Attributes
4949+5050+```sh
5151+noteleaf task add "Launch marketing campaign" \
5252+ --project marketing \
5353+ --priority high \
5454+ --due 2024-06-15 \
5555+ --tags campaign,social \
5656+ --context office
5757+```
5858+5959+## Viewing Tasks
6060+6161+### List All Tasks
6262+6363+Interactive mode:
6464+6565+```sh
6666+noteleaf task list
6767+```
6868+6969+Static output:
7070+7171+```sh
7272+noteleaf task list --static
7373+```
7474+7575+### Filter by Status
7676+7777+```sh
7878+noteleaf task list --status pending
7979+noteleaf task list --status completed
8080+```
8181+8282+### Filter by Priority
8383+8484+```sh
8585+noteleaf task list --priority high
8686+noteleaf task list --priority urgent
8787+```
8888+8989+### Filter by Project
9090+9191+```sh
9292+noteleaf task list --project website
9393+noteleaf task list --project backend
9494+```
9595+9696+### Filter by Tags
9797+9898+```sh
9999+noteleaf task list --tags urgent,bug
100100+```
101101+102102+### View Task Details
103103+104104+```sh
105105+noteleaf task view 1
106106+```
107107+108108+## Updating Tasks
109109+110110+### Mark Task as Done
111111+112112+```sh
113113+noteleaf task done 1
114114+```
115115+116116+### Update Task Priority
117117+118118+```sh
119119+noteleaf task update 1 --priority high
120120+```
121121+122122+### Update Task Project
123123+124124+```sh
125125+noteleaf task update 1 --project website
126126+```
127127+128128+### Add Tags to Task
129129+130130+```sh
131131+noteleaf task update 1 --add-tags backend,api
132132+```
133133+134134+### Remove Tags from Task
135135+136136+```sh
137137+noteleaf task update 1 --remove-tags urgent
138138+```
139139+140140+### Edit Task Interactively
141141+142142+Opens task in your editor:
143143+144144+```sh
145145+noteleaf task edit 1
146146+```
147147+148148+## Time Tracking
149149+150150+### Start Time Tracking
151151+152152+```sh
153153+noteleaf task start 1
154154+```
155155+156156+### Stop Time Tracking
157157+158158+```sh
159159+noteleaf task stop 1
160160+```
161161+162162+### View Timesheet
163163+164164+All entries:
165165+166166+```sh
167167+noteleaf task timesheet
168168+```
169169+170170+Filtered by date:
171171+172172+```sh
173173+noteleaf task timesheet --from 2024-01-01 --to 2024-01-31
174174+```
175175+176176+Filtered by project:
177177+178178+```sh
179179+noteleaf task timesheet --project website
180180+```
181181+182182+## Project Management
183183+184184+### List All Projects
185185+186186+```sh
187187+noteleaf task projects
188188+```
189189+190190+### View Tasks in Project
191191+192192+```sh
193193+noteleaf task list --project website
194194+```
195195+196196+## Tag Management
197197+198198+### List All Tags
199199+200200+```sh
201201+noteleaf task tags
202202+```
203203+204204+### View Tasks with Tag
205205+206206+```sh
207207+noteleaf task list --tags urgent
208208+```
209209+210210+## Context Management
211211+212212+### List All Contexts
213213+214214+```sh
215215+noteleaf task contexts
216216+```
217217+218218+### View Tasks in Context
219219+220220+```sh
221221+noteleaf task list --context office
222222+```
223223+224224+## Advanced Workflows
225225+226226+### Daily Planning
227227+228228+View today's tasks:
229229+230230+```sh
231231+noteleaf task list --due today
232232+```
233233+234234+View overdue tasks:
235235+236236+```sh
237237+noteleaf task list --due overdue
238238+```
239239+240240+### Weekly Review
241241+242242+View completed tasks this week:
243243+244244+```sh
245245+noteleaf task list --status completed --from monday
246246+```
247247+248248+View pending high-priority tasks:
249249+250250+```sh
251251+noteleaf task list --status pending --priority high
252252+```
253253+254254+### Project Focus
255255+256256+List all tasks for a project, sorted by priority:
257257+258258+```sh
259259+noteleaf task list --project website --sort priority
260260+```
261261+262262+### Bulk Operations
263263+264264+Mark multiple tasks as done:
265265+266266+```sh
267267+noteleaf task done 1 2 3 4
268268+```
269269+270270+Delete multiple tasks:
271271+272272+```sh
273273+noteleaf task delete 5 6 7
274274+```
275275+276276+## Task Deletion
277277+278278+### Delete a Task
279279+280280+```sh
281281+noteleaf task delete 1
282282+```
283283+284284+### Delete with Confirmation
285285+286286+```sh
287287+noteleaf task delete 1 --confirm
288288+```