···11+---
22+id: configuration
33+title: Configuration
44+sidebar_label: Configuration
55+sidebar_position: 6
66+description: Reference for configuration locations, defaults, and options.
77+---
88+19# Configuration
210311Noteleaf stores its configuration in a TOML file. The configuration file location depends on your operating system and can be overridden with environment variables.
···3139```sh
3240export NOTELEAF_CONFIG=/path/to/custom/config.toml
3341```
4242+4343+### File Structure
4444+4545+Configuration is stored as [TOML](https://toml.io). Each key maps 1:1 with the fields shown by `noteleaf config show`. A minimal file looks like:
4646+4747+```toml
4848+date_format = "2006-01-02"
4949+color_scheme = "default"
5050+```
5151+5252+There is no required orderingโthe parser loads the file, applies defaults for missing keys, and writes a normalized version whenever you run `noteleaf config set ...`. This means you can edit the file manually or stick entirely to CLI helpers.
34533554## Configuration Options
3655···318337**Type:** String (ISO8601)
319338**Default:** None
320339340340+## Editor Integration
341341+342342+The `editor` key wires Noteleaf into your preferred text editor. Resolution order:
343343+344344+1. `editor` inside `.noteleaf.conf.toml`
345345+2. `$EDITOR` environment variable
346346+3. System default (usually `vi` on Unix)
347347+348348+Where it is used:
349349+350350+- `noteleaf note edit <id>` always opens the configured editor.
351351+- `noteleaf note create -e` or `--editor` lets you capture inline text and immediately refine it in the editor.
352352+- Interactive creation (`noteleaf note create -i`) respects the same setting when you choose to open the note.
353353+354354+Example configuration:
355355+356356+```toml
357357+editor = "nvim"
358358+```
359359+360360+If you frequently switch editors, leave the config empty and export `$EDITOR` before launching Noteleaf:
361361+362362+```sh
363363+EDITOR="zed" noteleaf note edit 5
364364+```
365365+321366## Managing Configuration
322367323368### View Current Configuration
···389434390435## Environment Variables
391436392392-Noteleaf respects the following environment variables:
437437+Environment overrides are resolved before configuration values. Set them when you need temporary behavior (CI jobs, alternate workspaces, etc.).
393438394394-- `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)
439439+| Variable | Purpose | Notes |
440440+|----------|---------|-------|
441441+| `NOTELEAF_CONFIG` | Absolute path to the TOML file | Overrides platform defaults. Parent directories are created automatically. |
442442+| `NOTELEAF_DATA_DIR` | Root directory for the SQLite DB, notes, articles, and attachments | Useful for portable installs (USB drive, synced folder). |
443443+| `EDITOR` | Fallback editor when the `editor` config key is empty | Checked by all note-related commands. |
397444398398-Example:
445445+Usage example:
399446400447```sh
401401-export NOTELEAF_CONFIG=~/.config/noteleaf/config.toml
402402-export NOTELEAF_DATA_DIR=~/Documents/noteleaf-data
403403-export EDITOR=nvim
448448+export NOTELEAF_CONFIG=~/.config/noteleaf/work.conf.toml
449449+export NOTELEAF_DATA_DIR=~/Sync/workspace-data
450450+export EDITOR=helix
404451```
452452+453453+Because `NOTELEAF_DATA_DIR` cascades to the article and note directories, a single export is all you need to relocate the entire knowledge base.
454454+455455+## Customization
456456+457457+### Themes and Colors
458458+459459+The `color_scheme` option controls how Fang (the underlying Cobra replacement) styles command help and certain UI components. Right now the only valid value is `"default"`, which maps to Noteleafโs Iceberg-inspired palette. Future releases will add explicit `light`/`dark` options; until then customization requires overriding your terminal theme or building Noteleaf from source with changes in `internal/ui/palette.go`.
460460+461461+```toml
462462+color_scheme = "default" # leave blank to adopt upcoming auto-mode
463463+```
464464+465465+### Keyboard Shortcuts
466466+467467+All interactive views share the same key map:
468468+469469+| Keys | Action |
470470+|------|--------|
471471+| `โ / k`, `โ / j` | Move selection |
472472+| `enter` | Open the selected row |
473473+| `v` | View details in a side panel (where supported) |
474474+| `/` | Search/filter (live) |
475475+| `r` | Reload data |
476476+| `?` | Show full help, including custom actions for the current view |
477477+| `q`, `ctrl+c` | Quit the view |
478478+| `esc`, `backspace` | Exit search/help/detail panels |
479479+| `1-9` | Jump directly to the corresponding row index |
480480+481481+Press `?` inside any list/table to confirm the bindingsโthis uses Bubble Teaโs built-in help component so it always reflects the current screen.
482482+483483+### Output Formats
484484+485485+- `export_format` sets the default for future export commands (currently `json`).
486486+- Task commands support JSON today: `noteleaf todo view 12 --json` or `noteleaf todo list --static --json`.
487487+- The `--format` flag on `noteleaf todo view` switches between `detailed` and `brief` layouts, which is handy when scripting.
488488+489489+Examples:
490490+491491+```sh
492492+noteleaf todo view 12 --format brief --json | jq '.status'
493493+noteleaf todo list --static --json > tasks.json
494494+noteleaf config set export_format "csv" # prepare for upcoming exporters
495495+```
496496+497497+Even when there is no dedicated exporter yet, the SQLite database lives in the open, so you can always run your own `SELECT ...` queries or use `sqlite-utils` to produce CSV/JSON.
+8
website/docs/Quickstart.md
···11+---
22+id: quickstart
33+title: Quickstart Guide
44+sidebar_label: Quickstart
55+sidebar_position: 1
66+description: Install Noteleaf and learn the essentials in minutes.
77+---
88+19# Quickstart Guide
210311This guide will walk you through installing Noteleaf and getting productive with tasks, notes, and media tracking in under 15 minutes.
+9
website/docs/articles/_category_.json
···11+{
22+ "label": "Articles",
33+ "position": 6,
44+ "link": {
55+ "type": "generated-index",
66+ "title": "Article Archive",
77+ "description": "Save, read, and organize web articles locally."
88+ }
99+}
+75
website/docs/articles/management.md
···11+---
22+title: Article Management
33+sidebar_label: Management
44+description: Save URLs, inspect metadata, and read articles without leaving the CLI.
55+sidebar_position: 2
66+---
77+88+# Article Management
99+1010+## Save Articles from URLs
1111+1212+```sh
1313+noteleaf article add https://example.com/long-form-piece
1414+```
1515+1616+What happens:
1717+1818+1. The CLI checks the database to ensure the URL was not imported already.
1919+2. It fetches the page with a reader-friendly User-Agent (`curl/8.4.0`) and English `Accept-Language` headers to avoid blocked responses.
2020+3. Parsed content is written to Markdown and HTML files under `articles_dir`.
2121+4. A database record is inserted with all metadata and file paths.
2222+2323+If parsing fails (unsupported domain, network issue, etc.) nothing is written to disk, so partial entries never appear in your archive.
2424+2525+## Parsing and Extraction
2626+2727+The parser uses a two-layer strategy:
2828+2929+1. **Domain-specific rules** check the XPath selectors defined in `internal/articles/rules`. These rules strip unwanted elements (cookie banners, nav bars), capture the main body, and record author/date fields accurately.
3030+2. **Heuristic fallback** scores every DOM node, penalizes high link-density sections, and picks the most โarticle-likeโ block. It also pulls metadata from JSON-LD `Article` objects when available.
3131+3232+During saving, the Markdown file gets a generated header:
3333+3434+```markdown
3535+# Article Title
3636+3737+**Author:** Jane Smith
3838+3939+**Date:** 2024-01-02
4040+4141+**Source:** https://example.com/long-form-piece
4242+4343+**Saved:** 2024-02-05 10:45:12
4444+```
4545+4646+Everything after the `---` separator is the cleaned article content.
4747+4848+## Reading in the Terminal
4949+5050+There are two ways to inspect what you saved:
5151+5252+- `noteleaf article view <id>` shows metadata, verifies whether the files still exist, and prints the first ~20 lines as a preview.
5353+- `noteleaf article read <id>` renders the full Markdown using [Charmโs Glamour](https://github.com/charmbracelet/glamour), giving you syntax highlighting, proper headings, and wrapped paragraphs directly in the terminal.
5454+5555+If you prefer your editor, open the Markdown path printed by `view`. Both Markdown and HTML copies belong to you, so feel free to annotate or reformat them.
5656+5757+## Article Metadata Reference
5858+5959+Use `noteleaf article list` to see titles and authors:
6060+6161+```sh
6262+noteleaf article list # newest first
6363+noteleaf article list "sqlite" # full-text filter on titles
6464+noteleaf article list --author "Kim" # author filter
6565+noteleaf article list -l 5 # top 5 results
6666+```
6767+6868+Each entry includes the created timestamp. The `view` command provides the raw paths so you can script around them, for example:
6969+7070+```sh
7171+md=$(noteleaf article view 12 | rg 'Markdown:' | awk '{print $3}')
7272+$EDITOR "$md"
7373+```
7474+7575+All metadata lives in the SQLite `articles` table, making it easy to run your own reports with `sqlite3` if needed.
+71
website/docs/articles/organization.md
···11+---
22+title: Article Organization
33+sidebar_label: Organization
44+description: Filter your archive, add lightweight tags, and keep backups tidy.
55+sidebar_position: 3
66+---
77+88+# Article Organization
99+1010+## Filter by Author or Title
1111+1212+`noteleaf article list` accepts both a free-form query (matches the title) and dedicated flags:
1313+1414+```sh
1515+# Anything with "SQLite" in the title
1616+noteleaf article list SQLite
1717+1818+# Limit to a single author
1919+noteleaf article list --author "Ada Palmer"
2020+2121+# Cap the output for quick reviews
2222+noteleaf article list --author "Ada Palmer" --limit 3
2323+```
2424+2525+Because the database stores created timestamps, results come back with the newest article first, making it easy to run weekly reviews.
2626+2727+## Tagging Articles
2828+2929+There is no first-class tagging UI yet, but Markdown files are yours to edit. Common patterns:
3030+3131+```markdown
3232+---
3333+tags: [distributed-systems, reference]
3434+project: moonshot
3535+---
3636+```
3737+3838+Drop that block right after the generated metadata and tools like `rg` or `ripgrep --json` can surface tagged snippets instantly. You can also maintain a separate note that lists article IDs per topic if you prefer not to edit the captured files.
3939+4040+## Read vs Unread
4141+4242+Opening an article in the terminal does not flip a status flag. Use one of these lightweight conventions instead:
4343+4444+- Prefix the Markdown filename with `read-` once you are done.
4545+- Keep a running checklist note (e.g., โArticles Inboxโ) that references IDs and mark them off as you read them.
4646+- Create a task linked to the article ID (`todo add "Summarize article #14"`), then close the task when you finish.
4747+4848+All three approaches work today and will map cleanly to future built-in read/unread tracking.
4949+5050+## Archiving and Backups
5151+5252+The archive lives under `articles_dir`. By default that is `<data_dir>/articles`, where `<data_dir>` depends on your OS:
5353+5454+| Platform | Default |
5555+|----------|---------|
5656+| Linux | `~/.local/share/noteleaf/articles` |
5757+| macOS | `~/Library/Application Support/noteleaf/articles` |
5858+| Windows | `%LOCALAPPDATA%\noteleaf\articles` |
5959+6060+You can override the location via the `articles_dir` setting in `~/.config/noteleaf/.noteleaf.conf.toml` (or by pointing `NOTELEAF_DATA_DIR` to a different root before launching the CLI).
6161+6262+Because every import produces Markdown + HTML, the directory is perfect for version control:
6363+6464+```sh
6565+cd ~/.local/share/noteleaf/articles
6666+git init
6767+git add .
6868+git commit -m "Initial snapshot of article archive"
6969+```
7070+7171+Pair that with your cloud backup tool of choice and you have a durable, fully-offline knowledge base that still integrates seamlessly with Noteleafโs search commands.
+54
website/docs/articles/overview.md
···11+---
22+title: Article Overview
33+sidebar_label: Overview
44+description: How the article parser saves content for offline reading.
55+sidebar_position: 1
66+---
77+88+# Article Overview
99+1010+The `noteleaf article` command turns any supported URL into two files on disk:
1111+1212+- A clean Markdown document (great for terminal reading).
1313+- A rendered HTML copy (handy for rich export or sharing).
1414+1515+Both files live inside your configured `articles_dir` (defaults to `<data_dir>/articles`). The SQLite database stores the metadata and file paths so you can query, list, and delete articles without worrying about directories.
1616+1717+## How Parsing Works
1818+1919+1. **Domain rules first**: Each supported site has a small XPath rule file (`internal/articles/rules/*.txt`).
2020+2. **Heuristic fallback**: When no rule exists, the parser falls back to the readability-style heuristic extractor that scores DOM nodes, removes nav bars, and preserves headings/links.
2121+3. **Metadata extraction**: The parser also looks for OpenGraph/JSON-LD tags to capture author names and publish dates.
2222+2323+You can see the currently loaded rule set by running:
2424+2525+```sh
2626+noteleaf article --help
2727+```
2828+2929+The help output prints the supported domains and the storage directory that is currently in use.
3030+3131+## Saved Metadata
3232+3333+Every article record contains:
3434+3535+- URL and canonical title
3636+- Author (if present in metadata)
3737+- Publication date (stored as plain text, e.g., `2024-01-02`)
3838+- Markdown file path
3939+- HTML file path
4040+- Created/modified timestamps
4141+4242+These fields make it easy to build reading logs, cite sources in notes, or reference articles from tasks.
4343+4444+## Commands at a Glance
4545+4646+| Command | Purpose |
4747+|----------------------------------|---------|
4848+| `noteleaf article add <url>` | Parse, save, and index a URL |
4949+| `noteleaf article list [query]` | Show saved items; filter with `--author` or `--limit` |
5050+| `noteleaf article view <id>` | Inspect metadata + a short preview |
5151+| `noteleaf article read <id>` | Render the Markdown nicely in your terminal |
5252+| `noteleaf article remove <id>` | Delete the DB entry and the files |
5353+5454+The CLI automatically prevents duplicate imports by checking the URL before parsing.
···11+---
22+title: Architecture Overview
33+sidebar_label: Architecture
44+description: Application structure, storage, and UI layers.
55+sidebar_position: 3
66+---
77+88+# Architecture Overview
99+1010+## Architecture Overview
1111+1212+### Application Structure
1313+1414+Noteleaf follows a clean architecture pattern with clear separation of concerns:
1515+1616+```
1717+cmd/ - CLI commands and user interface
1818+internal/
1919+ handlers/ - Business logic and orchestration
2020+ repo/ - Database access layer
2121+ ui/ - Terminal UI components (Bubble Tea)
2222+ models/ - Domain models
2323+ public/ - Leaflet.pub integration
2424+```
2525+2626+Each layer has defined responsibilities with minimal coupling between them.
2727+2828+### Storage and Database
2929+3030+**SQLite Database**: All structured data (tasks, metadata, relationships) lives in a single SQLite file at `~/.local/share/noteleaf/noteleaf.db` (Linux) or `~/Library/Application Support/noteleaf/noteleaf.db` (macOS).
3131+3232+**Markdown Files**: Note content is stored as individual markdown files on disk. The database tracks metadata while keeping your notes in a portable, human-readable format.
3333+3434+**Database Schema**: Tables for tasks, notes, articles, books, movies, TV shows, publications, and linking tables for tags and relationships. Migrations handle schema evolution.
3535+3636+### TUI Framework (Bubble Tea)
3737+3838+The interactive interface is built with [Bubble Tea](https://github.com/charmbracelet/bubbletea), a Go framework for terminal user interfaces based on The Elm Architecture:
3939+4040+- **Model**: Application state (current view, selected item, filters)
4141+- **Update**: State transitions based on user input
4242+- **View**: Render the current state to the terminal
4343+4444+This architecture makes the UI predictable, testable, and composable. Each screen is an independent component that can be developed and tested in isolation.
+19
website/docs/concepts/data-model.md
···11+---
22+title: Unified Data Model
33+sidebar_label: Data Model
44+description: How tasks, notes, and media connect inside Noteleaf.
55+sidebar_position: 2
66+---
77+88+# Unified Data Model
99+1010+## Philosophy
1111+1212+Noteleaf treats all personal information as interconnected. Tasks, notes, articles, books, movies, and TV shows exist in a single database where relationships between items are first-class citizens:
1313+1414+- Link notes to tasks to document your work
1515+- Tag books and articles with the same taxonomy as your tasks
1616+- Track reading lists alongside project work
1717+- Connect media items to research notes
1818+1919+This unified approach mirrors how knowledge work actually happensโprojects involve research, reading generates ideas, and ideas spawn tasks.
+33
website/docs/concepts/design-system.md
···11+---
22+title: Design System
33+sidebar_label: Design System
44+description: Color palette guidance that keeps the terminal UI cohesive.
55+sidebar_position: 4
66+---
77+88+# Design System
99+1010+## Color Palette and Design System
1111+1212+Noteleaf uses a carefully chosen color palette defined in `internal/ui/palette.go`:
1313+1414+**Brand Colors**:
1515+1616+- **Malibu** (`#00A4FF`): Primary blue for accents and highlights
1717+- **Julep** (`#00FFB2`): Success green for completed items
1818+- **Sriracha** (`#EB4268`): Warning red for urgent/error states
1919+- **Tang** (`#FF985A`): Orange for warnings and attention
2020+- **Lichen** (`#5CDFEA`): Teal for informational elements
2121+2222+**Neutral Palette** (Dark to Light):
2323+2424+- **Pepper** (`#201F26`): Dark background
2525+- **BBQ** (`#2d2c35`): Secondary background
2626+- **Charcoal** (`#3A3943`): Tertiary background
2727+- **Iron** (`#4D4C57`): Borders and subtle elements
2828+- **Oyster** (`#605F6B`): Muted text
2929+- **Smoke** (`#BFBCC8`): Secondary text
3030+- **Salt** (`#F1EFEF`): Primary text in dark mode
3131+- **Butter** (`#FFFAF1`): Light background
3232+3333+This palette ensures consistency across all UI components and provides excellent contrast for readability in terminal environments.
+111
website/docs/concepts/getting-started.md
···11+---
22+title: Getting Started
33+sidebar_label: Getting Started
44+description: Installation steps, configuration overview, and ways to find help.
55+sidebar_position: 5
66+---
77+88+# Getting Started
99+1010+## Installation and Setup
1111+1212+### System Requirements
1313+1414+- Go 1.24 or higher
1515+- SQLite 3.35 or higher (usually bundled)
1616+- Terminal with 256-color support
1717+- Unix-like OS (Linux, macOS, WSL)
1818+1919+### Building from Source
2020+2121+Clone the repository and build:
2222+2323+```sh
2424+git clone https://github.com/stormlightlabs/noteleaf
2525+cd noteleaf
2626+go build -o ./tmp/noteleaf ./cmd
2727+```
2828+2929+Install to your GOPATH:
3030+3131+```sh
3232+go install
3333+```
3434+3535+### Database Initialization
3636+3737+Run setup to create the database and configuration file:
3838+3939+```sh
4040+noteleaf setup
4141+```
4242+4343+This creates:
4444+4545+- Database at platform-specific application data directory
4646+- Configuration file at platform-specific config directory
4747+- Default settings for editor, priorities, and display options
4848+4949+### Seeding Sample Data
5050+5151+For exploration and testing, populate the database with example data:
5252+5353+```sh
5454+noteleaf setup seed
5555+```
5656+5757+This creates sample tasks, notes, books, and other items to help you understand the system's capabilities.
5858+5959+## Configuration Overview
6060+6161+Configuration lives in `config.toml` at the platform-specific config directory.
6262+6363+**Editor Settings**:
6464+6565+```toml
6666+[editor]
6767+command = "nvim"
6868+args = []
6969+```
7070+7171+**Task Defaults**:
7272+7373+```toml
7474+[task]
7575+default_priority = "medium"
7676+default_status = "pending"
7777+```
7878+7979+**Display Options**:
8080+8181+```toml
8282+[display]
8383+date_format = "2006-01-02"
8484+time_format = "15:04"
8585+```
8686+8787+View current configuration:
8888+8989+```sh
9090+noteleaf config show
9191+```
9292+9393+Update settings:
9494+9595+```sh
9696+noteleaf config set editor vim
9797+```
9898+9999+See the [Configuration](../Configuration.md) guide for complete options.
100100+101101+## Getting Help
102102+103103+Every command includes help text:
104104+105105+```sh
106106+noteleaf --help
107107+noteleaf task --help
108108+noteleaf task add --help
109109+```
110110+111111+For detailed command reference, run `noteleaf --help` and drill into the subcommand-specific help pages.
+26
website/docs/concepts/overview.md
···11+---
22+title: Overview
33+sidebar_label: Overview
44+description: Noteleaf philosophy and reasons for a terminal-first approach.
55+sidebar_position: 1
66+---
77+88+# Overview
99+1010+## What is Noteleaf?
1111+1212+Noteleaf is a terminal-based personal information manager that combines task management, note-taking, media tracking, and decentralized publishing into a unified system. Built for developers and power users who prefer keyboard-driven workflows, Noteleaf brings TaskWarrior-inspired task management together with a personal knowledge base and reading list tracker.
1313+1414+## Why the Terminal?
1515+1616+Terminal applications offer several advantages for focused productivity work:
1717+1818+**Keyboard-First Interface**: Navigate and manage information without context-switching to a mouse. Every action is a keystroke away, making workflows faster once learned.
1919+2020+**Scriptability**: Command-line tools integrate seamlessly with shell scripts, automation tools, and other CLI utilities. Noteleaf can be incorporated into your existing terminal-based workflow.
2121+2222+**Distraction-Free**: Terminal UIs remove visual clutter and web-based distractions, keeping you focused on the task at hand.
2323+2424+**Performance**: Native applications built with Go start instantly and consume minimal resources compared to Electron-based alternatives.
2525+2626+**Data Ownership**: Your data lives in a local SQLite database and markdown files. No cloud dependencies, no vendor lock-in, no privacy concerns.
-99
website/docs/development/ARCHITECTURE.md
···11-# System Architecture
22-33-Noteleaf is a CLI/TUI application for task and content management built on Go with SQLite persistence and terminal-based interfaces.
44-55-## Core Architecture
66-77-### Application Structure
88-99-The application follows a layered architecture with clear separation between presentation, business logic, and data access layers.
1010-1111-**Entry Point** - `cmd/main.go` initializes the application with dependency injection, creates handlers, and configures the Cobra command tree using the CommandGroup pattern.
1212-1313-**CLI Framework** - Built on `spf13/cobra` with `charmbracelet/fang` providing enhanced CLI features including color schemes, versioning, and improved help formatting.
1414-1515-**TUI Components** - Interactive interfaces use `charmbracelet/bubbletea` for state management and `charmbracelet/lipgloss` for styling with a consistent color palette system in `internal/ui/colors.go`.
1616-1717-### Data Layer
1818-1919-**Database** - SQLite with schema migrations in `internal/store/sql/migrations/`. The `internal/store` package manages database connections and configuration.
2020-2121-**Repository Pattern** - Data access abstracts through repository interfaces in `internal/repo/` with validation logic ensuring data integrity at the persistence boundary.
2222-2323-**Models** - Entity definitions in `internal/models/` implement standardized Model interfaces with common fields (ID, Created, Modified).
2424-2525-### Business Logic
2626-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.
2929-3030-**Services** - Domain-specific operations in `internal/services/` handle complex business workflows and external integrations.
3131-3232-**Validation** - Schema-based validation at repository level with custom ValidationError types providing detailed field-level error messages.
3333-3434-## Domain Features
3535-3636-### Content Management
3737-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).
4040-4141-**Tasks** - Todo/task management inspired by TaskWarrior with filtering, status tracking, and interactive TUI views.
4242-4343-**Notes** - Simple note management with markdown support and glamour-based terminal rendering.
4444-4545-**Media Queues** - Separate queues for books, movies, and TV shows with status tracking and metadata management.
4646-4747-### User Interface
4848-4949-**Command Groups** - Commands organized into core functionality (task, note, article, media) and management operations (setup, config, status) using the CommandGroup interface pattern.
5050-5151-**Interactive Views** - Bubbletea-based TUI components for list navigation, item selection, and data entry with consistent styling through the lipgloss color system.
5252-5353-**Terminal Output** - Markdown rendering through `charmbracelet/glamour` for rich text display in terminal environments.
5454-5555-## Dependencies
5656-5757-**CLI/TUI** - Cobra command framework, Bubbletea state management, Lipgloss styling, Fang CLI enhancements.
5858-5959-**Data** - SQLite driver (`mattn/go-sqlite3`), TOML configuration parsing.
6060-6161-**Content Processing** - Colly web scraping, HTML/XML query libraries, Glamour markdown rendering, text processing utilities.
6262-6363-**Utilities** - UUID generation, time handling, logging through `charmbracelet/log`.
6464-6565-## Design Decisions and Tradeoffs
6666-6767-### Technology Choices
6868-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.
7171-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.
7575-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.
7878-7979-### Architectural Tradeoffs
8080-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.
8383-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.
8686-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.
8989-9090-### Component Interactions
9191-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.
9494-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.
9797-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.
-292
website/docs/development/TESTING.md
···11-# Testing Documentation
22-33-This document outlines the testing patterns and practices used in the `noteleaf` application.
44-55-## Overview
66-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.
1010-1111-### Organization
1212-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:
1515-1616-- `internal/services/test_utilities.go` - HTTP mocking and media service testing
1717-- `internal/repo/test_utilities.go` - Database testing and data generation
1818-- `internal/ui/test_utilities.go` - TUI testing framework and interactive component testing
1919-- `internal/handlers/test_utilities.go` - Handler testing with database isolation and input simulation
2020-2121-## Patterns
2222-2323-### Handler Creation
2424-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.
2727-2828-### Database Isolation
2929-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.
3232-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.
3535-3636-### Resource Management
3737-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.
4141-4242-### Error Handling
4343-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.
4646-4747-### Context Cancellation
4848-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.
5252-5353-### Command Structure
5454-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.
5757-5858-### Interface Compliance
5959-6060-Tests verify interface compliance using compile-time checks with blank identifier assignments.
6161-This ensures structs implement expected interfaces without runtime overhead.
6262-6363-## Test Infrastructure
6464-6565-### Test Utility Frameworks
6666-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.
6969-7070-#### Database Testing Utilities
7171-7272-`internal/repo/test_utilities.go` provides comprehensive database testing infrastructure:
7373-7474-- **In-Memory Database Creation**: `CreateTestDB` creates isolated SQLite databases with full schema
7575-- **Sample Data Factories**: Functions like `CreateSampleTask`, `CreateSampleBook` generate realistic test data
7676-- **Faker Integration**: Uses jaswdr/faker for generating realistic fake data with `CreateFakeArticle`
7777-- **Test Setup Helpers**: `SetupTestData` creates a full set of sample data across all models
7878-- **Custom Assertions**: Generic assertion helpers like `AssertEqual`, `AssertContains`, `AssertNoError`
7979-8080-#### HTTP Service Testing
8181-8282-`internal/services/test_utilities.go` provides HTTP mocking and media service testing:
8383-8484-- **Mock Configuration**: `MockConfig` structure for configuring service behavior
8585-- **Function Replacement**: `SetupMediaMocks` replaces service functions with controllable mocks
8686-- **Sample Data Access**: Helper functions that use embedded HTML samples for realistic testing
8787-- **Specialized Scenarios**: Pre-configured mock setups for success and failure scenarios
8888-- **Assertion Helpers**: Domain-specific assertions for movies, TV shows, and error conditions
8989-9090-#### TUI Testing Framework
9191-9292-`internal/ui/test_utilities.go` provides a comprehensive BubbleTea testing framework:
9393-9494-- **TUITestSuite**: Complete testing infrastructure for interactive TUI components
9595-- **Controlled I/O**: `ControlledOutput` and `ControlledInput` for deterministic testing
9696-- **Message Simulation**: Key press simulation, message queuing, and timing control
9797-- **State Verification**: Model state checking and view content assertions
9898-- **Timeout Handling**: Configurable timeouts for async operations
9999-- **Mock Repository**: Test doubles for repository interfaces
100100-101101-#### Handler Testing Infrastructure
102102-103103-`internal/handlers/test_utilities.go` provides end-to-end handler testing:
104104-105105-- **Environment Isolation**: `HandlerTestHelper` creates isolated test environments
106106-- **Input Simulation**: `InputSimulator` for testing interactive components that use `fmt.Scanf`
107107-- **HTTP Mocking**: Comprehensive HTTP server mocking for external API testing
108108-- **Database Helpers**: Database corruption and error scenario testing
109109-- **Editor Mocking**: `MockEditor` for testing file editing workflows
110110-- **Assertion Helpers**: Handler-specific assertions and verification functions
111111-112112-### Advanced Testing Patterns
113113-114114-#### Input Simulation for Interactive Components
115115-116116-Interactive handlers that use `fmt.Scanf` require special testing infrastructure with an `io.Reader` implementation.
117117-118118-The `InputSimulator` provides controlled input sequences that prevent tests from hanging while maintaining coverage of interactive code paths.
119119-120120-#### TUI Testing with BubbleTea Framework
121121-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.
124124-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.
128128-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.
132132-This is inspired by front-end/TS/JS testing patterns.
133133-134134-The framework's I/O abstraction layer replaces terminal input/output with controlled buffers that implement standard Go interfaces.
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.
137137-138138-Concurrency management uses channels and context propagation to coordinate between the testing framework and the model under test.
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.
141141-142142-#### HTTP Service Mocking
143143-144144-Service testing uses HTTP mocking with request capture. A `MockServer` is instantiated, and its URL is used in test scoped services.
145145-146146-#### Database Schema Testing
147147-148148-Database tests use comprehensive schema setup with (automatic) cleanup
149149-150150-#### Environment Manipulation
151151-152152-Environment testing utilities provide controlled environment manipulation. Environment variables are restored after instantiation.
153153-154154-## Test Organization Patterns
155155-156156-### Single Root Test
157157-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.
161161-162162-### Integration vs Unit Testing
163163-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.
166166-167167-### Static Output
168168-169169-UI components support static output modes for testing. Tests capture output using bytes.Buffer and verify content using string contains checks rather than exact string matching for better test maintainability.
170170-171171-### Standard Output Redirection
172172-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.
176176-177177-## Utilities
178178-179179-### Test Data Generation
180180-181181-The codebase uses sophisticated data generation strategies:
182182-183183-- **Factory Functions**: Each package provides factory functions for creating valid test data
184184-- **Faker Integration**: Uses `jaswdr/faker` for generating realistic fake data with proper randomization
185185-- **Sample Data Creators**: Functions like `CreateSampleTask`, `CreateSampleBook` provide consistent test data
186186-- **Embedded Resources**: Services use embedded HTML samples from real API responses for realistic testing
187187-188188-### Assertion Helpers
189189-190190-Custom assertion functions provide clear error messages and reduce test code duplication:
191191-192192-- **Generic Assertions**: `AssertEqual`, `AssertNoError`, `AssertContains` for common checks
193193-- **Domain-Specific Assertions**: `AssertMovieInResults`, `AssertNoteExists` for specialized verification
194194-- **TUI Assertions**: `AssertViewContains`, `AssertModelState` for BubbleTea model testing
195195-- **HTTP Assertions**: `AssertRequestMade` for verifying HTTP interactions
196196-197197-### Mock Infrastructure
198198-199199-Each layer provides specialized mocking capabilities:
200200-201201-- **Service Mocking**: Function replacement with configurable behavior and embedded test data
202202-- **HTTP Mocking**: `HTTPMockServer` with request capture and response customization
203203-- **Input Mocking**: `InputSimulator` for deterministic interactive component testing
204204-- **Editor Mocking**: `MockEditor` for file editing workflow testing
205205-- **Repository Mocking**: `MockTaskRepository` for TUI component testing
206206-207207-### Environment and Resource Management
208208-209209-Testing utilities provide comprehensive resource management:
210210-211211-- **Environment Isolation**: `EnvironmentTestHelper` for controlled environment variable manipulation
212212-- **Database Isolation**: Temporary SQLite databases with automatic cleanup
213213-- **File System Isolation**: Temporary directories with automatic cleanup
214214-- **Process Isolation**: Handler helpers that create completely isolated test environments
215215-216216-## Testing CLI Commands
217217-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.
220220-221221-### CommandGroup Interface Testing
222222-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.
225225-226226-Interface compliance is tested using compile-time checks within the "Interface Implementations" subtest, ensuring all command structs properly implement the CommandGroup interface without runtime overhead.
227227-228228-## Performance Considerations
229229-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.
232232-233233-The single root test pattern allows for efficient resource management where setup costs can be amortized across multiple related test cases.
234234-235235-## Interactive Component Testing
236236-237237-The codebase provides comprehensive testing infrastructure for interactive components, including both terminal UI applications and command-line interfaces that require user input.
238238-239239-### Input Simulation Framework
240240-241241-Interactive handlers that use `fmt.Scanf` require specialized testing infrastructure:
242242-243243-- **InputSimulator**: Provides controlled input sequences that implement `io.Reader`
244244-- **Menu Selection Helpers**: `MenuSelection`, `MenuCancel`, `MenuSequence` for common interaction patterns
245245-- **Handler Integration**: Handlers can accept `io.Reader` for input, enabling deterministic testing
246246-- **Cleanup Management**: Automatic cleanup prevents resource leaks in test environments
247247-248248-### TUI Testing with BubbleTea
249249-250250-The TUI testing framework provides complete testing infrastructure for interactive terminal interfaces:
251251-252252-- **TUITestSuite**: Comprehensive testing framework for BubbleTea models
253253-- **Message Simulation**: Key press simulation, window resize events, and custom message handling
254254-- **State Verification**: Model state checking with custom condition functions
255255-- **View Assertions**: Content verification and output capture
256256-- **Timing Control**: Configurable timeouts and delay handling for async operations
257257-- **Mock Integration**: Repository mocking for isolated component testing
258258-259259-### Interactive Test Scenarios
260260-261261-Interactive handlers should test comprehensive scenarios:
262262-263263-- **Valid user selections** - User chooses valid menu options and inputs
264264-- **Cancellation flows** - User chooses to cancel operations (option 0 or escape keys)
265265-- **Invalid choices** - User selects out-of-range options or provides invalid input
266266-- **Navigation patterns** - Keyboard navigation, scrolling, and multi-step interactions
267267-- **Error handling** - Network errors, service failures, and data validation errors
268268-- **Empty states** - Search returns no results, empty lists, and missing data
269269-- **Edge cases** - Boundary conditions, malformed input, and resource constraints
270270-271271-### TUI Component Testing Patterns
272272-273273-BubbleTea components use specialized testing patterns:
274274-275275-- **Key Sequence Testing**: Simulate complex user interactions with timing
276276-- **State Transition Testing**: Verify model state changes through user actions
277277-- **View Content Testing**: Assert specific content appears in rendered output
278278-- **Async Operation Testing**: Handle loading states and network operations
279279-- **Responsive Design Testing**: Test different terminal sizes and window resize handling
280280-281281-This comprehensive testing approach ensures interactive components work reliably in automated environments while maintaining full coverage of user interaction paths.
282282-283283-## Errors
284284-285285-Error coverage follows a systematic approach to identify and test failure scenarios:
286286-287287-1. **Context Cancellation** - Primary method for testing database and network timeout scenarios
288288-2. **Invalid Input** - Malformed data, empty inputs, boundary conditions
289289-3. **Resource Exhaustion** - Database connection failures, memory limits
290290-4. **Constraint Violations** - Duplicate keys, foreign key failures
291291-5. **State Validation** - Testing functions with invalid system states
292292-6. **Interactive Input** - Invalid user choices, cancellation handling, input simulation errors
···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-```
-47
website/docs/intro.md
···11----
22-sidebar_position: 1
33----
44-55-# Tutorial Intro
66-77-Let's discover **Docusaurus in less than 5 minutes**.
88-99-## Getting Started
1010-1111-Get started by **creating a new site**.
1212-1313-Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
1414-1515-### What you'll need
1616-1717-- [Node.js](https://nodejs.org/en/download/) version 20.0 or above:
1818- - When installing Node.js, you are recommended to check all checkboxes related to dependencies.
1919-2020-## Generate a new site
2121-2222-Generate a new Docusaurus site using the **classic template**.
2323-2424-The classic template will automatically be added to your project after you run the command:
2525-2626-```bash
2727-npm init docusaurus@latest my-website classic
2828-```
2929-3030-You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
3131-3232-The command also installs all necessary dependencies you need to run Docusaurus.
3333-3434-## Start your site
3535-3636-Run the development server:
3737-3838-```bash
3939-cd my-website
4040-npm run start
4141-```
4242-4343-The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
4444-4545-The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
4646-4747-Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
+9
website/docs/leaflet/_category_.json
···11+{
22+ "label": "Leaflet Publishing",
33+ "position": 5,
44+ "link": {
55+ "type": "generated-index",
66+ "title": "Leaflet Publishing",
77+ "description": "Publish and sync documents with leaflet.pub and the AT Protocol."
88+ }
99+}
+41
website/docs/leaflet/authentication.md
···11+---
22+title: Authentication and Identity
33+sidebar_label: Auth & Identity
44+description: AT Protocol authentication, security, and session handling.
55+sidebar_position: 8
66+---
77+88+# Authentication and Identity
99+1010+## AT Protocol Authentication
1111+1212+Noteleaf uses AT Protocol's authentication system:
1313+1414+1. **Handle Resolution**: Your handle (e.g., `username.bsky.social`) is resolved to a DID (Decentralized Identifier)
1515+2. **Session Creation**: Authenticate with your app password to create a session
1616+3. **Session Token**: Noteleaf stores the session token for future requests
1717+4. **Token Refresh**: Sessions are refreshed automatically when they expire
1818+1919+## Security Considerations
2020+2121+**Use app passwords**: Never use your main BlueSky password with third-party tools. App passwords can be revoked without affecting your account.
2222+2323+**Token storage**: Session tokens are stored locally in the Noteleaf database. Protect your database file.
2424+2525+**Revocation**: If compromised, revoke the app password at [bsky.app/settings/app-passwords](https://bsky.app/settings/app-passwords).
2626+2727+## Session Management
2828+2929+**Check status**:
3030+3131+```sh
3232+noteleaf pub status
3333+```
3434+3535+**Re-authenticate**:
3636+3737+```sh
3838+noteleaf pub auth
3939+```
4040+4141+Sessions typically last 2-4 hours before requiring refresh. Noteleaf handles refresh automatically, but if authentication fails, run `pub auth` again.
+85
website/docs/leaflet/examples.md
···11+---
22+title: Publishing Examples
33+sidebar_label: Examples
44+description: End-to-end examples for posting, drafting, and syncing.
55+sidebar_position: 6
66+---
77+88+# Publishing Examples
99+1010+## Publishing a Blog Post
1111+1212+**Write the post locally**:
1313+1414+```sh
1515+noteleaf note create "Understanding AT Protocol" --editor
1616+```
1717+1818+Write in markdown, save, and close editor.
1919+2020+**Preview the conversion**:
2121+2222+```sh
2323+noteleaf pub post <note-id> --preview
2424+```
2525+2626+Review the output to ensure formatting is correct.
2727+2828+**Publish**:
2929+3030+```sh
3131+noteleaf pub post <note-id>
3232+```
3333+3434+**Update later**:
3535+3636+```sh
3737+noteleaf note edit <note-id>
3838+# Make changes
3939+noteleaf pub patch <note-id>
4040+```
4141+4242+## Draft Workflow
4343+4444+**Create draft**:
4545+4646+```sh
4747+noteleaf note create "Work in Progress" --editor
4848+noteleaf pub post <note-id> --draft
4949+```
5050+5151+**Iterate locally**:
5252+5353+```sh
5454+noteleaf note edit <note-id>
5555+noteleaf pub patch <note-id> # Updates draft
5656+```
5757+5858+**Publish when ready**: Use leaflet.pub web interface to change draft to published status (CLI command coming in future versions).
5959+6060+## Syncing Existing Content
6161+6262+**Pull all leaflet documents**:
6363+6464+```sh
6565+noteleaf pub pull
6666+```
6767+6868+**List synced documents**:
6969+7070+```sh
7171+noteleaf pub list
7272+```
7373+7474+**Read a synced document**:
7575+7676+```sh
7777+noteleaf pub read <note-id>
7878+```
7979+8080+**Edit locally and push updates**:
8181+8282+```sh
8383+noteleaf note edit <note-id>
8484+noteleaf pub patch <note-id>
8585+```
+26
website/docs/leaflet/future.md
···11+---
22+title: Leaflet Future Features
33+sidebar_label: Future
44+description: Upcoming enhancements planned for the leaflet integration.
55+sidebar_position: 10
66+---
77+88+# Leaflet Future Features
99+1010+Planned improvements to leaflet.pub integration:
1111+1212+**Multiple Publications**: Create and manage separate publications for different topics
1313+1414+**Image Upload**: Automatically upload images to blob storage and embed in documents
1515+1616+**Status Management**: Publish drafts and unpublish documents from CLI
1717+1818+**Metadata Editing**: Update document titles, summaries, and tags
1919+2020+**Backlink Support**: Parse and resolve cross-references between documents
2121+2222+**Collaborative Editing**: Pull and merge changes from multiple devices
2323+2424+**Offline Mode**: Queue posts and patches for later upload
2525+2626+For the latest roadmap, check the [GitHub repository](https://github.com/stormlightlabs/noteleaf).
+53
website/docs/leaflet/getting-started.md
···11+---
22+title: Getting Started with Leaflet
33+sidebar_label: Getting Started
44+description: Prerequisites, app passwords, and authentication commands.
55+sidebar_position: 2
66+---
77+88+# Getting Started with Leaflet
99+1010+## Prerequisites
1111+1212+- Noteleaf installed and configured
1313+- A BlueSky & [Leaflet](https://leaflet.pub) account (create at [bsky.app](https://bsky.app))
1414+- App password for authentication
1515+1616+## Creating an App Password
1717+1818+For security, Noteleaf uses app passwords instead of your main BlueSky password:
1919+2020+1. Go to [bsky.app/settings/app-passwords](https://bsky.app/settings/app-passwords)
2121+2. Click "Add App Password"
2222+3. Name it "noteleaf" or similar
2323+4. Copy the generated password (you won't see it again)
2424+2525+### Authentication
2626+2727+Authenticate with your BlueSky handle and app password:
2828+2929+```sh
3030+noteleaf pub auth username.bsky.social
3131+```
3232+3333+You'll be prompted for the app password. Alternatively, provide it via flag:
3434+3535+```sh
3636+noteleaf pub auth username.bsky.social --password <app-password>
3737+```
3838+3939+**Re-authentication**: If your session expires, run `pub auth` again. Noteleaf remembers your last authenticated handle, so you can just run:
4040+4141+```sh
4242+noteleaf pub auth
4343+```
4444+4545+### Check Authentication Status
4646+4747+Verify you're authenticated:
4848+4949+```sh
5050+noteleaf pub status
5151+```
5252+5353+Shows your handle and session state.
+36
website/docs/leaflet/intro.md
···11+---
22+title: Leaflet.pub Introduction
33+sidebar_label: Introduction
44+description: Understand leaflet.pub and how Noteleaf integrates with it.
55+sidebar_position: 1
66+---
77+88+# Leaflet.pub Introduction
99+1010+## What is Leaflet.pub?
1111+1212+[Leaflet.pub](https://leaflet.pub) is a decentralized publishing platform built on the AT Protocol (the same protocol that powers BlueSky). It allows you to publish long-form content as structured documents while maintaining ownership and control of your data through decentralized identity.
1313+1414+## AT Protocol and Decentralized Publishing
1515+1616+AT Protocol provides:
1717+1818+**Portable Identity**: Your identity (DID) is separate from any single service. You own your content and can move it between providers.
1919+2020+**Verifiable Data**: All documents are content-addressed and cryptographically signed, ensuring authenticity and preventing tampering.
2121+2222+**Interoperability**: Content published to leaflet.pub can be discovered and consumed by any AT Protocol-compatible client.
2323+2424+**Decentralized Storage**: Data is stored in personal data repositories (PDSs) under your control, not locked in a proprietary platform.
2525+2626+## How Noteleaf Integrates with Leaflet
2727+2828+Noteleaf can act as a leaflet.pub client, allowing you to:
2929+3030+1. **Authenticate** with your BlueSky/AT Protocol identity
3131+2. **Pull** existing documents from leaflet.pub into local notes
3232+3. **Publish** local notes as new leaflet documents
3333+4. **Update** previously published documents with changes
3434+5. **Manage** drafts and published content from the command line
3535+3636+This integration lets you write locally in markdown, manage content alongside tasks and research notes, and publish to a decentralized platform when ready.
+57
website/docs/leaflet/listing.md
···11+---
22+title: Listing and Reading Publications
33+sidebar_label: Listing & Reading
44+description: Browse leaflet-backed notes and read content locally.
55+sidebar_position: 7
66+---
77+88+# Listing and Reading Publications
99+1010+## List Published Documents
1111+1212+**All leaflet-synced notes**:
1313+1414+```sh
1515+noteleaf pub list
1616+```
1717+1818+**Only published documents**:
1919+2020+```sh
2121+noteleaf pub list --published
2222+```
2323+2424+**Only drafts**:
2525+2626+```sh
2727+noteleaf pub list --draft
2828+```
2929+3030+**Interactive browser**:
3131+3232+```sh
3333+noteleaf pub list --interactive
3434+```
3535+3636+Navigate with arrow keys, press Enter to read, `q` to quit.
3737+3838+## Reading a Publication
3939+4040+**Read specific document**:
4141+4242+```sh
4343+noteleaf pub read 123
4444+```
4545+4646+The identifier can be:
4747+4848+- Note ID (e.g., `123`)
4949+- Leaflet record key (rkey, e.g., `3jxx...`)
5050+5151+**Read newest publication**:
5252+5353+```sh
5454+noteleaf pub read
5555+```
5656+5757+Omitting the identifier shows the most recently published document.
+16
website/docs/leaflet/publications.md
···11+---
22+title: Leaflet Publications
33+sidebar_label: Publications
44+description: How publications work and how Noteleaf interacts with them.
55+sidebar_position: 3
66+---
77+88+# Leaflet Publications
99+1010+## What is a Publication?
1111+1212+In leaflet.pub, a publication is a collection of documents. While Noteleaf doesn't support management commands, documents you create are associated with your default publication.
1313+1414+Future versions may support:
1515+1616+- Switching between publications
+95
website/docs/leaflet/rich-text.md
···11+---
22+title: Leaflet Rich Text and Blocks
33+sidebar_label: Rich Text
44+description: How markdown maps to leaflet blocks and formatting.
55+sidebar_position: 5
66+---
77+88+# Leaflet Rich Text and Blocks
99+1010+## Document Structure
1111+1212+Leaflet documents consist of blocksโdiscrete content units:
1313+1414+**Text Blocks**: Paragraphs of formatted text
1515+**Header Blocks**: Section titles (level 1-6)
1616+**Code Blocks**: Syntax-highlighted code with language annotation
1717+**Quote Blocks**: Blockquotes for citations
1818+**List Blocks**: Ordered or unordered lists
1919+**Rule Blocks**: Horizontal rules for visual separation
2020+2121+## Text Formatting
2222+2323+Text within blocks can have inline formatting called facets:
2424+2525+**Bold**: `**bold text**` โ Bold facet
2626+**Italic**: `*italic text*` โ Italic facet
2727+**Code**: `` `inline code` `` โ Code facet
2828+**Links**: `[text](url)` โ Link facet with URL
2929+**Strikethrough**: `~~struck~~` โ Strikethrough facet
3030+3131+Multiple formats can be combined:
3232+3333+```markdown
3434+**bold and *italic* text with [a link](https://example.com)**
3535+```
3636+3737+## Code Blocks
3838+3939+Code blocks preserve language information for syntax highlighting:
4040+4141+````markdown
4242+```python
4343+def hello():
4444+ print("Hello, leaflet!")
4545+```
4646+````
4747+4848+Converts to a code block with language="python".
4949+5050+Supported languages: Any language identifier is preserved, but rendering depends on leaflet.pub's syntax highlighter support.
5151+5252+## Blockquotes
5353+5454+Markdown blockquotes become quote blocks:
5555+5656+```markdown
5757+> This is a quote from another source.
5858+> It can span multiple lines.
5959+```
6060+6161+Nested blockquotes are flattened (leaflet doesn't support nesting).
6262+6363+## Lists
6464+6565+Both ordered and unordered lists are supported:
6666+6767+```markdown
6868+- Unordered item 1
6969+- Unordered item 2
7070+ - Nested item
7171+7272+1. Ordered item 1
7373+2. Ordered item 2
7474+ 1. Nested ordered item
7575+```
7676+7777+Nesting is preserved up to leaflet's limits.
7878+7979+## Horizontal Rules
8080+8181+Markdown horizontal rules become rule blocks:
8282+8383+```markdown
8484+---
8585+```
8686+8787+Use for section breaks.
8888+8989+## Images and Media
9090+9191+**Current status**: Image support is not yet implemented in the Noteleaf-to-leaflet converter.
9292+9393+**Future plans**: Images will be uploaded to blob storage and embedded in documents with image blocks.
9494+9595+**Workaround**: For now, images in markdown are either skipped or converted to links.
+147
website/docs/leaflet/workflow.md
···11+---
22+title: Publishing Workflow
33+sidebar_label: Workflow
44+description: Post, patch, drafts, pulling, and syncing documents.
55+sidebar_position: 4
66+---
77+88+# Publishing Workflow
99+1010+## Converting Notes to Leaflet Documents
1111+1212+Noteleaf converts markdown notes to leaflet's rich text block format:
1313+1414+**Supported Markdown Features**:
1515+1616+- Headers (`#`, `##`, `###`, etc.)
1717+- Paragraphs
1818+- Bold (`**bold**`)
1919+- Italic (`*italic*`)
2020+- Code (`inline code`)
2121+- Strikethrough (`~~text~~`)
2222+- Links (`[text](url)`)
2323+- Code blocks (` ```language ... ``` `)
2424+- Blockquotes (`> quote`)
2525+- Lists (ordered and unordered)
2626+- Horizontal rules (`---`)
2727+2828+**Conversion Process**:
2929+3030+1. Parse markdown into AST (abstract syntax tree)
3131+2. Convert AST nodes to leaflet block records
3232+3. Process text formatting into facets
3333+4. Validate document structure
3434+5. Upload to leaflet.pub via AT Protocol
3535+3636+## Creating a New Document
3737+3838+Publish a local note as a new leaflet document:
3939+4040+```sh
4141+noteleaf pub post 123
4242+```
4343+4444+This:
4545+4646+1. Converts the note to leaflet format
4747+2. Creates a new document on leaflet.pub
4848+3. Links the note to the document (stores the rkey)
4949+4. Marks the note as published
5050+5151+**Create as draft**:
5252+5353+```sh
5454+noteleaf pub post 123 --draft
5555+```
5656+5757+Drafts are saved to leaflet but not publicly visible until you publish them.
5858+5959+**Preview before posting**:
6060+6161+```sh
6262+noteleaf pub post 123 --preview
6363+```
6464+6565+Shows what the document will look like without actually posting.
6666+6767+**Validate conversion**:
6868+6969+```sh
7070+noteleaf pub post 123 --validate
7171+```
7272+7373+Checks if the markdown converts correctly to leaflet format without posting.
7474+7575+**Save to file**:
7676+7777+```sh
7878+noteleaf pub post 123 --preview --output document.json
7979+noteleaf pub post 123 --preview --output document.txt --plaintext
8080+```
8181+8282+## Updating Published Documents
8383+8484+Update an existing leaflet document from a local note:
8585+8686+```sh
8787+noteleaf pub patch 123
8888+```
8989+9090+Requirements:
9191+9292+- Note must have been previously posted or pulled from leaflet
9393+- Note must have a leaflet record key (rkey) in the database
9494+9595+**Preserve draft/published status**: The `patch` command maintains the document's current status. If it's published, it stays published. If it's a draft, it stays a draft.
9696+9797+**Preview changes**:
9898+9999+```sh
100100+noteleaf pub patch 123 --preview
101101+```
102102+103103+**Validate before patching**:
104104+105105+```sh
106106+noteleaf pub patch 123 --validate
107107+```
108108+109109+## Managing Drafts
110110+111111+**Create as draft**:
112112+113113+```sh
114114+noteleaf pub post 123 --draft
115115+```
116116+117117+**Update draft**:
118118+119119+```sh
120120+noteleaf pub patch 123
121121+```
122122+123123+**List drafts**:
124124+125125+```sh
126126+noteleaf pub list --draft
127127+```
128128+129129+**Publish a draft**: Edit the draft on leaflet.pub or use the API to change status (command support coming in future versions).
130130+131131+## Pulling Documents from Leaflet
132132+133133+Sync leaflet documents to local notes:
134134+135135+```sh
136136+noteleaf pub pull
137137+```
138138+139139+This:
140140+141141+1. Authenticates with leaflet.pub
142142+2. Fetches all documents in your repository
143143+3. Creates new notes for documents not yet synced
144144+4. Updates existing notes that have changed
145145+146146+**Matching logic**: Notes are matched to leaflet documents by their record key (rkey) stored in the database.
147147+If a document doesn't have a corresponding note, a new one is created. If it does, the note is updated only if the content has changed (using CID for change detection).
···11----
22-id: articles
33-title: Articles
44-sidebar_position: 3
55-description: Save and archive web articles
66----
77-88-## article
99-1010-Save and archive web articles locally.
1111-1212-Parse articles from supported websites, extract clean content, and save as
1313-both markdown and HTML. Maintains a searchable archive of articles with
1414-metadata including author, title, and publication date.
1515-1616-```bash
1717-noteleaf article
1818-```
1919-2020-### Subcommands
2121-2222-#### add
2323-2424-Parse and save article content from a supported website.
2525-2626-The article will be parsed using domain-specific XPath rules and saved
2727-as both Markdown and HTML files. Article metadata is stored in the database.
2828-2929-**Usage:**
3030-3131-```bash
3232-noteleaf article add <url>
3333-```
3434-3535-#### list
3636-3737-List saved articles with optional filtering.
3838-3939-Use query to filter by title, or use flags for more specific filtering.
4040-4141-**Usage:**
4242-4343-```bash
4444-noteleaf article list [query] [flags]
4545-```
4646-4747-**Options:**
4848-4949-```
5050- --author string Filter by author
5151- -l, --limit int Limit number of results (0 = no limit)
5252-```
5353-5454-**Aliases:** ls
5555-5656-#### view
5757-5858-Display article metadata and summary.
5959-6060-Shows article title, author, publication date, URL, and a brief content
6161-preview. Use 'read' command to view the full article content.
6262-6363-**Usage:**
6464-6565-```bash
6666-noteleaf article view <id>
6767-```
6868-6969-**Aliases:** show
7070-7171-#### read
7272-7373-Read the full markdown content of an article with beautiful formatting.
7474-7575-This displays the complete article content using syntax highlighting and proper formatting.
7676-7777-**Usage:**
7878-7979-```bash
8080-noteleaf article read <id>
8181-```
8282-8383-#### remove
8484-8585-Delete an article and its files permanently.
8686-8787-Removes the article metadata from the database and deletes associated markdown
8888-and HTML files. This operation cannot be undone.
8989-9090-**Usage:**
9191-9292-```bash
9393-noteleaf article remove <id>
9494-```
9595-9696-**Aliases:** rm, delete
9797-
-115
website/docs/manual/books.md
···11----
22-id: books
33-title: Books
44-sidebar_position: 4
55-description: Manage reading list and track progress
66----
77-88-## book
99-1010-Track books and reading progress.
1111-1212-Search Google Books API to add books to your reading list. Track which books
1313-you're reading, update progress percentages, and maintain a history of finished
1414-books.
1515-1616-```bash
1717-noteleaf media book
1818-```
1919-2020-### Subcommands
2121-2222-#### add
2323-2424-Search for books and add them to your reading list.
2525-2626-By default, shows search results in a simple list format where you can select by number.
2727-Use the -i flag for an interactive interface with navigation keys.
2828-2929-**Usage:**
3030-3131-```bash
3232-noteleaf media book add [search query...] [flags]
3333-```
3434-3535-**Options:**
3636-3737-```
3838- -i, --interactive Use interactive interface for book selection
3939-```
4040-4141-#### list
4242-4343-Display books in your reading list with progress indicators.
4444-4545-Shows book titles, authors, and reading progress percentages. Filter by --all,
4646---reading for books in progress, --finished for completed books, or --queued
4747-for books not yet started. Default shows queued books only.
4848-4949-**Usage:**
5050-5151-```bash
5252-noteleaf media book list [--all|--reading|--finished|--queued]
5353-```
5454-5555-#### reading
5656-5757-Mark a book as currently reading. Use this when you start a book from your queue.
5858-5959-**Usage:**
6060-6161-```bash
6262-noteleaf media book reading <id>
6363-```
6464-6565-#### finished
6666-6767-Mark a book as finished with current timestamp. Sets reading progress to 100%.
6868-6969-**Usage:**
7070-7171-```bash
7272-noteleaf media book finished <id>
7373-```
7474-7575-**Aliases:** read
7676-7777-#### remove
7878-7979-Remove a book from your reading list. Use this for books you no longer want to track.
8080-8181-**Usage:**
8282-8383-```bash
8484-noteleaf media book remove <id>
8585-```
8686-8787-**Aliases:** rm
8888-8989-#### progress
9090-9191-Set reading progress for a book.
9292-9393-Specify a percentage value between 0 and 100 to indicate how far you've
9494-progressed through the book. Automatically updates status to 'reading' if not
9595-already set.
9696-9797-**Usage:**
9898-9999-```bash
100100-noteleaf media book progress <id> <percentage>
101101-```
102102-103103-#### update
104104-105105-Change a book's status directly.
106106-107107-Valid statuses are: queued (not started), reading (in progress), finished
108108-(completed), or removed (no longer tracking).
109109-110110-**Usage:**
111111-112112-```bash
113113-noteleaf media book update <id> <status>
114114-```
115115-
-78
website/docs/manual/configuration.md
···11----
22-id: configuration
33-title: Configuration
44-sidebar_position: 7
55-description: Manage application configuration
66----
77-88-## config
99-1010-Manage noteleaf configuration
1111-1212-```bash
1313-noteleaf config
1414-```
1515-1616-### Subcommands
1717-1818-#### get
1919-2020-Display configuration values.
2121-2222-If no key is provided, displays all configuration values.
2323-Otherwise, displays the value for the specified key.
2424-2525-**Usage:**
2626-2727-```bash
2828-noteleaf config get [key]
2929-```
3030-3131-#### set
3232-3333-Update a configuration value.
3434-3535-Available keys:
3636- database_path - Custom database file path
3737- data_dir - Custom data directory
3838- date_format - Date format string (default: 2006-01-02)
3939- color_scheme - Color scheme (default: default)
4040- default_view - Default view mode (default: list)
4141- default_priority - Default task priority
4242- editor - Preferred text editor
4343- articles_dir - Articles storage directory
4444- notes_dir - Notes storage directory
4545- auto_archive - Auto-archive completed items (true/false)
4646- sync_enabled - Enable synchronization (true/false)
4747- sync_endpoint - Synchronization endpoint URL
4848- sync_token - Synchronization token
4949- export_format - Default export format (default: json)
5050- movie_api_key - API key for movie database
5151- book_api_key - API key for book database
5252-5353-**Usage:**
5454-5555-```bash
5656-noteleaf config set <key> <value>
5757-```
5858-5959-#### path
6060-6161-Display the path to the configuration file being used.
6262-6363-**Usage:**
6464-6565-```bash
6666-noteleaf config path
6767-```
6868-6969-#### reset
7070-7171-Reset all configuration values to their defaults.
7272-7373-**Usage:**
7474-7575-```bash
7676-noteleaf config reset
7777-```
7878-
-37
website/docs/manual/index.md
···11----
22-id: index
33-title: CLI Reference
44-sidebar_label: Overview
55-sidebar_position: 0
66-description: Complete command-line reference for noteleaf
77----
88-99-# noteleaf CLI Reference
1010-1111-noteleaf - personal information manager for the command line
1212-1313-A comprehensive CLI tool for managing tasks, notes, articles, and media queues.
1414-Inspired by TaskWarrior, noteleaf combines todo management with reading lists,
1515-watch queues, and a personal knowledge base.
1616-1717-Core features include hierarchical tasks with dependencies, recurring tasks,
1818-time tracking, markdown notes with tags, article archiving, and media queue
1919-management for books, movies, and TV shows.
2020-2121-## Usage
2222-2323-```bash
2424-noteleaf
2525-```
2626-2727-## Command Groups
2828-2929-- **[Task Management](tasks)** - Manage todos, projects, and time tracking
3030-- **[Notes](notes)** - Create and organize markdown notes
3131-- **[Articles](articles)** - Save and archive web articles
3232-- **[Books](books)** - Track reading list and progress
3333-- **[Movies](movies)** - Manage movie watch queue
3434-- **[TV Shows](tv-shows)** - Track TV show watching
3535-- **[Configuration](configuration)** - Manage settings
3636-- **[Management](management)** - Application management
3737-
-61
website/docs/manual/management.md
···11----
22-id: management
33-title: Management
44-sidebar_position: 8
55-description: Application management commands
66----
77-88-## status
99-1010-Display comprehensive application status information.
1111-1212-Shows database location, configuration file path, data directories, and current
1313-settings. Use this command to verify your noteleaf installation and diagnose
1414-configuration issues.
1515-1616-```bash
1717-noteleaf status
1818-```
1919-2020-## setup
2121-2222-Initialize noteleaf for first use.
2323-2424-Creates the database, configuration file, and required data directories. Run
2525-this command after installing noteleaf or when setting up a new environment.
2626-Safe to run multiple times as it will skip existing resources.
2727-2828-```bash
2929-noteleaf setup
3030-```
3131-3232-### Subcommands
3333-3434-#### seed
3535-3636-Add sample tasks, books, and notes to the database for testing and demonstration purposes
3737-3838-**Usage:**
3939-4040-```bash
4141-noteleaf setup seed [flags]
4242-```
4343-4444-**Options:**
4545-4646-```
4747- -f, --force Clear existing data and re-seed
4848-```
4949-5050-## reset
5151-5252-Remove all application data and return to initial state.
5353-5454-This command deletes the database, all media files, notes, and articles. The
5555-configuration file is preserved. Use with caution as this operation cannot be
5656-undone. You will be prompted for confirmation before deletion proceeds.
5757-5858-```bash
5959-noteleaf reset
6060-```
6161-
-77
website/docs/manual/movies.md
···11----
22-id: movies
33-title: Movies
44-sidebar_position: 5
55-description: Track movies in watch queue
66----
77-88-## movie
99-1010-Track movies you want to watch.
1111-1212-Search TMDB for movies and add them to your queue. Mark movies as watched when
1313-completed. Maintains a history of your movie watching activity.
1414-1515-```bash
1616-noteleaf media movie
1717-```
1818-1919-### Subcommands
2020-2121-#### add
2222-2323-Search for movies and add them to your watch queue.
2424-2525-By default, shows search results in a simple list format where you can select by number.
2626-Use the -i flag for an interactive interface with navigation keys.
2727-2828-**Usage:**
2929-3030-```bash
3131-noteleaf media movie add [search query...] [flags]
3232-```
3333-3434-**Options:**
3535-3636-```
3737- -i, --interactive Use interactive interface for movie selection
3838-```
3939-4040-#### list
4141-4242-Display movies in your queue with optional status filters.
4343-4444-Shows movie titles, release years, and current status. Filter by --all to show
4545-everything, --watched for completed movies, or --queued for unwatched items.
4646-Default shows queued movies only.
4747-4848-**Usage:**
4949-5050-```bash
5151-noteleaf media movie list [--all|--watched|--queued]
5252-```
5353-5454-#### watched
5555-5656-Mark a movie as watched with current timestamp. Moves the movie from queued to watched status.
5757-5858-**Usage:**
5959-6060-```bash
6161-noteleaf media movie watched [id]
6262-```
6363-6464-**Aliases:** seen
6565-6666-#### remove
6767-6868-Remove a movie from your watch queue. Use this for movies you no longer want to track.
6969-7070-**Usage:**
7171-7272-```bash
7373-noteleaf media movie remove [id]
7474-```
7575-7676-**Aliases:** rm
7777-
-114
website/docs/manual/notes.md
···11----
22-id: notes
33-title: Notes
44-sidebar_position: 2
55-description: Create and organize markdown notes
66----
77-88-## note
99-1010-Create and organize markdown notes with tags.
1111-1212-Write notes in markdown format, organize them with tags, browse them in an
1313-interactive TUI, and edit them in your preferred editor. Notes are stored as
1414-files on disk with metadata tracked in the database.
1515-1616-```bash
1717-noteleaf note
1818-```
1919-2020-### Subcommands
2121-2222-#### create
2323-2424-Create a new markdown note.
2525-2626-Provide a title and optional content inline, or use --interactive to open an
2727-editor. Use --file to import content from an existing markdown file. Notes
2828-support tags for organization and full-text search.
2929-3030-Examples:
3131- noteleaf note create "Meeting notes" "Discussed project timeline"
3232- noteleaf note create -i
3333- noteleaf note create --file ~/documents/draft.md
3434-3535-**Usage:**
3636-3737-```bash
3838-noteleaf note create [title] [content...] [flags]
3939-```
4040-4141-**Options:**
4242-4343-```
4444- -e, --editor Prompt to open note in editor after creation
4545- -f, --file string Create note from markdown file
4646- -i, --interactive Open interactive editor
4747-```
4848-4949-**Aliases:** new
5050-5151-#### list
5252-5353-Opens interactive TUI browser for navigating and viewing notes
5454-5555-**Usage:**
5656-5757-```bash
5858-noteleaf note list [--archived] [--static] [--tags=tag1,tag2] [flags]
5959-```
6060-6161-**Options:**
6262-6363-```
6464- -a, --archived Show archived notes
6565- -s, --static Show static list instead of interactive TUI
6666- --tags string Filter by tags (comma-separated)
6767-```
6868-6969-**Aliases:** ls
7070-7171-#### read
7272-7373-Display note content with formatted markdown rendering.
7474-7575-Shows the note with syntax highlighting, proper formatting, and metadata.
7676-Useful for quick viewing without opening an editor.
7777-7878-**Usage:**
7979-8080-```bash
8181-noteleaf note read [note-id]
8282-```
8383-8484-**Aliases:** view
8585-8686-#### edit
8787-8888-Open note in your configured text editor.
8989-9090-Uses the editor specified in your noteleaf configuration or the EDITOR
9191-environment variable. Changes are automatically saved when you close the
9292-editor.
9393-9494-**Usage:**
9595-9696-```bash
9797-noteleaf note edit [note-id]
9898-```
9999-100100-#### remove
101101-102102-Delete a note permanently.
103103-104104-Removes both the markdown file and database metadata. This operation cannot be
105105-undone. You will be prompted for confirmation before deletion.
106106-107107-**Usage:**
108108-109109-```bash
110110-noteleaf note remove [note-id]
111111-```
112112-113113-**Aliases:** rm, delete, del
114114-
-861
website/docs/manual/tasks.md
···11----
22-id: task-management
33-title: Task Management
44-sidebar_position: 1
55-description: Manage tasks with TaskWarrior-inspired features
66----
77-88-## todo
99-1010-Manage tasks with TaskWarrior-inspired features.
1111-1212-Track todos with priorities, projects, contexts, and tags. Supports hierarchical
1313-tasks with parent/child relationships, task dependencies, recurring tasks, and
1414-time tracking. Tasks can be filtered by status, priority, project, or context.
1515-1616-```bash
1717-noteleaf todo
1818-```
1919-2020-### Subcommands
2121-2222-#### add
2323-2424-Create a new task with description and optional attributes.
2525-2626-Tasks can be created with priority levels (low, medium, high, urgent), assigned
2727-to projects and contexts, tagged for organization, and configured with due dates
2828-and recurrence rules. Dependencies can be established to ensure tasks are
2929-completed in order.
3030-3131-Examples:
3232- noteleaf todo add "Write documentation" --priority high --project docs
3333- noteleaf todo add "Weekly review" --recur "FREQ=WEEKLY" --due 2024-01-15
3434-3535-**Usage:**
3636-3737-```bash
3838-noteleaf todo add [description] [flags]
3939-```
4040-4141-**Options:**
4242-4343-```
4444- -c, --context string Set task context
4545- --depends-on string Set task dependencies (comma-separated UUIDs)
4646- -d, --due string Set due date (YYYY-MM-DD)
4747- --parent string Set parent task UUID
4848- -p, --priority string Set task priority
4949- --project string Set task project
5050- --recur string Set recurrence rule (e.g., FREQ=DAILY)
5151- -t, --tags strings Add tags to task
5252- --until string Set recurrence end date (YYYY-MM-DD)
5353-```
5454-5555-**Aliases:** create, new
5656-5757-#### list
5858-5959-List tasks with optional filtering and display modes.
6060-6161-By default, shows tasks in an interactive TaskWarrior-like interface.
6262-Use --static to show a simple text list instead.
6363-Use --all to show all tasks, otherwise only pending tasks are shown.
6464-6565-**Usage:**
6666-6767-```bash
6868-noteleaf todo list [flags]
6969-```
7070-7171-**Options:**
7272-7373-```
7474- -a, --all Show all tasks (default: pending only)
7575- --context string Filter by context
7676- -i, --interactive Force interactive mode (default)
7777- --priority string Filter by priority
7878- --project string Filter by project
7979- --static Use static text output instead of interactive
8080- --status string Filter by status
8181-```
8282-8383-**Aliases:** ls
8484-8585-#### view
8686-8787-Display detailed information for a specific task.
8888-8989-Shows all task attributes including description, status, priority, project,
9090-context, tags, due date, creation time, and modification history. Use --json
9191-for machine-readable output or --no-metadata to show only the description.
9292-9393-**Usage:**
9494-9595-```bash
9696-noteleaf todo view [task-id] [flags]
9797-```
9898-9999-**Options:**
100100-101101-```
102102- --format string Output format (detailed, brief) (default "detailed")
103103- --json Output as JSON
104104- --no-metadata Hide creation/modification timestamps
105105-```
106106-107107-#### update
108108-109109-Modify attributes of an existing task.
110110-111111-Update any task property including description, status, priority, project,
112112-context, due date, recurrence rule, or parent task. Add or remove tags and
113113-dependencies. Multiple attributes can be updated in a single command.
114114-115115-Examples:
116116- noteleaf todo update 123 --priority urgent --due tomorrow
117117- noteleaf todo update 456 --add-tag urgent --project website
118118-119119-**Usage:**
120120-121121-```bash
122122-noteleaf todo update [task-id] [flags]
123123-```
124124-125125-**Options:**
126126-127127-```
128128- --add-depends string Add task dependencies (comma-separated UUIDs)
129129- --add-tag strings Add tags to task
130130- -c, --context string Set task context
131131- --description string Update task description
132132- -d, --due string Set due date (YYYY-MM-DD)
133133- --parent string Set parent task UUID
134134- -p, --priority string Set task priority
135135- --project string Set task project
136136- --recur string Set recurrence rule (e.g., FREQ=DAILY)
137137- --remove-depends string Remove task dependencies (comma-separated UUIDs)
138138- --remove-tag strings Remove tags from task
139139- --status string Update task status
140140- -t, --tags strings Add tags to task
141141- --until string Set recurrence end date (YYYY-MM-DD)
142142-```
143143-144144-#### edit
145145-146146-Open interactive editor for task modification.
147147-148148-Provides a user-friendly interface with status picker and priority toggle.
149149-Easier than using multiple command-line flags for complex updates.
150150-151151-**Usage:**
152152-153153-```bash
154154-noteleaf todo edit [task-id]
155155-```
156156-157157-**Aliases:** e
158158-159159-#### delete
160160-161161-Permanently remove a task from the database.
162162-163163-This operation cannot be undone. Consider updating the task status to
164164-'deleted' instead if you want to preserve the record for historical purposes.
165165-166166-**Usage:**
167167-168168-```bash
169169-noteleaf todo delete [task-id]
170170-```
171171-172172-#### projects
173173-174174-Display all projects with task counts.
175175-176176-Shows each project used in your tasks along with the number of tasks in each
177177-project. Use --todo-txt to format output with +project syntax for compatibility
178178-with todo.txt tools.
179179-180180-**Usage:**
181181-182182-```bash
183183-noteleaf todo projects [flags]
184184-```
185185-186186-**Options:**
187187-188188-```
189189- --static Use static text output instead of interactive
190190- --todo-txt Format output with +project prefix for todo.txt compatibility
191191-```
192192-193193-**Aliases:** proj
194194-195195-#### tags
196196-197197-Display all tags used across tasks.
198198-199199-Shows each tag with the number of tasks using it. Tags provide flexible
200200-categorization orthogonal to projects and contexts.
201201-202202-**Usage:**
203203-204204-```bash
205205-noteleaf todo tags [flags]
206206-```
207207-208208-**Options:**
209209-210210-```
211211- --static Use static text output instead of interactive
212212-```
213213-214214-**Aliases:** t
215215-216216-#### contexts
217217-218218-Display all contexts with task counts.
219219-220220-Contexts represent locations or environments where tasks can be completed (e.g.,
221221-@home, @office, @errands). Use --todo-txt to format output with @context syntax
222222-for compatibility with todo.txt tools.
223223-224224-**Usage:**
225225-226226-```bash
227227-noteleaf todo contexts [flags]
228228-```
229229-230230-**Options:**
231231-232232-```
233233- --static Use static text output instead of interactive
234234- --todo-txt Format output with @context prefix for todo.txt compatibility
235235-```
236236-237237-**Aliases:** con, loc, ctx, locations
238238-239239-#### done
240240-241241-Mark a task as completed with current timestamp.
242242-243243-Sets the task status to 'completed' and records the completion time. For
244244-recurring tasks, generates the next instance based on the recurrence rule.
245245-246246-**Usage:**
247247-248248-```bash
249249-noteleaf todo done [task-id]
250250-```
251251-252252-**Aliases:** complete
253253-254254-#### start
255255-256256-Begin tracking time spent on a task.
257257-258258-Records the start time for a work session. Only one task can be actively
259259-tracked at a time. Use --note to add a description of what you're working on.
260260-261261-**Usage:**
262262-263263-```bash
264264-noteleaf todo start [task-id] [flags]
265265-```
266266-267267-**Options:**
268268-269269-```
270270- -n, --note string Add a note to the time entry
271271-```
272272-273273-#### stop
274274-275275-End time tracking for the active task.
276276-277277-Records the end time and calculates duration for the current work session.
278278-Duration is added to the task's total time tracked.
279279-280280-**Usage:**
281281-282282-```bash
283283-noteleaf todo stop [task-id]
284284-```
285285-286286-#### timesheet
287287-288288-Show time tracking summary for tasks.
289289-290290-By default shows time entries for the last 7 days.
291291-Use --task to show timesheet for a specific task.
292292-Use --days to change the date range.
293293-294294-**Usage:**
295295-296296-```bash
297297-noteleaf todo timesheet [flags]
298298-```
299299-300300-**Options:**
301301-302302-```
303303- -d, --days int Number of days to show in timesheet (default 7)
304304- -t, --task string Show timesheet for specific task ID
305305-```
306306-307307-#### recur
308308-309309-Configure recurring task patterns.
310310-311311-Create tasks that repeat on a schedule using iCalendar recurrence rules (RRULE).
312312-Supports daily, weekly, monthly, and yearly patterns with optional end dates.
313313-314314-**Usage:**
315315-316316-```bash
317317-noteleaf todo recur
318318-```
319319-320320-**Aliases:** repeat
321321-322322-##### set
323323-324324-Apply a recurrence rule to create repeating task instances.
325325-326326-Uses iCalendar RRULE syntax (e.g., "FREQ=DAILY" for daily tasks, "FREQ=WEEKLY;BYDAY=MO,WE,FR"
327327-for specific weekdays). When a recurring task is completed, the next instance is
328328-automatically generated.
329329-330330-Examples:
331331- noteleaf todo recur set 123 --rule "FREQ=DAILY"
332332- noteleaf todo recur set 456 --rule "FREQ=WEEKLY;BYDAY=MO" --until 2024-12-31
333333-334334-**Usage:**
335335-336336-```bash
337337-noteleaf todo recur set [task-id] [flags]
338338-```
339339-340340-**Options:**
341341-342342-```
343343- --rule string Recurrence rule (e.g., FREQ=DAILY)
344344- --until string Recurrence end date (YYYY-MM-DD)
345345-```
346346-347347-##### clear
348348-349349-Remove recurrence from a task.
350350-351351-Converts a recurring task to a one-time task. Existing future instances are not
352352-affected.
353353-354354-**Usage:**
355355-356356-```bash
357357-noteleaf todo recur clear [task-id]
358358-```
359359-360360-##### show
361361-362362-Display recurrence rule and schedule information.
363363-364364-Shows the RRULE pattern, next occurrence date, and recurrence end date if
365365-configured.
366366-367367-**Usage:**
368368-369369-```bash
370370-noteleaf todo recur show [task-id]
371371-```
372372-373373-#### depend
374374-375375-Create and manage task dependencies.
376376-377377-Establish relationships where one task must be completed before another can
378378-begin. Useful for multi-step workflows and project management.
379379-380380-**Usage:**
381381-382382-```bash
383383-noteleaf todo depend
384384-```
385385-386386-**Aliases:** dep, deps
387387-388388-##### add
389389-390390-Make a task dependent on another task's completion.
391391-392392-The first task cannot be started until the second task is completed. Use task
393393-UUIDs to specify dependencies.
394394-395395-**Usage:**
396396-397397-```bash
398398-noteleaf todo depend add [task-id] [depends-on-uuid]
399399-```
400400-401401-##### remove
402402-403403-Delete a dependency relationship between two tasks.
404404-405405-**Usage:**
406406-407407-```bash
408408-noteleaf todo depend remove [task-id] [depends-on-uuid]
409409-```
410410-411411-**Aliases:** rm
412412-413413-##### list
414414-415415-Show all tasks that must be completed before this task can be started.
416416-417417-**Usage:**
418418-419419-```bash
420420-noteleaf todo depend list [task-id]
421421-```
422422-423423-**Aliases:** ls
424424-425425-##### blocked-by
426426-427427-Display all tasks that depend on this task's completion.
428428-429429-**Usage:**
430430-431431-```bash
432432-noteleaf todo depend blocked-by [task-id]
433433-```
434434-435435-## todo
436436-437437-Manage tasks with TaskWarrior-inspired features.
438438-439439-Track todos with priorities, projects, contexts, and tags. Supports hierarchical
440440-tasks with parent/child relationships, task dependencies, recurring tasks, and
441441-time tracking. Tasks can be filtered by status, priority, project, or context.
442442-443443-```bash
444444-noteleaf todo
445445-```
446446-447447-### Subcommands
448448-449449-#### add
450450-451451-Create a new task with description and optional attributes.
452452-453453-Tasks can be created with priority levels (low, medium, high, urgent), assigned
454454-to projects and contexts, tagged for organization, and configured with due dates
455455-and recurrence rules. Dependencies can be established to ensure tasks are
456456-completed in order.
457457-458458-Examples:
459459- noteleaf todo add "Write documentation" --priority high --project docs
460460- noteleaf todo add "Weekly review" --recur "FREQ=WEEKLY" --due 2024-01-15
461461-462462-**Usage:**
463463-464464-```bash
465465-noteleaf todo add [description] [flags]
466466-```
467467-468468-**Options:**
469469-470470-```
471471- -c, --context string Set task context
472472- --depends-on string Set task dependencies (comma-separated UUIDs)
473473- -d, --due string Set due date (YYYY-MM-DD)
474474- --parent string Set parent task UUID
475475- -p, --priority string Set task priority
476476- --project string Set task project
477477- --recur string Set recurrence rule (e.g., FREQ=DAILY)
478478- -t, --tags strings Add tags to task
479479- --until string Set recurrence end date (YYYY-MM-DD)
480480-```
481481-482482-**Aliases:** create, new
483483-484484-#### list
485485-486486-List tasks with optional filtering and display modes.
487487-488488-By default, shows tasks in an interactive TaskWarrior-like interface.
489489-Use --static to show a simple text list instead.
490490-Use --all to show all tasks, otherwise only pending tasks are shown.
491491-492492-**Usage:**
493493-494494-```bash
495495-noteleaf todo list [flags]
496496-```
497497-498498-**Options:**
499499-500500-```
501501- -a, --all Show all tasks (default: pending only)
502502- --context string Filter by context
503503- -i, --interactive Force interactive mode (default)
504504- --priority string Filter by priority
505505- --project string Filter by project
506506- --static Use static text output instead of interactive
507507- --status string Filter by status
508508-```
509509-510510-**Aliases:** ls
511511-512512-#### view
513513-514514-Display detailed information for a specific task.
515515-516516-Shows all task attributes including description, status, priority, project,
517517-context, tags, due date, creation time, and modification history. Use --json
518518-for machine-readable output or --no-metadata to show only the description.
519519-520520-**Usage:**
521521-522522-```bash
523523-noteleaf todo view [task-id] [flags]
524524-```
525525-526526-**Options:**
527527-528528-```
529529- --format string Output format (detailed, brief) (default "detailed")
530530- --json Output as JSON
531531- --no-metadata Hide creation/modification timestamps
532532-```
533533-534534-#### update
535535-536536-Modify attributes of an existing task.
537537-538538-Update any task property including description, status, priority, project,
539539-context, due date, recurrence rule, or parent task. Add or remove tags and
540540-dependencies. Multiple attributes can be updated in a single command.
541541-542542-Examples:
543543- noteleaf todo update 123 --priority urgent --due tomorrow
544544- noteleaf todo update 456 --add-tag urgent --project website
545545-546546-**Usage:**
547547-548548-```bash
549549-noteleaf todo update [task-id] [flags]
550550-```
551551-552552-**Options:**
553553-554554-```
555555- --add-depends string Add task dependencies (comma-separated UUIDs)
556556- --add-tag strings Add tags to task
557557- -c, --context string Set task context
558558- --description string Update task description
559559- -d, --due string Set due date (YYYY-MM-DD)
560560- --parent string Set parent task UUID
561561- -p, --priority string Set task priority
562562- --project string Set task project
563563- --recur string Set recurrence rule (e.g., FREQ=DAILY)
564564- --remove-depends string Remove task dependencies (comma-separated UUIDs)
565565- --remove-tag strings Remove tags from task
566566- --status string Update task status
567567- -t, --tags strings Add tags to task
568568- --until string Set recurrence end date (YYYY-MM-DD)
569569-```
570570-571571-#### edit
572572-573573-Open interactive editor for task modification.
574574-575575-Provides a user-friendly interface with status picker and priority toggle.
576576-Easier than using multiple command-line flags for complex updates.
577577-578578-**Usage:**
579579-580580-```bash
581581-noteleaf todo edit [task-id]
582582-```
583583-584584-**Aliases:** e
585585-586586-#### delete
587587-588588-Permanently remove a task from the database.
589589-590590-This operation cannot be undone. Consider updating the task status to
591591-'deleted' instead if you want to preserve the record for historical purposes.
592592-593593-**Usage:**
594594-595595-```bash
596596-noteleaf todo delete [task-id]
597597-```
598598-599599-#### projects
600600-601601-Display all projects with task counts.
602602-603603-Shows each project used in your tasks along with the number of tasks in each
604604-project. Use --todo-txt to format output with +project syntax for compatibility
605605-with todo.txt tools.
606606-607607-**Usage:**
608608-609609-```bash
610610-noteleaf todo projects [flags]
611611-```
612612-613613-**Options:**
614614-615615-```
616616- --static Use static text output instead of interactive
617617- --todo-txt Format output with +project prefix for todo.txt compatibility
618618-```
619619-620620-**Aliases:** proj
621621-622622-#### tags
623623-624624-Display all tags used across tasks.
625625-626626-Shows each tag with the number of tasks using it. Tags provide flexible
627627-categorization orthogonal to projects and contexts.
628628-629629-**Usage:**
630630-631631-```bash
632632-noteleaf todo tags [flags]
633633-```
634634-635635-**Options:**
636636-637637-```
638638- --static Use static text output instead of interactive
639639-```
640640-641641-**Aliases:** t
642642-643643-#### contexts
644644-645645-Display all contexts with task counts.
646646-647647-Contexts represent locations or environments where tasks can be completed (e.g.,
648648-@home, @office, @errands). Use --todo-txt to format output with @context syntax
649649-for compatibility with todo.txt tools.
650650-651651-**Usage:**
652652-653653-```bash
654654-noteleaf todo contexts [flags]
655655-```
656656-657657-**Options:**
658658-659659-```
660660- --static Use static text output instead of interactive
661661- --todo-txt Format output with @context prefix for todo.txt compatibility
662662-```
663663-664664-**Aliases:** con, loc, ctx, locations
665665-666666-#### done
667667-668668-Mark a task as completed with current timestamp.
669669-670670-Sets the task status to 'completed' and records the completion time. For
671671-recurring tasks, generates the next instance based on the recurrence rule.
672672-673673-**Usage:**
674674-675675-```bash
676676-noteleaf todo done [task-id]
677677-```
678678-679679-**Aliases:** complete
680680-681681-#### start
682682-683683-Begin tracking time spent on a task.
684684-685685-Records the start time for a work session. Only one task can be actively
686686-tracked at a time. Use --note to add a description of what you're working on.
687687-688688-**Usage:**
689689-690690-```bash
691691-noteleaf todo start [task-id] [flags]
692692-```
693693-694694-**Options:**
695695-696696-```
697697- -n, --note string Add a note to the time entry
698698-```
699699-700700-#### stop
701701-702702-End time tracking for the active task.
703703-704704-Records the end time and calculates duration for the current work session.
705705-Duration is added to the task's total time tracked.
706706-707707-**Usage:**
708708-709709-```bash
710710-noteleaf todo stop [task-id]
711711-```
712712-713713-#### timesheet
714714-715715-Show time tracking summary for tasks.
716716-717717-By default shows time entries for the last 7 days.
718718-Use --task to show timesheet for a specific task.
719719-Use --days to change the date range.
720720-721721-**Usage:**
722722-723723-```bash
724724-noteleaf todo timesheet [flags]
725725-```
726726-727727-**Options:**
728728-729729-```
730730- -d, --days int Number of days to show in timesheet (default 7)
731731- -t, --task string Show timesheet for specific task ID
732732-```
733733-734734-#### recur
735735-736736-Configure recurring task patterns.
737737-738738-Create tasks that repeat on a schedule using iCalendar recurrence rules (RRULE).
739739-Supports daily, weekly, monthly, and yearly patterns with optional end dates.
740740-741741-**Usage:**
742742-743743-```bash
744744-noteleaf todo recur
745745-```
746746-747747-**Aliases:** repeat
748748-749749-##### set
750750-751751-Apply a recurrence rule to create repeating task instances.
752752-753753-Uses iCalendar RRULE syntax (e.g., "FREQ=DAILY" for daily tasks, "FREQ=WEEKLY;BYDAY=MO,WE,FR"
754754-for specific weekdays). When a recurring task is completed, the next instance is
755755-automatically generated.
756756-757757-Examples:
758758- noteleaf todo recur set 123 --rule "FREQ=DAILY"
759759- noteleaf todo recur set 456 --rule "FREQ=WEEKLY;BYDAY=MO" --until 2024-12-31
760760-761761-**Usage:**
762762-763763-```bash
764764-noteleaf todo recur set [task-id] [flags]
765765-```
766766-767767-**Options:**
768768-769769-```
770770- --rule string Recurrence rule (e.g., FREQ=DAILY)
771771- --until string Recurrence end date (YYYY-MM-DD)
772772-```
773773-774774-##### clear
775775-776776-Remove recurrence from a task.
777777-778778-Converts a recurring task to a one-time task. Existing future instances are not
779779-affected.
780780-781781-**Usage:**
782782-783783-```bash
784784-noteleaf todo recur clear [task-id]
785785-```
786786-787787-##### show
788788-789789-Display recurrence rule and schedule information.
790790-791791-Shows the RRULE pattern, next occurrence date, and recurrence end date if
792792-configured.
793793-794794-**Usage:**
795795-796796-```bash
797797-noteleaf todo recur show [task-id]
798798-```
799799-800800-#### depend
801801-802802-Create and manage task dependencies.
803803-804804-Establish relationships where one task must be completed before another can
805805-begin. Useful for multi-step workflows and project management.
806806-807807-**Usage:**
808808-809809-```bash
810810-noteleaf todo depend
811811-```
812812-813813-**Aliases:** dep, deps
814814-815815-##### add
816816-817817-Make a task dependent on another task's completion.
818818-819819-The first task cannot be started until the second task is completed. Use task
820820-UUIDs to specify dependencies.
821821-822822-**Usage:**
823823-824824-```bash
825825-noteleaf todo depend add [task-id] [depends-on-uuid]
826826-```
827827-828828-##### remove
829829-830830-Delete a dependency relationship between two tasks.
831831-832832-**Usage:**
833833-834834-```bash
835835-noteleaf todo depend remove [task-id] [depends-on-uuid]
836836-```
837837-838838-**Aliases:** rm
839839-840840-##### list
841841-842842-Show all tasks that must be completed before this task can be started.
843843-844844-**Usage:**
845845-846846-```bash
847847-noteleaf todo depend list [task-id]
848848-```
849849-850850-**Aliases:** ls
851851-852852-##### blocked-by
853853-854854-Display all tasks that depend on this task's completion.
855855-856856-**Usage:**
857857-858858-```bash
859859-noteleaf todo depend blocked-by [task-id]
860860-```
861861-
-91
website/docs/manual/tv-shows.md
···11----
22-id: tv-shows
33-title: TV Shows
44-sidebar_position: 6
55-description: Manage TV show watching
66----
77-88-## tv
99-1010-Track TV shows and episodes.
1111-1212-Search TMDB for TV shows and add them to your queue. Track which shows you're
1313-currently watching, mark episodes as watched, and maintain a complete history
1414-of your viewing activity.
1515-1616-```bash
1717-noteleaf media tv
1818-```
1919-2020-### Subcommands
2121-2222-#### add
2323-2424-Search for TV shows and add them to your watch queue.
2525-2626-By default, shows search results in a simple list format where you can select by number.
2727-Use the -i flag for an interactive interface with navigation keys.
2828-2929-**Usage:**
3030-3131-```bash
3232-noteleaf media tv add [search query...] [flags]
3333-```
3434-3535-**Options:**
3636-3737-```
3838- -i, --interactive Use interactive interface for TV show selection
3939-```
4040-4141-#### list
4242-4343-Display TV shows in your queue with optional status filters.
4444-4545-Shows show titles, air dates, and current status. Filter by --all, --queued,
4646---watching for shows in progress, or --watched for completed series. Default
4747-shows queued shows only.
4848-4949-**Usage:**
5050-5151-```bash
5252-noteleaf media tv list [--all|--queued|--watching|--watched]
5353-```
5454-5555-#### watching
5656-5757-Mark a TV show as currently watching. Use this when you start watching a series.
5858-5959-**Usage:**
6060-6161-```bash
6262-noteleaf media tv watching [id]
6363-```
6464-6565-#### watched
6666-6767-Mark TV show episodes or entire series as watched.
6868-6969-Updates episode tracking and completion status. Can mark individual episodes
7070-or complete seasons/series depending on ID format.
7171-7272-**Usage:**
7373-7474-```bash
7575-noteleaf media tv watched [id]
7676-```
7777-7878-**Aliases:** seen
7979-8080-#### remove
8181-8282-Remove a TV show from your watch queue. Use this for shows you no longer want to track.
8383-8484-**Usage:**
8585-8686-```bash
8787-noteleaf media tv remove [id]
8888-```
8989-9090-**Aliases:** rm
9191-
+9
website/docs/media/_category_.json
···11+{
22+ "label": "Media",
33+ "position": 5,
44+ "link": {
55+ "type": "generated-index",
66+ "title": "Media Tracking",
77+ "description": "Track books, movies, and TV shows without leaving the terminal."
88+ }
99+}
+100
website/docs/media/books.md
···11+---
22+title: Books
33+sidebar_label: Books
44+description: Build and maintain your reading list with Open Library metadata.
55+sidebar_position: 2
66+---
77+88+# Books
99+1010+The book workflow revolves around Open Library search results. Each command lives under `noteleaf media book`.
1111+1212+## Add Books
1313+1414+Search Open Library and pick a result:
1515+1616+```sh
1717+noteleaf media book add "Project Hail Mary"
1818+```
1919+2020+Flags:
2121+2222+- `-i, --interactive`: open the TUI browser (currently shows your local listโuseful for triage).
2323+- Plain mode prints the top five matches inline and prompts for a numeric selection.
2424+2525+Behind the scenes Noteleaf records the title, authors, edition details, and any subjects returned by the API. New entries start in the `queued` status.
2626+2727+## Manage the Reading List
2828+2929+List and filter:
3030+3131+```sh
3232+# Everything
3333+noteleaf media book list --all
3434+3535+# Only active reads
3636+noteleaf media book list --reading
3737+3838+# Completed books
3939+noteleaf media book list --finished
4040+```
4141+4242+Each line shows the ID, title, author, status, progress percentage, and any captured metadata (publishers, edition counts, etc.).
4343+4444+Remove items you no longer care about:
4545+4646+```sh
4747+noteleaf media book remove 42
4848+```
4949+5050+## Track Progress
5151+5252+You can explicitly set the status:
5353+5454+```sh
5555+noteleaf media book reading 7
5656+noteleaf media book finished 7
5757+noteleaf media book update 7 queued
5858+```
5959+6060+But the fastest way is to update the percentage:
6161+6262+```sh
6363+noteleaf media book progress 7 45 # Moves status to reading and records start time
6464+noteleaf media book progress 7 100 # Marks finished and records completion time
6565+```
6666+6767+Logic applied automatically:
6868+6969+- `0%` โ resets to `queued` and clears the โstartedโ timestamp.
7070+- `1โ99%` โ flips to `reading` (start time captured).
7171+- `100%` โ marks `finished`, sets end time, and locks progress at 100%.
7272+7373+## Reading Lists and Search
7474+7575+Common workflows:
7676+7777+- **Focus view**: `noteleaf media book list --reading | fzf` to pick the next session book.
7878+- **Backlog grooming**: `noteleaf media book list --queued` to prune items before they go stale.
7979+- **Author sprint**: pipe the list to `rg` to filter by author (`noteleaf media book list --all | rg "Le Guin"`).
8080+8181+The TUI (`noteleaf media book add -i` or `noteleaf media book list` with the `--interactive` switch) supports `/` to search titles/authors/notes live and `v` for a detailed preview with timestamps.
8282+8383+## Metadata and Notes
8484+8585+Each record stores:
8686+8787+- Title & authors (comma separated when multiple).
8888+- Edition count, publishers, subject tags, or cover IDs exposed as inline notes.
8989+- Added/started/finished timestamps.
9090+- Optional page count (if Open Library exposes it).
9191+9292+Use those IDs anywhere else (tasks or notes). Example note snippet:
9393+9494+```markdown
9595+## Reading Log
9696+- 2024-02-01 โ Started book #7 ("Project Hail Mary")
9797+- 2024-02-05 โ Captured ideas in note #128 linked back to the book.
9898+```
9999+100100+Because media lives in the same database as tasks and notes, full-text search will surface those references instantly.
+75
website/docs/media/movies.md
···11+---
22+title: Movies
33+sidebar_label: Movies
44+description: Keep track of your movie queue with Rotten Tomatoes metadata.
55+sidebar_position: 3
66+---
77+88+# Movies
99+1010+Movie commands hang off `noteleaf media movie`. Results use Rotten Tomatoes search so you get consistent titles plus critic scores.
1111+1212+## Add Movies
1313+1414+```sh
1515+noteleaf media movie add "The Matrix"
1616+```
1717+1818+What happens:
1919+2020+1. The CLI fetches the first five Rotten Tomatoes matches.
2121+2. You select the right one by number.
2222+3. The chosen movie is inserted into the local queue with status `queued`.
2323+2424+The `-i/--interactive` flag is reserved for a future selector; currently the inline prompt is the quickest path.
2525+2626+## List and Filter
2727+2828+```sh
2929+# Default: queued items only
3030+noteleaf media movie list
3131+3232+# Include everything
3333+noteleaf media movie list --all
3434+3535+# Review history
3636+noteleaf media movie list --watched
3737+```
3838+3939+Each entry shows:
4040+4141+- `ID` and title.
4242+- Release year (if Rotten Tomatoes provided one).
4343+- Status (`queued` or `watched`).
4444+- Critic score snippet (stored inside the Notes column).
4545+- Watched timestamp for completed items.
4646+4747+## Mark Movies as Watched
4848+4949+```sh
5050+noteleaf media movie watched 12
5151+```
5252+5353+The command sets the status to `watched` and records `watched_at` using the current timestamp. Removing an item uses the same ID:
5454+5555+```sh
5656+noteleaf media movie remove 12
5757+```
5858+5959+Use removal for titles you abandoned or added by mistakeโthe CLI deletes the database entry so your queue stays focused.
6060+6161+## Metadata Cheat Sheet
6262+6363+- **Notes field**: includes critic score, whether Rotten Tomatoes marked it โCertified Fresh,โ and the canonical URL.
6464+- **Rating column**: reserved for future personal ratings; right now it mirrors the upstream critic context.
6565+- **Timestamps**: `added` when you saved it, `watched` when you complete it.
6666+6767+To keep a running diary, drop the IDs into a note:
6868+6969+```markdown
7070+### Queue Ideas
7171+- Movie #31 โ Watch before sequel comes out
7272+- Movie #12 โ Pair with article #5 for cyberpunk research
7373+```
7474+7575+This keeps everything searchable without having to leave the terminal.
+74
website/docs/media/organization.md
···11+---
22+title: Media Organization
33+sidebar_label: Organization
44+description: Keep queues manageable with filters, reviews, and note links.
55+sidebar_position: 5
66+---
77+88+# Media Organization
99+1010+Media entries share the same database as tasks and notes, so you can cross-reference everything. This page outlines the practical workflows for keeping large queues in check.
1111+1212+## Tags and Categories
1313+1414+Dedicated media tags have not shipped yet. Until they do:
1515+1616+- Use the free-form `Notes` column (populated automatically from Open Library or Rotten Tomatoes) to stash keywords such as โHugo shortlistโ or โDocumentaryโ.
1717+- When you need stricter structure, create a note that tracks an ad-hoc category and reference media IDs inside it:
1818+1919+```markdown
2020+## Cozy backlog
2121+- Book #11 โ comfort reread
2222+- Movie #25 โ rainy-day pick
2323+```
2424+2525+Full-text search (`noteleaf note list` โ `/` and search) will surface the note instantly, and the numeric IDs jump you right back into the media commands.
2626+2727+## Custom Lists
2828+2929+You already get status-based filters out of the box:
3030+3131+```sh
3232+noteleaf media book list --reading
3333+noteleaf media movie list --watched
3434+noteleaf media tv list --all | rg "FX" # filter with ripgrep
3535+```
3636+3737+For more bespoke dashboards:
3838+3939+1. Use `noteleaf status` to grab the SQLite path.
4040+2. Query it with tools like `sqlite-utils` or `datasette` to build spreadsheets or dashboards.
4141+3. Export subsets via `sqlite3 noteleaf.db "SELECT * FROM books WHERE status='reading'" > reading.csv`.
4242+4343+That approach keeps the CLI fast while still letting you slice the data any way you need.
4444+4545+## Ratings and Reviews
4646+4747+The database schema already includes a `rating` column for every media type. Rotten Tomatoes/Open Library populate it with critic hints for now; personal star ratings will become editable in a future release.
4848+4949+Until then, keep reviews as regular notes:
5050+5151+```sh
5252+noteleaf note create "Thoughts on Book #7"
5353+```
5454+5555+Inside the note, link back to the record (`Book #7`, `Movie #18`, etc.) so searches tie everything together. Because notes live on disk you can also version-control your reviews.
5656+5757+## Linking Media to Notes
5858+5959+There is no special โlinkโ command yet, but the following pattern works well:
6060+6161+1. Create a dedicated note per book/movie/show (or per collection).
6262+2. Add a heading with the media ID and paste the generated markdown path from `noteleaf article view` or the queue list.
6363+3. Optionally embed checklists or quotes gathered while reading/watching.
6464+6565+Example snippet:
6666+6767+```markdown
6868+### Book #7 โ Project Hail Mary
6969+- Status: reading (45%)
7070+- Tasks: todo #128 covers the experiment described in chapter 12
7171+- Next action: finish Part II before Friday
7272+```
7373+7474+Because tasks, notes, and media share the same SQLite file, future automation can join across them without migrations. When official linking lands it will reuse these IDs, so the prep work you do now keeps paying off.
+53
website/docs/media/overview.md
···11+---
22+title: Media Overview
33+sidebar_label: Overview
44+description: Manage reading lists and watch queues from the CLI.
55+sidebar_position: 1
66+---
77+88+# Media Tracking Overview
99+1010+Noteleaf keeps book, movie, and TV data next to your tasks and notes so you do not need a separate โwatch listโ app.
1111+All media commands hang off a single entry point:
1212+1313+```sh
1414+noteleaf media <book|movie|tv> <subcommand>
1515+```
1616+1717+- **Books** pull metadata from the Open Library API.
1818+- **Movies/TV** scrape Rotten Tomatoes search results to capture critic scores and canonical titles.
1919+- Everything is stored in the local SQLite database located in your data directory (`~/.local/share/noteleaf` on Linux, `~/Library/Application Support/noteleaf` on macOS, `%LOCALAPPDATA%\noteleaf` on Windows).
2020+2121+## Lifecycle Statuses
2222+2323+| Type | Statuses | Notes |
2424+| ------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------- |
2525+| Books | `queued`, `reading`, `finished`, `removed` | Progress updates automatically bump status (0% โ `queued`, 1-99% โ `reading`, 100% โ `finished`). |
2626+| Movies | `queued`, `watched`, `removed` | Marking as watched stores the completion timestamp. |
2727+| TV | `queued`, `watching`, `watched`, `removed` | Watching/watched commands also record the last watched time. |
2828+2929+Statuses control list filtering and show up beside each item in the TUI.
3030+3131+## Metadata That Gets Saved
3232+3333+- **Books**: title, authors, Open Library notes (editions, publishers, subjects), started/finished timestamps, progress percentage.
3434+- **Movies**: release year when available, Rotten Tomatoes critic score details inside the notes field, watched timestamp.
3535+- **TV**: show title plus critic score details, optional season/episode numbers, last watched timestamp.
3636+3737+You can safely edit the generated markdown/notes in your favorite editorโthe records keep pointing to the updated files.
3838+3939+## Interactive vs Static Workflows
4040+4141+All `list` commands default to a simple textual table. For books you can pass `-i/--interactive` to open the Bubble Tea list browser (TV and movie interactive selectors are planned). Inside the list view:
4242+4343+- `j/k` or arrow keys move between entries.
4444+- `/` starts search across titles, authors, and metadata.
4545+- `v` opens a focused preview.
4646+- `?` shows all shortcuts.
4747+4848+If you prefer scripts, combine the static lists with tools like `rg` or `jq`.
4949+5050+## Storage Layout
5151+5252+Media records live in the SQLite database (`noteleaf.db`). Binary assets are not downloaded; the metadata stores canonical URLs so you can jump back to the source at any time.
5353+Use `noteleaf status` to see the exact paths for your database, data directory, and configuration file.
+64
website/docs/media/tv.md
···11+---
22+title: TV Shows
33+sidebar_label: TV Shows
44+description: Track long-form series with simple queue management.
55+sidebar_position: 4
66+---
77+88+# TV Shows
99+1010+TV commands live under `noteleaf media tv`. Like movies, they use Rotten Tomatoes search so you can trust the spelling and canonical links.
1111+1212+## Add Shows
1313+1414+```sh
1515+noteleaf media tv add "Breaking Bad"
1616+```
1717+1818+- Inline mode shows up to five matches and asks you to choose.
1919+- `-i/--interactive` is wired up for the future list selector.
2020+2121+Every new show starts as `queued`.
2222+2323+## List the Queue
2424+2525+```sh
2626+noteleaf media tv list # queued shows
2727+noteleaf media tv list --watching # in-progress series
2828+noteleaf media tv list --watched # finished shows
2929+noteleaf media tv list --all # everything
3030+```
3131+3232+Output includes the ID, title, optional season/episode numbers (once those fields are set), status, critic-score snippet, and timestamps.
3333+3434+## Update Status
3535+3636+Use semantic verbs instead of editing the status manually:
3737+3838+```sh
3939+noteleaf media tv watching 8 # Moved to โcurrently watchingโ
4040+noteleaf media tv watched 8 # Mark completed
4141+noteleaf media tv remove 8 # Drop from the queue entirely
4242+```
4343+4444+Each transition records `last_watched` so you know when you left off. Future releases will expose explicit season/episode commands; until then store quick reminders in a linked note:
4545+4646+```markdown
4747+### TV checklist
4848+- TV #8 โ resume Season 3 Episode 5
4949+- TV #15 โ waiting for new season announcement
5050+```
5151+5252+## Organization Tips
5353+5454+- Use `noteleaf media tv list --watching | fzf` to pick tonightโs episode.
5555+- Pipe `--all` into `rg "HBO"` to filter on the metadata snippet that contains the network/URL.
5656+- Include `TV #ID` references in your weekly review note so you can jump back with a single ID lookup.
5757+5858+## What Gets Stored
5959+6060+- Rotten Tomatoes critic info plus canonical URL (inside the Notes column).
6161+- Optional season/episode integers for future episode tracking (already part of the schema).
6262+- Added timestamps and โlast watchedโ timestamps.
6363+6464+Because shows can last months, keeping the queue short (just what you plan to watch soon) makes the `list` output far easier to scan.
···11+---
22+title: Advanced Note Features
33+sidebar_label: Advanced
44+description: Search, exports, backlinks, and automation tips.
55+sidebar_position: 5
66+---
77+88+# Advanced Note Features
99+1010+## Full-Text Search
1111+1212+While not exposed as a dedicated command, you can search note content using the database:
1313+1414+**Search with grep** (searches file content):
1515+1616+```sh
1717+grep -r "search term" ~/.local/share/noteleaf/notes/
1818+```
1919+2020+**Search titles and metadata**:
2121+2222+```sh
2323+noteleaf note list --static | grep "keyword"
2424+```
2525+2626+Future versions may include built-in full-text search with relevance ranking.
2727+2828+## Note Exports
2929+3030+Export notes to different formats using standard markdown tools:
3131+3232+**Convert to HTML with pandoc**:
3333+3434+```sh
3535+noteleaf note view 1 --format=raw | pandoc -o output.html
3636+```
3737+3838+**Convert to PDF**:
3939+4040+```sh
4141+noteleaf note view 1 --format=raw | pandoc -o output.pdf
4242+```
4343+4444+**Batch export all notes**:
4545+4646+```sh
4747+for note in ~/.local/share/noteleaf/notes/*.md; do
4848+ pandoc "$note" -o "${note%.md}.html"
4949+done
5050+```
5151+5252+## Backlinks and References
5353+5454+Manually create backlinks between notes using markdown links:
5555+5656+```markdown
5757+See also: [[Research on Authentication]] for background
5858+Related: [[API Design Principles]]
5959+```
6060+6161+While Noteleaf doesn't automatically parse or display backlinks yet, this syntax prepares notes for future backlink support and works with tools like Obsidian if you point it at the notes directory.
+57
website/docs/notes/basics.md
···11+---
22+title: Note Basics
33+sidebar_label: Basics
44+description: Creating notes, metadata, and storage model.
55+sidebar_position: 2
66+---
77+88+# Note Basics
99+1010+## Creation
1111+1212+**Quick note from command line**:
1313+1414+```sh
1515+noteleaf note create "Meeting Notes" "Discussed Q4 roadmap and hiring plans"
1616+```
1717+1818+**Interactive creation** (opens editor):
1919+2020+```sh
2121+noteleaf note create --interactive
2222+```
2323+2424+**From existing file**:
2525+2626+```sh
2727+noteleaf note create --file ~/Documents/draft.md
2828+```
2929+3030+**Create and immediately edit**:
3131+3232+```sh
3333+noteleaf note create "Research Notes" --editor
3434+```
3535+3636+## Structure
3737+3838+Notes consist of:
3939+4040+**Title**: Short descriptor shown in lists and searches. Can be updated later.
4141+4242+**Content**: Full markdown text. Supports all standard markdown features including code blocks, lists, tables, and links.
4343+4444+**Tags**: Categorization labels for organizing and filtering notes. Multiple tags per note.
4545+4646+**Dates**: Creation and modification timestamps tracked automatically.
4747+4848+**File Path**: Location of the markdown file on disk, managed by Noteleaf.
4949+5050+## Storage
5151+5252+**File Location**: Notes are stored as individual `.md` files in your notes directory (typically `~/.local/share/noteleaf/notes` or `~/Library/Application Support/noteleaf/notes`).
5353+5454+**Naming**: Files are named with a UUID to ensure uniqueness. The title is stored in the database, not the filename.
5555+5656+**Portability**: Since notes are plain markdown, you can read them with any text editor or markdown viewer.
5757+The database provides additional functionality like tagging and search, but the files remain standalone.
+28
website/docs/notes/best-practices.md
···11+---
22+title: Note Tips and Best Practices
33+sidebar_label: Best Practices
44+description: Guidelines for keeping notes useful over time.
55+sidebar_position: 8
66+---
77+88+# Note Tips and Best Practices
99+1010+**Write in plain language**: Notes are for your future self. Avoid jargon you might forget.
1111+1212+**Tag consistently**: Establish a tagging taxonomy early and stick to it. Review tags periodically with `noteleaf note tags`.
1313+1414+**Link liberally**: Reference related notes, tasks, and articles. Future features will leverage these connections.
1515+1616+**Short, focused notes**: Better to have many small notes than few giant ones. Easier to link and reuse.
1717+1818+**Regular review**: Schedule time to review notes, add tags, create links, and archive outdated content.
1919+2020+**Edit immediately**: If you notice incomplete or unclear notes, edit them now. Stale notes lose value.
2121+2222+**Use your editor**: Configure your favorite editor with markdown plugins for better syntax highlighting and live preview.
2323+2424+**Backup regularly**: While notes are files, backup both the notes directory and the database to preserve metadata.
2525+2626+**Experiment with formats**: Try different note structures (journal, zettelkasten, topic-based) to find what works for you.
2727+2828+For CLI command reference, run `noteleaf note --help` or open the contextual help inside the TUI.
···11+---
22+title: Note Operations
33+sidebar_label: Operations
44+description: List, read, edit, and delete notes from the CLI.
55+sidebar_position: 3
66+---
77+88+# Note Operations
99+1010+### Listing Notes
1111+1212+**Interactive TUI** (default):
1313+```sh
1414+noteleaf note list
1515+```
1616+1717+Navigate with arrow keys, press Enter to read, `e` to edit, `q` to quit.
1818+1919+**Static list**:
2020+```sh
2121+noteleaf note list --static
2222+```
2323+2424+**Filter by tags**:
2525+```sh
2626+noteleaf note list --tags research,technical
2727+```
2828+2929+**Show archived notes**:
3030+```sh
3131+noteleaf note list --archived
3232+```
3333+3434+### Reading Notes
3535+3636+View note content with formatted rendering:
3737+3838+```sh
3939+noteleaf note read 1
4040+```
4141+4242+Aliases: `noteleaf note view 1`
4343+4444+The viewer renders markdown with syntax highlighting for code blocks, proper formatting for headers and lists, and displays metadata (title, tags, dates).
4545+4646+### Editing Notes
4747+4848+Open note in your configured editor:
4949+5050+```sh
5151+noteleaf note edit 1
5252+```
5353+5454+Noteleaf uses the editor specified in your configuration or the `$EDITOR` environment variable. Common choices: `vim`, `nvim`, `nano`, `code`, `emacs`.
5555+5656+**Configure editor**:
5757+```sh
5858+noteleaf config set editor nvim
5959+```
6060+6161+Changes are saved automatically when you close the editor. The modification timestamp updates to track when notes were last changed.
6262+6363+### Deleting Notes
6464+6565+Remove a note permanently:
6666+6767+```sh
6868+noteleaf note remove 1
6969+```
7070+7171+Aliases: `rm`, `delete`, `del`
7272+7373+This deletes both the markdown file and database metadata. You'll be prompted for confirmation. This operation cannot be undone, so consider archiving instead if you might need the note later.
+116
website/docs/notes/organization.md
···11+---
22+title: Note Organization
33+sidebar_label: Organization
44+description: Tagging, linking, and template workflows for notes.
55+sidebar_position: 4
66+---
77+88+# Note Organization
99+1010+## Tagging
1111+1212+Tags provide flexible categorization without hierarchical constraints.
1313+1414+**Add tags during creation**:
1515+1616+```sh
1717+noteleaf note create "API Design" --tags architecture,reference
1818+```
1919+2020+**Add tags to existing note**:
2121+2222+```sh
2323+noteleaf note update 1 --add-tag reference
2424+```
2525+2626+**Remove tags**:
2727+2828+```sh
2929+noteleaf note update 1 --remove-tag draft
3030+```
3131+3232+**List all tags**:
3333+3434+```sh
3535+noteleaf note tags
3636+```
3737+3838+Shows each tag with the count of notes using it.
3939+4040+**Tag naming conventions**: Use lowercase, hyphens for compound tags. Examples: `research`, `meeting-notes`, `how-to`, `reference`, `technical`, `personal`.
4141+4242+## Linking
4343+4444+While not a first-class feature in the current UI, notes can reference tasks by ID or description:
4545+4646+```markdown
4747+# Implementation Plan
4848+4949+Related task: #42 (Deploy authentication service)
5050+5151+## Next Steps
5252+- Complete testing (task #43)
5353+- Write documentation (task #44)
5454+```
5555+5656+Future versions may support automatic linking between notes and tasks in the database.
5757+5858+## Templates
5959+6060+Create reusable note structures using shell functions or scripts:
6161+6262+**In ~/.bashrc or ~/.zshrc**:
6363+6464+```sh
6565+meeting_note() {
6666+ local title="Meeting: $1"
6767+ local date=$(date +%Y-%m-%d)
6868+ local content="# $title
6969+7070+**Date**: $date
7171+7272+## Attendees
7373+-
7474+7575+## Agenda
7676+-
7777+7878+## Discussion
7979+-
8080+8181+## Action Items
8282+- [ ]
8383+8484+## Next Meeting
8585+- "
8686+8787+ echo "$content" | noteleaf note create "$title" --tags meeting --editor
8888+}
8989+9090+daily_note() {
9191+ local date=$(date +%Y-%m-%d)
9292+ local title="Daily: $date"
9393+ local content="# $title
9494+9595+## Completed Today
9696+-
9797+9898+## In Progress
9999+-
100100+101101+## Tomorrow's Focus
102102+-
103103+104104+## Notes
105105+- "
106106+107107+ echo "$content" | noteleaf note create "$title" --tags daily --editor
108108+}
109109+```
110110+111111+Usage:
112112+113113+```sh
114114+meeting_note "Q4 Planning"
115115+daily_note
116116+```
+11
website/docs/notes/overview.md
···11+---
22+title: Notes Overview
33+sidebar_label: Overview
44+description: How Noteleaf manages markdown-based notes.
55+sidebar_position: 1
66+---
77+88+# Notes Overview
99+1010+Noteleaf provides a markdown-based note-taking system integrated with your tasks, articles, and media tracking.
1111+Notes are stored as individual markdown files with metadata tracked in the database, giving you both structure and portability.
+85
website/docs/notes/workflows.md
···11+---
22+title: Note-Taking Workflows
33+sidebar_label: Workflows
44+description: Zettelkasten, meeting notes, daily notes, and more.
55+sidebar_position: 7
66+---
77+88+# Note-Taking Workflows
99+1010+## Zettelkasten
1111+1212+Zettelkasten emphasizes atomic notes with heavy linking:
1313+1414+1. **Create atomic notes**: Each note covers one concept
1515+2. **Add descriptive tags**: Use tags for categorization
1616+3. **Link related notes**: Reference other notes by title
1717+4. **Develop ideas over time**: Expand notes with new insights
1818+1919+Example:
2020+2121+```sh
2222+noteleaf note create "Dependency Injection" --tags architecture,patterns
2323+noteleaf note create "Inversion of Control" --tags architecture,patterns
2424+# In each note, reference the other
2525+```
2626+2727+### Research
2828+2929+For academic or technical research:
3030+3131+1. **Source note per paper/article**: Create note for each source
3232+2. **Extract key points**: Summarize in your own words
3333+3. **Tag by topic**: Use consistent tags across research area
3434+4. **Link to related work**: Reference other sources
3535+3636+Example:
3737+3838+```sh
3939+noteleaf note create "Paper: Microservices Patterns" \
4040+ --tags research,architecture,microservices
4141+```
4242+4343+### Meeting
4444+4545+Capture discussions and action items:
4646+4747+1. **Template-based**: Use meeting_note function from earlier
4848+2. **Consistent structure**: Attendees, agenda, discussion, actions
4949+3. **Action items**: Extract as tasks for follow-up
5050+4. **Link to projects**: Tag with project name
5151+5252+Example:
5353+5454+```sh
5555+meeting_note "Sprint Planning"
5656+# Then extract action items as tasks
5757+noteleaf task add "Implement auth endpoint" --project web-service
5858+```
5959+6060+### Daily
6161+6262+Journal-style daily entries:
6363+6464+1. **Daily template**: Use daily_note function
6565+2. **Reflect on work**: What was accomplished, what's next
6666+3. **Capture ideas**: Random thoughts for later processing
6767+4. **Review weekly**: Scan week's notes for patterns
6868+6969+Example:
7070+7171+```sh
7272+daily_note
7373+# Creates note tagged with 'daily' and today's date
7474+```
7575+7676+### Personal Knowledge Base
7777+7878+Build a reference library:
7979+8080+1. **How-to guides**: Document procedures and commands
8181+2. **Troubleshooting notes**: Solutions to problems encountered
8282+3. **Concept explanations**: Notes on topics you're learning
8383+4. **Snippets**: Code examples and configurations
8484+8585+Use tags like: `how-to`, `troubleshooting`, `reference`, `snippet`
···11+---
22+title: Advanced Task Features
33+sidebar_label: Advanced
44+description: Recurring tasks, dependencies, hierarchies, and custom fields.
55+sidebar_position: 6
66+---
77+88+# Advanced Task Features
99+1010+## Recurrence
1111+1212+Create tasks that repeat on a schedule using iCalendar recurrence rules.
1313+1414+**Daily task**:
1515+1616+```sh
1717+noteleaf task add "Daily standup" --recur "FREQ=DAILY"
1818+```
1919+2020+**Weekly task on specific days**:
2121+2222+```sh
2323+noteleaf task add "Team meeting" --recur "FREQ=WEEKLY;BYDAY=MO,WE"
2424+```
2525+2626+**Monthly task**:
2727+2828+```sh
2929+noteleaf task add "Invoice review" --recur "FREQ=MONTHLY;BYMONTHDAY=1"
3030+```
3131+3232+**With end date**:
3333+3434+```sh
3535+noteleaf task add "Q1 review" \
3636+ --recur "FREQ=WEEKLY" \
3737+ --until 2025-03-31
3838+```
3939+4040+**Manage recurrence**:
4141+4242+Set recurrence on existing task:
4343+4444+```sh
4545+noteleaf task recur set 1 --rule "FREQ=DAILY"
4646+```
4747+4848+View recurrence info:
4949+5050+```sh
5151+noteleaf task recur show 1
5252+```
5353+5454+Remove recurrence:
5555+5656+```sh
5757+noteleaf task recur clear 1
5858+```
5959+6060+When you complete a recurring task, Noteleaf automatically generates the next instance based on the recurrence rule.
6161+6262+## Dependencies
6363+6464+Create relationships where tasks must be completed in order.
6565+6666+**Add dependency** (task 1 depends on task 2):
6767+6868+```sh
6969+noteleaf task depend add 1 <uuid-of-task-2>
7070+```
7171+7272+**List dependencies** (what must be done first):
7373+7474+```sh
7575+noteleaf task depend list 1
7676+```
7777+7878+**List blocked tasks** (what's waiting on this task):
7979+8080+```sh
8181+noteleaf task depend blocked-by 1
8282+```
8383+8484+**Remove dependency**:
8585+8686+```sh
8787+noteleaf task depend remove 1 <uuid-of-task-2>
8888+```
8989+9090+Dependencies use task UUIDs (shown in `task view`) rather than IDs for stability across database changes.
9191+9292+## Hierarchical Tasks
9393+9494+Create parent-child relationships for breaking down large tasks.
9595+9696+**Create child task**:
9797+9898+```sh
9999+noteleaf task add "Write API documentation" --parent <parent-uuid>
100100+```
101101+102102+Parent tasks can have multiple children, creating a tree structure for complex projects.
103103+104104+## Custom Attributes
105105+106106+While not exposed through specific flags, the database schema supports extending tasks with custom attributes for advanced use cases or scripting.
+85
website/docs/tasks/basics.md
···11+---
22+title: Task Basics
33+sidebar_label: Basics
44+description: Create tasks and understand their core attributes.
55+sidebar_position: 2
66+---
77+88+# Task Basics
99+1010+## Creation
1111+1212+Create a simple task:
1313+1414+```sh
1515+noteleaf task add "Write documentation"
1616+```
1717+1818+Create a task with attributes:
1919+2020+```sh
2121+noteleaf task add "Review pull requests" \
2222+ --priority high \
2323+ --project work \
2424+ --tags urgent,code-review \
2525+ --due 2025-01-15
2626+```
2727+2828+## Properties
2929+3030+**Description**: What needs to be done. Can be updated later with `task update`.
3131+3232+**Status**: Task lifecycle state:
3333+3434+- `pending`: Not yet started (default for new tasks)
3535+- `active`: Currently being worked on
3636+- `completed`: Finished successfully
3737+- `deleted`: Removed but preserved for history
3838+- `waiting`: Blocked or postponed
3939+4040+**Priority**: Importance level affects sorting and display:
4141+4242+- `low`: Nice to have, defer if busy
4343+- `medium`: Standard priority (default)
4444+- `high`: Important, should be done soon
4545+- `urgent`: Critical, top of the list
4646+4747+**Project**: Group related tasks together. Examples: `work`, `home`, `side-project`. Projects create organizational boundaries and enable filtering.
4848+4949+**Context**: Location or mode where task can be done. Examples: `@home`, `@office`, `@phone`, `@computer`. Contexts help filter tasks based on current situation.
5050+5151+**Tags**: Flexible categorization orthogonal to projects. Examples: `urgent`, `quick-win`, `research`, `bug`. Multiple tags per task.
5252+5353+**Due Date**: When the task should be completed. Format: `YYYY-MM-DD` or relative (`tomorrow`, `next week`).
5454+5555+### Lifecycle
5656+5757+Tasks move through statuses as work progresses:
5858+5959+```
6060+pending -> active -> completed
6161+ |
6262+ v
6363+ waiting
6464+ |
6565+ v
6666+ deleted
6767+```
6868+6969+**Mark task as active**:
7070+7171+```sh
7272+noteleaf task update 1 --status active
7373+```
7474+7575+**Complete a task**:
7676+7777+```sh
7878+noteleaf task done 1
7979+```
8080+8181+**Delete a task**:
8282+8383+```sh
8484+noteleaf task delete 1
8585+```
+26
website/docs/tasks/batch-operations.md
···11+---
22+title: Batch Operations
33+sidebar_label: Batch Ops
44+description: Use shell scripting patterns for mass task edits.
55+sidebar_position: 8
66+---
77+88+# Batch Operations
99+1010+While Noteleaf doesn't have built-in bulk update commands, you can use shell scripting for batch operations:
1111+1212+**Complete all tasks in a project**:
1313+1414+```sh
1515+noteleaf task list --project old-project --static | \
1616+ awk '{print $1}' | \
1717+ xargs -I {} noteleaf task done {}
1818+```
1919+2020+**Add tag to multiple tasks**:
2121+2222+```sh
2323+for id in 1 2 3 4 5; do
2424+ noteleaf task update $id --add-tag urgent
2525+done
2626+```
+26
website/docs/tasks/best-practices.md
···11+---
22+title: Task Tips and Best Practices
33+sidebar_label: Best Practices
44+description: Practical guidance for staying productive with tasks.
55+sidebar_position: 10
66+---
77+88+# Task Tips and Best Practices
99+1010+**Start with simple workflows**: Don't over-organize initially. Use basic priorities and projects before adding contexts, tags, and dependencies.
1111+1212+**Review regularly**: Use `task list` daily to check pending work. Weekly reviews help catch stale tasks.
1313+1414+**Use contexts for GTD**: If following Getting Things Done, contexts help filter tasks by what you can do right now.
1515+1616+**Project-based work**: For complex initiatives, use projects to group tasks and dependencies to order work.
1717+1818+**Time tracking for accountability**: Even rough time tracking reveals where hours go and helps with estimates.
1919+2020+**Recurrence for habits**: Use recurring tasks for daily/weekly habits, but keep the list short to avoid clutter.
2121+2222+**Tags for cross-cutting concerns**: Use tags for themes that span projects: `urgent`, `blocked`, `waiting-on-feedback`, `quick-win`.
2323+2424+**JSON output for scripts**: Use `--json` flag with scripting to build custom reports and integrations.
2525+2626+For CLI command reference, run `noteleaf task --help` or explore the inline help on each subcommand.
+114
website/docs/tasks/operations.md
···11+---
22+title: Task Operations
33+sidebar_label: Operations
44+description: List, view, and update tasks from the CLI and TUI.
55+sidebar_position: 3
66+---
77+88+# Task Operations
99+1010+## Listing and Filtering
1111+1212+**Interactive list** (default):
1313+1414+```sh
1515+noteleaf task list
1616+```
1717+1818+Navigate with arrow keys, press Enter to view details, `q` to quit.
1919+2020+**Static list** (for scripting):
2121+2222+```sh
2323+noteleaf task list --static
2424+```
2525+2626+**Filter by status**:
2727+2828+```sh
2929+noteleaf task list --status pending
3030+noteleaf task list --status completed
3131+```
3232+3333+**Filter by project**:
3434+3535+```sh
3636+noteleaf task list --project work
3737+```
3838+3939+**Filter by priority**:
4040+4141+```sh
4242+noteleaf task list --priority high
4343+```
4444+4545+**Filter by context**:
4646+4747+```sh
4848+noteleaf task list --context @office
4949+```
5050+5151+**Show all tasks** (including completed):
5252+5353+```sh
5454+noteleaf task list --all
5555+```
5656+5757+## Viewing Task Details
5858+5959+View complete task information:
6060+6161+```sh
6262+noteleaf task view 1
6363+```
6464+6565+JSON output for scripts:
6666+6767+```sh
6868+noteleaf task view 1 --json
6969+```
7070+7171+Brief format without metadata:
7272+7373+```sh
7474+noteleaf task view 1 --format brief
7575+```
7676+7777+## Updating Tasks
7878+7979+Update single attribute:
8080+8181+```sh
8282+noteleaf task update 1 --priority urgent
8383+```
8484+8585+Update multiple attributes:
8686+8787+```sh
8888+noteleaf task update 1 \
8989+ --priority urgent \
9090+ --due tomorrow \
9191+ --add-tag critical
9292+```
9393+9494+Change description:
9595+9696+```sh
9797+noteleaf task update 1 --description "New task description"
9898+```
9999+100100+Add and remove tags:
101101+102102+```sh
103103+noteleaf task update 1 --add-tag urgent --remove-tag later
104104+```
105105+106106+## Interactive Editing
107107+108108+Open interactive editor for complex changes:
109109+110110+```sh
111111+noteleaf task edit 1
112112+```
113113+114114+This provides a TUI with visual pickers for status and priority, making updates faster than command flags.
+64
website/docs/tasks/organization.md
···11+---
22+title: Task Organization
33+sidebar_label: Organization
44+description: Use projects, contexts, and tags to structure work.
55+sidebar_position: 5
66+---
77+88+# Task Organization
99+1010+## Projects
1111+1212+Projects group related tasks. Useful for separating work contexts or major initiatives.
1313+1414+**List all projects**:
1515+1616+```sh
1717+noteleaf task projects
1818+```
1919+2020+Shows each project with task count.
2121+2222+**Filter tasks by project**:
2323+2424+```sh
2525+noteleaf task list --project work
2626+```
2727+2828+**Project naming**: Use lowercase, hyphens for spaces. Examples: `work`, `side-project`, `home-improvement`.
2929+3030+## Contexts
3131+3232+Contexts represent where or how a task can be done. Helps with GTD-style workflow.
3333+3434+**List all contexts**:
3535+3636+```sh
3737+noteleaf task contexts
3838+```
3939+4040+**Filter by context**:
4141+4242+```sh
4343+noteleaf task list --context @home
4444+```
4545+4646+**Context naming**: Prefix with `@` following GTD convention. Examples: `@home`, `@office`, `@phone`, `@errands`.
4747+4848+## Tags
4949+5050+Tags provide flexible categorization. Unlike projects and contexts, tasks can have multiple tags.
5151+5252+**List all tags**:
5353+5454+```sh
5555+noteleaf task tags
5656+```
5757+5858+**Filter by tags** (tasks must have all specified tags):
5959+6060+```sh
6161+noteleaf task list --tags urgent,bug
6262+```
6363+6464+**Tag naming**: Use lowercase, hyphens for compound tags. Examples: `urgent`, `quick-win`, `code-review`, `waiting-on-feedback`.
+11
website/docs/tasks/overview.md
···11+---
22+title: Task Management Overview
33+sidebar_label: Overview
44+description: High-level summary of Noteleaf's task workflow.
55+sidebar_position: 1
66+---
77+88+# Task Management Overview
99+1010+Noteleaf provides TaskWarrior-inspired task management with priorities, projects, contexts, tags, dependencies, and time tracking.
1111+Whether you're managing personal todos or complex projects, Noteleaf helps you organize work and track progress.
+33
website/docs/tasks/queries.md
···11+---
22+title: Task Queries and Filtering
33+sidebar_label: Queries
44+description: Compose filters for precise task lists and reports.
55+sidebar_position: 7
66+---
77+88+# Task Queries and Filtering
99+1010+Combine filters for precise task lists:
1111+1212+**High priority work tasks due this week**:
1313+1414+```sh
1515+noteleaf task list \
1616+ --project work \
1717+ --priority high \
1818+ --status pending
1919+```
2020+2121+**All completed tasks from specific project**:
2222+2323+```sh
2424+noteleaf task list \
2525+ --project side-project \
2626+ --status completed
2727+```
2828+2929+**Quick wins** (tasks tagged as quick):
3030+3131+```sh
3232+noteleaf task list --tags quick-win
3333+```
+34
website/docs/tasks/templates.md
···11+---
22+title: Task Templates
33+sidebar_label: Templates
44+description: Shell helpers for creating consistent task structures.
55+sidebar_position: 9
66+---
77+88+# Task Templates
99+1010+While templates aren't built-in, you can create shell functions for common task patterns:
1111+1212+```sh
1313+# In your ~/.bashrc or ~/.zshrc
1414+bug() {
1515+ noteleaf task add "$1" \
1616+ --project $(git rev-parse --show-toplevel | xargs basename) \
1717+ --tags bug \
1818+ --priority high
1919+}
2020+2121+meeting() {
2222+ noteleaf task add "$1" \
2323+ --project work \
2424+ --context @office \
2525+ --recur "FREQ=WEEKLY;BYDAY=$2"
2626+}
2727+```
2828+2929+Usage:
3030+3131+```sh
3232+bug "Fix login redirect"
3333+meeting "Sprint planning" "MO"
3434+```
+60
website/docs/tasks/time-tracking.md
···11+---
22+title: Time Tracking
33+sidebar_label: Time Tracking
44+description: Track work, review sessions, and generate timesheets.
55+sidebar_position: 4
66+---
77+88+# Time Tracking
99+1010+Track hours spent on tasks for billing, reporting, or personal analytics.
1111+1212+## Starting and Stopping
1313+1414+**Start tracking**:
1515+1616+```sh
1717+noteleaf task start 1
1818+```
1919+2020+With a note about what you're doing:
2121+2222+```sh
2323+noteleaf task start 1 --note "Implementing authentication"
2424+```
2525+2626+**Stop tracking**:
2727+2828+```sh
2929+noteleaf task stop 1
3030+```
3131+3232+Only one task can be actively tracked at a time.
3333+3434+## Viewing Timesheets
3535+3636+**Last 7 days** (default):
3737+3838+```sh
3939+noteleaf task timesheet
4040+```
4141+4242+**Specific time range**:
4343+4444+```sh
4545+noteleaf task timesheet --days 30
4646+```
4747+4848+**For specific task**:
4949+5050+```sh
5151+noteleaf task timesheet --task 1
5252+```
5353+5454+Timesheet shows:
5555+5656+- Date and time range for each session
5757+- Duration
5858+- Notes attached to the session
5959+- Total time per task
6060+- Total time across all tasks