CLI Command Reference#
fn collection#
Show collection info, or manage collections via subcommands.
fn collection [info]#
fn collection # Show active collection summary
fn collection info # Same — show path, note count, tag count, cache status
fn collection info --json # Structured output
fn collection switch#
fn collection switch "Work" # Switch by name
fn collection switch ~/Documents/Notes # Switch by path
fn collection switch A1B2C3D4-... # Switch by UUID
fn collection add#
fn collection add ~/Documents/Research --name "Research"
fn collection add ~/Notes --name "Notes" --activate # Switch to it immediately
fn collection add ~/Vault --name "Vault" --mode compatible # foldnotes | compatible | readOnly
fn collection add /Volumes/USB/Notes --force # Skip safety checks
| Option | Description |
|---|---|
--name <name> |
Display name for the collection |
--mode <mode> |
foldnotes (default), compatible, or readOnly |
--force |
Skip folder safety validation |
--activate |
Set as the active collection after adding |
Note: Obsidian vaults and Logseq graphs are blocked — use File > Import from Obsidian in the app to safely copy notes into a new collection instead.
fn collection remove#
Removes the collection from the registry (--confirm must match the collection name). Does not delete files on disk.
fn collection doctor#
Diagnose how a command resolves files, per-collection config, and the cache for a collection — useful when --collection appears to read the wrong data.
Prints the resolved documents directory, the config directory and project terminology, the cache policy and store path, and the app's collection registry (with the resolved collection marked →).
fn collections#
List every registered collection.
fn list#
List notes with filtering and sorting.
fn list
fn list --tag project --sort modified --limit 20
fn list --favourites --json
fn list --has-overdue
fn list --modified-after 2026-03-01 --modified-before 2026-04-01
| Option | Description |
|---|---|
--tag <tag> |
Filter by tag (repeatable, AND logic) |
--include-subtags |
Also match sub-tags (e.g. projects matches projects/marketing) |
--property <key=value> |
Filter by front matter property (repeatable) |
--modified-after <date> |
Notes modified after this date |
--modified-before <date> |
Notes modified before this date |
--favourites |
Only favourite notes |
--has-tasks |
Only notes with active tasks |
--has-overdue |
Only notes with overdue tasks |
--archived |
Only archived notes |
--include-archived |
Include archived notes in results |
--include-trashed |
Include trashed notes |
--include-daily |
Include daily notes (excluded by default) |
--sort <key> |
Sort by modified (default), created, title, or size |
--reverse |
Reverse sort order |
--limit <n> |
Maximum results |
fn show#
Display a note's content and metadata.
fn show "Meeting Notes"
fn show --id 8A3F2B1C-...
fn show "My Note" --body
fn show "My Note" --tasks
fn show "My Note" --backlinks
| Option | Description |
|---|---|
--id <uuid> |
Look up by UUID |
--properties |
Show only front matter properties |
--body |
Show only body text |
--tasks |
Show tasks in this note |
--backlinks |
Show notes linking to this one |
fn create#
Create a new note.
fn create "Project Plan"
fn create "Ideas" --content "# Ideas\n\nFirst idea."
fn create "Import" --from ~/Desktop/draft.md
fn create "Tagged" --tag project --tag urgent
fn create "Props" --property "status=draft"
echo "Piped content" | fn create "Piped Note"
fn create "Standup" --template "Daily Standup" --var project=foldnotes --var sprint=12
fn create "Quick" --open
| Option | Description |
|---|---|
--content <text> |
Note body content |
--from <path> |
Import content from a file |
--template <name> |
Create from a named template (see fn templates); overrides --content/--from |
--var <key=value> |
Template variable for {{key}} placeholders (repeatable) |
--tag <tag> |
Add tag (repeatable) |
--property <key=value> |
Set front matter property (repeatable) |
--open |
Open in FoldNotes after creation |
Content priority: --template > --from > --content > stdin > default heading.
fn daily#
Show, create, or append to daily notes.
fn daily # Show today's daily note
fn daily yesterday # Yesterday's note
fn daily 2026-03-15 # Specific date
fn daily --create # Create today's if missing
fn daily --open # Open in FoldNotes
fn daily --tasks # Tasks from today's note
fn daily append#
fn daily append "Meeting at 3pm"
fn daily append --date yesterday "Forgot to log this"
echo "Piped text" | fn daily append
fn edit#
Modify a note's content or properties.
fn edit "My Note" --append "New paragraph."
fn edit "My Note" --prepend-after-heading "After the heading."
fn edit "My Note" --content "Complete replacement."
fn edit "My Note" --set-property "status=done"
fn edit "My Note" --remove-property "draft"
fn edit "My Note" --set-property "rating=abc" --force # bypass validation
fn edit "My Note" --favourite
fn edit "My Note" --unfavourite
fn edit "My Note" --archive
fn edit "My Note" --unarchive
| Option | Description |
|---|---|
--content <text> |
Replace entire body |
--append <text> |
Append to end |
--prepend-after-heading <text> |
Insert after first heading |
--set-property <key=value> |
Set front matter property (repeatable) |
--remove-property <key> |
Remove property (repeatable) |
--favourite |
Mark as favourite |
--unfavourite |
Remove favourite |
--archive |
Archive the note (excluded from fn list by default) |
--unarchive |
Restore an archived note |
--force |
Bypass property schema validation |
Archiving sets the status: archived property. There are also standalone fn archive / fn unarchive commands (below). Show archived notes with fn list --archived, or include them with fn list --include-archived.
fn delete#
Move a note to trash or permanently delete.
fn delete "Old Note" # Soft delete
fn delete --id 8A3F2B1C-... # Delete by UUID
fn delete "Old Note" --permanent # Permanently delete
fn delete --empty-trash # Empty the trash
fn restore#
Move a note back out of the trash (inverse of soft-delete). De-dupes the filename if a live note already uses it.
fn archive / fn unarchive#
Discoverable aliases for the archive state (same as fn edit --archive/--unarchive).
fn rename#
Illegal characters are stripped. Collisions get a numeric suffix.
fn tags#
fn tags # List all tags
fn tags --prefix "project" # Filter by prefix
fn tags "project/alpha" # Notes with this tag
fn properties#
Manage property definitions (the collection-wide schema) and query property usage.
fn properties # List all defined properties
fn properties list # Same as above
fn properties list --json # Structured output
fn properties show#
fn properties show "status" # Detail view: type, options, validation, which notes use it
fn properties show "status" --json
fn properties add#
fn properties add "status" --type singleSelect --property-options "Draft,In Progress,Done"
fn properties add "deadline" --type date --required
fn properties add "budget" --type number
fn properties add "reviewed" --type checkbox
| Option | Description |
|---|---|
--type <type> |
Property type (required): text, number, date, dateTime, checkbox, singleSelect, multiSelect, url, email, phone, rating |
--property-options <list> |
Comma-separated options (required for select types) |
--required |
Mark property as required |
fn properties delete#
fn properties delete "status" # Shows usage count, asks for --force
fn properties delete "status" --force # Skip confirmation
Values are preserved in notes — only the schema definition is removed.
fn properties orphans#
Find front matter keys that have no schema definition. Useful for catching typos, case mismatches, or legacy properties.
fn properties notes#
List notes that use a specific property, optionally filtered by value.
fn properties notes "status" # All notes with a status property
fn properties notes "status" --value "draft" # Only notes where status = draft
Schema Validation#
When you set a property with fn edit --set-property, the CLI validates the value against the schema:
- Name correction —
Status=draftis auto-corrected tostatus=Draft(canonical schema casing) - Type checking — rejects
rating=abc(not a number),deadline=soon(not a date) - Option matching —
status=DRAFTmatchesDraft(case-insensitive) - Unknown properties — rejected with a hint to create the definition first
Use --force to bypass all validation and write the raw value.
fn templates#
List the collection's note templates. Apply one with fn create --template.
Each template can define {{variables}}, {{date:FORMAT}} / {{time:FORMAT}} placeholders, tags, and front-matter property defaults — all resolved when you create a note from it (supply variables with fn create --var key=value).
fn tasks#
fn tasks # All incomplete tasks
fn tasks --overdue # Overdue tasks
fn tasks --due-today # Due today
fn tasks --due-this-week # Due within 7 days
fn tasks --priority high # High priority
fn tasks --note "Project" # Tasks in a specific note
fn tasks --status in-progress # Filter by 4-state status
fn tasks --status cancelled # Cancelled tasks
fn tasks --project home/garden # Tasks belonging to a project
| Option | Description |
|---|---|
--status <status> |
Filter by status: not-started, in-progress, done, cancelled |
--project <name> |
Tasks belonging to this project — exact name, case-insensitive. Includes tasks that inherit the project from their note's #projects/ tag, not just those with an explicit project: label. |
--priority <level> |
Filter by priority: high, medium, low |
--due-today |
Due today |
--due-this-week |
Due within 7 days |
--overdue |
Past due |
--note <title> |
Tasks in a specific note |
--all |
Include done and cancelled tasks (default shows only active) |
fn tasks add#
fn tasks add "Review draft" --note "Project Plan"
fn tasks add "Submit report" --note "Work" --due 2026-04-15 --priority high
fn tasks add "Order topsoil" --note "Garden" --project home/garden
| Option | Description |
|---|---|
--note <title> |
Note to append the task to |
--due <date> |
Due date (e.g. 2026-04-15, today, next monday) |
--priority <level> |
high, medium, or low |
--project <name> |
Label the task with a project. Writes the collection's configured keyword (project: by default). |
Exact-match filtering, not substring
--project home matches the project home exactly — it does not match home/garden or my-home-lab. To pull in a project's sub-projects, use the "is under" operator in a saved query or database view instead.
fn tasks set#
Amend an existing task's metadata (matches by text substring).
fn tasks set "Review draft" --note "Project Plan" --due "next friday"
fn tasks set "Review draft" --note "Project Plan" --priority high --project release
fn tasks set "Review draft" --note "Project Plan" --clear-due --clear-priority
| Option | Description |
|---|---|
--note <title> |
Note containing the task (required) |
--due <date> / --clear-due |
Set or remove the due date |
--priority <level> / --clear-priority |
Set or remove the priority |
--project <name> / --clear-project |
Set or remove the project |
fn tasks remove#
Delete a task line from a note.
Task state transitions#
Each moves a task to a different state in the 4-state model. All take --note to disambiguate, and match the task by text substring.
fn tasks complete "Review draft" --note "Project Plan" # → done
fn tasks progress "Review draft" --note "Project Plan" # → in-progress
fn tasks cancel "Review draft" --note "Project Plan" # → cancelled
fn tasks reset "Review draft" --note "Project Plan" # → not-started
fn tasks projects#
List every project with its task counts (active / in-progress / done / cancelled / overdue). Reads the cache; project identity is case-insensitive and alias-aware (recognises the collection's current and previous project keywords).
fn notifications#
Show notification settings and upcoming task reminders.
fn backlinks#
fn search#
fn search "meeting agenda"
fn search "TODO" --context 2
fn search "\\d{4}-\\d{2}-\\d{2}" --regex
fn search "deploy" --tag project --limit 10
fn search "ideas" --titles-only
| Option | Description |
|---|---|
--context <n> |
Lines around each match |
--titles-only |
Search titles only |
--regex |
Regular expression mode |
--tag <tag> |
Filter by tag |
--include-subtags |
Also match sub-tags of --tag |
--limit <n> |
Maximum matching notes |
fn open#
fn bind#
Assemble a manuscript from a manual-sort tag (every note under it, in order) or a single book note, and export it as PDF, DOCX, EPUB, or HTML.
fn bind --tag novel --output novel.pdf
fn bind --book "My Book" --format epub
fn bind --tag novel --format docx --author "Jane Doe" --style paperback
| Option | Description |
|---|---|
--tag <tag> |
Leaf manual-sort tag — binds every note under it, in order |
--book <title> |
A single book note instead of a tag |
--output <path> |
Output file (default: <source-name>.<ext>) |
--format <fmt> |
pdf, docx, epub, or html (inferred from --output if omitted) |
--author <name> |
Author name for headers / title page |
--style <preset> |
standard (default), paperback, or plain |
--spec-file <path> |
JSON spec for full typesetting control (overrides the preset) |
fn bind has an extensive typography surface (page geometry, headings, headers/footers). Run fn bind --help for the complete list. PDF export is CLI-only — the sandboxed app delegates it to fn.
fn projects#
Collection-wide project refactoring. (List projects with task counts via fn tasks projects.)
fn projects rename home casa # rename across every note
fn projects rename home casa --include-subtree # also home/garden → casa/garden
fn projects strip home # remove all #projects/home tags + project:home keywords
Both operations are alias-aware (they match every previous/canonical project word and write the current one), skip code blocks, preserve front matter, and only rewrite notes that actually change.
fn attachments#
Inspect and clean up the collection's images (.attachments/).
fn attachments # list images with size + reference count
fn attachments list --json
fn attachments orphans # only images no note references
fn attachments prune # dry-run: show what would be deleted
fn attachments prune --force # actually delete orphaned images
prune never deletes without --force.
fn query#
Run the smart-views you built in the app, headlessly.
fn query list # list saved queries (.queries/)
fn query run "Overdue by project" # run one — lists the matching notes
fn query run "Due This Week" --json --limit 20
fn query run evaluates the saved query's rules against your notes and returns the matches in the same shape as fn list (so --json works for scripting). Query names accept an unambiguous prefix.
fn import#
Bulk-import .md / .txt files from a folder as notes (each file's name becomes the title; foreign front matter is stripped).
fn import ~/Desktop/notes
fn import ~/Desktop/notes --tag imported --recursive
fn import ~/Desktop/notes --dry-run
| Option | Description |
|---|---|
--tag <tag> |
Tag to add to every imported note (repeatable) |
--recursive |
Recurse into subdirectories |
--dry-run |
List what would be imported without writing |
Date Formats#
All date arguments accept:
| Format | Example |
|---|---|
| ISO date | 2026-04-15 |
| Compact | 20260415 |
| Named | today, yesterday, tomorrow |
| Relative | next monday, last friday |
| Natural language | in 3 days, March 15th |
Exit Codes#
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Note not found |
| 3 | Collection not found |
| 4 | Write failed |
| 5 | Invalid front matter |
| 6 | Duplicate title |
| 7 | Property validation failed |
| 8 | Unlicensed (a write or export action needs a valid license) |
With --json, errors are emitted as {"error": "<code>", "message": "…"} (e.g. "error": "unlicensed") for reliable scripting.