Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xwmx/nb/llms.txt
Use this file to discover all available pages before exploring further.
nb stores every note as a plain file inside a Git-tracked directory, so your data is always portable and never locked in a proprietary format. Notes are Markdown by default, but you can use any file type you like — from Org and LaTeX to JavaScript snippets and AsciiDoc documents. All the standard operations — adding, listing, editing, viewing, and deleting — are available from a single, consistent command-line interface that works the same way whether you are using a local notebook or syncing to a remote.
Adding Notes
Usenb add (shortcuts: nb a, nb +) to create new notes. With no arguments, nb add opens a blank file in your $EDITOR. Pass a string to create a note immediately without opening the editor.
Titles, Content, and Filenames
The--title (-t) option sets the note title and derives the filename from it automatically:
--content (-c) to supply content inline, and combine it with piped input and a title argument for multi-source notes:
Tags
Add #hashtags with--tags <tag1>,<tag2>.... Tags are inserted between the title and body:
File Types
nb defaults to .md (Markdown). Change the type with a filename extension, a bare extension, or --type:
Encryption
Pass--encrypt (-e) to create a password-protected note encrypted with AES-256 (OpenSSL) or GPG:
nb prompts for the password transparently whenever the note is viewed or edited, then re-encrypts it automatically after editing.
Templates
Base a new note on a template string or file with--template:
{{title}}, {{tags}}, {{content}}, {{date}} (and date format options such as {{date +"%Y-%m-%d"}}).
Set a default template in ~/.nbrc:
nb add --no-template to skip the default template for a single command.
Shortcut Aliases
| Command | Aliases |
|---|---|
nb add | nb a, nb +, nb create, nb new |
Listing and Filtering Notes
Runnb or nb ls to list notes in the current notebook. The notebook header appears above the list and a helpful footer with example commands appears below.
# h1 title, YAML front matter title: field, or an Org/LaTeX/AsciiDoc title declaration, that title is shown instead of the filename.
Filtering by Title or Filename
Pass a string to filter the list. Single words fuzzy-match; quoted phrases match exactly; multiple words act as anOR filter:
Filter by Tags
Escape or quote the# when filtering by hashtag, or use --tags:
Excerpts, Sorting, and Limits
- Excerpts
- Sorting
- Limits
- Pagination
nb -sre 2 is equivalent to nb --sort --reverse --excerpt 2.
Filter by Type
nb list vs nb ls
nb ls combines the notebook header with a limited list (default 15 items). nb list shows only notes — no notebook header — and has no default limit:
Editing Notes
Open a note in$EDITOR with nb edit (shortcut: nb e). You can identify notes by id, filename, or title:
nb 3 edit or nb example:12 e.
Appending, Prepending, and Overwriting
When content is supplied via--content or pipe, nb edit appends without opening the editor:
--edit to any of the above to still open the editor before committing.
When a note is encrypted,
nb edit decrypts it in a temporary file, opens your editor, then re-encrypts the note automatically when you save and quit.Viewing Notes
Usenb show (shortcut: nb s) to view a note. By default, notes open in less with syntax highlighting (if bat, highlight, or Pygments is installed):
Output Options
Getting Metadata
Deleting Notes
Pass any number of ids, filenames, or titles tonb delete (shortcuts: nb d, nb -). A confirmation prompt is shown by default:
Moving and Renaming Notes
Usenb move (aliases: nb rename, nb mv) to move or rename a note:
Copying Notes
Usenb copy (alias: nb duplicate) to copy a note to a new location or duplicate it in place:
Quick Reference
Add
nb add, nb a, nb +, nb create, nb newEdit
nb edit, nb eShow
nb show, nb s, nb viewDelete
nb delete, nb d, nb -