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.

nb add is the primary command for creating new content. It can open an interactive editor for freeform writing, accept content directly from the command line or via stdin, and create specialized items like bookmarks, todos, and nested folders — all within any notebook or subfolder path.

Usage

nb add [<notebook>:][<folder-path>/][<filename>] [<content>]
       [-b | --browse] [-c <content> | --content <content>] [--edit]
       [-e | --encrypt] [-f <filename> | --filename <filename>]
       [--folder <folder-path>] [--no-template] [--tags <tag1>,<tag2>...]
       [--template <template>] [-t <title> | --title <title>] [--type <type>]
nb add bookmark [<bookmark-options>...]
nb add folder [<name>]
nb add todo [<todo-options>...]

Options

<content>
string
A non-option argument without a file extension is treated as inline note content. nb creates the note immediately without opening the editor. If the argument has a file extension, it is treated as a filename instead.
-c, --content <content>
string
Provide note content as a flag value. Content is written to the file without opening the editor (use --edit to also open the editor).
-t, --title <title>
string
Set the note title. When --title is present the filename is derived from the title (spaces replaced with underscores) unless --filename is also specified.
-f, --filename <filename>
string
Set an explicit filename, including extension, for the new note. Overrides the title-derived filename.
--type <type>
string
Set the file type for the new note by specifying a file extension (md, org, rst, txt, js, etc.). Overrides the default extension set by nb set default_extension.
--folder <folder-path>
string
Create the note inside the folder at <folder-path>. The folder must already exist, or use nb add folder to create it first.
-e, --encrypt
flag
Encrypt the note with a password using AES-256 via OpenSSL (default) or GPG if configured with nb set encryption_tool. You will be prompted for a password.
--tags <tag1>,<tag2>...
string
Add a comma-separated list of hashtags to the note. Tags are written as #tag inside the note content.
--template <template>
string
Pre-fill the new note using a template. Accepts either an inline template string or a path to a template file.
--no-template
flag
Skip the default template when one has been assigned for the notebook or folder.
--edit
flag
Open the note in $EDITOR even when content is provided via --content, a positional argument, or stdin. Useful for reviewing or expanding piped content before saving.
-b, --browse
flag
Open the add form in a terminal or GUI web browser via nb browse. Useful for adding notes with richer formatting through the browser interface.

Shortcut Aliases

nb add can be called with several aliases:
nb a          # shortcut
nb +          # symbolic alias
nb new        # alias
nb create     # alias

Examples

# Open $EDITOR to write a new blank Markdown note
nb add

# Create a note with inline content (no editor opened)
nb add "This is my note content."

# Create a note from a specific filename
nb add example.md

# Pipe content into a new note
echo "Note content." | nb add

Specialized nb add Subcommands

nb add bookmark

Create a new bookmark. This is a shortcut for nb bookmark <url>. See the bookmark subcommand for all available bookmark options:
nb add bookmark https://example.com
nb add bookmark https://example.com --tags research,reference

nb add folder

Create a new folder (directory) within the current notebook or a specified path:
# Create a folder named "projects" in the current notebook
nb add folder projects

# Equivalent using the full subcommand
nb folders add projects

# Create a nested folder
nb add folder sample/demo
You can also create a folder by including a trailing slash in the path when adding a note: nb add projects/note.md will use the projects folder if it exists.

nb add todo

Create a new todo item. This is a shortcut for nb todo add:
nb add todo "Write documentation"
nb add todo "Review PR" --tags urgent --due "2024-12-31"

How nb Chooses the Filename

1

Explicit filename wins

If --filename is provided, that value is used as-is (including the extension).
2

Title derives the filename

If --title is given without --filename, the filename is built from the title with spaces and special characters replaced by underscores, using the default extension.
3

Default extension applies

If neither is given, nb generates a timestamp-based filename using the default extension (md unless changed via nb set default_extension).
4

Type overrides the extension

--type <ext> replaces the extension in all of the above cases.

Encryption Details

When -e / --encrypt is used, nb encrypts the note with AES-256 using OpenSSL by default. To switch to GPG, run nb set encryption_tool gpg. Encrypted files carry the .enc extension and require the correct password for all future edit, show, and export operations.

Build docs developers (and LLMs) love