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
Options
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.Provide note content as a flag value. Content is written to the file without opening the editor (use
--edit to also open the editor).Set the note title. When
--title is present the filename is derived from the title (spaces replaced with underscores) unless --filename is also specified.Set an explicit filename, including extension, for the new note. Overrides the title-derived filename.
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.Create the note inside the folder at
<folder-path>. The folder must already exist, or use nb add folder to create it first.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.Add a comma-separated list of hashtags to the note. Tags are written as
#tag inside the note content.Pre-fill the new note using a template. Accepts either an inline template string or a path to a template file.
Skip the default template when one has been assigned for the notebook or folder.
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.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:
Examples
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 folder
Create a new folder (directory) within the current notebook or a specified path:
nb add todo
Create a new todo item. This is a shortcut for nb todo add:
How nb Chooses the Filename
Explicit filename wins
If
--filename is provided, that value is used as-is (including the extension).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.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).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.