Skip to main content

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.

Three commands form the core read-modify-remove loop in nb: edit opens an item for interactive or programmatic modification, show displays or queries item metadata, and delete permanently removes one or more items. All three accept the same flexible selector format — numeric ID, filename, title, or a fully-qualified notebook:folder/id path.

nb edit

Open a note in $EDITOR, or append, prepend, or overwrite its content programmatically without ever leaving the terminal.

Usage

nb edit ([<notebook>:][<folder-path>/][<id> | <filename> | <title>])
        [-c <content> | --content <content>] [--edit]
        [-e <editor> | --editor <editor>] [-l | --last] [--overwrite]
        [--prepend]

Options

-c, --content <content>
string
Append <content> to the file without opening the editor. Useful for quick updates or scripted edits. Combine with --edit to also open the editor after appending.
--overwrite
flag
Replace the entire file content with the value passed to --content or received on stdin, instead of appending.
--prepend
flag
Insert <content> or stdin before existing file content, rather than appending.
-e, --editor <editor>
string
Open the note with a specific editor, overriding the $EDITOR environment variable for this invocation.
-l, --last
flag
Edit the most recently modified item in the current notebook, without needing to specify an identifier.
--edit
flag
Open the note in $EDITOR even when content is supplied via --content or stdin. Without this flag, piped or --content input is appended silently.

Shortcut Alias

nb e <identifier>

Examples

# Open note 3 in $EDITOR
nb edit 3

# Open by filename
nb edit example.md

# Open by title
nb edit "A Document Title"

# Open note 12 in the "example" notebook
nb edit example:12

# Open using the shortcut alias
nb e 3
nb 3 e
Non-text files (images, PDFs, etc.) are opened using your system’s preferred application for that file type rather than a text editor.

nb show

Display a note in the pager, print it to stdout, render it to HTML, or query specific metadata fields without opening the full content.

Usage

nb show ([<notebook>:][<folder-path>/][<id> | <filename> | <title>])
        [[-a | --added] | [--authors] | [-b | --browse] | --filename | --id |
        --info-line | --path | [-p | --print] | --relative-path | [-r |
        --render] | --title | --type [<type>] | [-u | --updated]] [--no-color]
nb show <notebook>

Options

-p, --print
flag
Print the note content directly to stdout instead of opening it in the pager (less or $PAGER).
-r, --render
flag
Use Pandoc to convert the note to HTML and display it in a terminal web browser (w3m or links). Ignored if neither Pandoc nor a browser is available.
--path
flag
Print the full filesystem path of the item.
--relative-path
flag
Print the item’s path relative to the notebook root.
--filename
flag
Print the filename of the item.
--title
flag
Print the title of the item.
--id
flag
Print the numeric id of the item.
--info-line
flag
Print the id, filename, and title on one line — the same format used in listings.
-a, --added
flag
Print the date and time when the item was first added.
-u, --updated
flag
Print the date and time of the last recorded change.
--authors
flag
List the git commit authors who have contributed to the item.
--type [<type>]
string
Print the file extension. When <type> is provided, returns success (exit 0) if the item matches that type, error (exit 1) if not. Accepted types: archive, audio, bookmark, document, folder, image, text, video, or a file extension.
-b, --browse
flag
Open the item using nb browse in a terminal web browser.
--no-color
flag
Show the item without syntax highlighting.

Shortcut Alias

nb s <identifier>

Examples

# Open note 1 in the pager
nb show 1

# Print note content to stdout
nb show example.md --print

# Print without color highlighting
nb show "A Document Title" --print --no-color

# Render Markdown to HTML in terminal browser
nb show example.md --render

# Use the shortcut alias
nb s 1
nb 1 s
nb s example:12
Use nb show --path in scripts to get the absolute path of a note for use with external tools: cat "$(nb show 3 --path)".

nb delete

Permanently remove one or more items. By default, nb delete prompts for confirmation before removing anything.

Usage

nb delete ([<notebook>:][<folder-path>/][<id> | <filename> | <title>])...
          [-f | --force]

Options

-f, --force
flag
Skip the confirmation prompt and delete immediately. Required for non-interactive or scripted use.

Shortcut Aliases

nb d <identifier>
nb - <identifier>
Additional aliases: nb rm, nb trash

Examples

# Delete note 3 (prompts for confirmation)
nb delete 3

# Delete by filename
nb delete example.md

# Delete by title
nb delete "A Document Title"

# Delete without confirmation prompt
nb delete 3 --force
Deletion is permanent within the filesystem, but because every notebook is a git repository, you can recover deleted items with nb history and standard git tools (nb git log, nb git checkout).

nb move and nb copy

While not strictly viewing or editing commands, move and copy are the other two item-manipulation commands that complete the lifecycle alongside edit, show, and delete.

nb move

Move or rename an item, change its file type, or relocate it to another notebook or folder. nb rename is an alias.
nb move ([<notebook>:][<folder-path>/][<id> | <filename> | <title>])
        ([<notebook>:][<path>] | --reset | --to-bookmark | --to-note |
        --to-title | --to-todo) [-f | --force]
OptionEffect
--resetReset the filename to a last-modified timestamp
--to-bookmarkConvert to a bookmark (.bookmark.md extension)
--to-noteConvert a bookmark back to a plain Markdown note (.md)
--to-titleSet the filename from the note’s title
--to-todoConvert to a todo (.todo.md extension)
-f, --forceSkip the confirmation prompt
Shortcut alias: nb mv
# Rename "example.md" to "sample.org"
nb move example.md sample.org

# Rename note 3 to "New Name.md"
nb rename 3 "New Name"

# Change only the file extension of note 5 to .org
nb rename 5 .org

# Move note 12 into "Sample Folder" in the "demo" notebook
nb move example:12 demo:Sample\ Folder/

# Convert a bookmark to a plain note
nb rename 3 --to-note

# Convert note 3 to a todo
nb rename 3 --to-todo

nb copy

Duplicate an item in place or to another location. nb duplicate is an alias.
nb copy ([<notebook>:][<folder-path>/][<id> | <filename> | <title>])
        [[<notebook>:][<folder-path>/]<filename>]
# Duplicate item 321 in the current notebook
nb copy 321

# Copy item 456 to the "example" notebook
nb copy 456 example:

# Copy a file to a new location
nb copy sample/demo.md

Build docs developers (and LLMs) love