Use this file to discover all available pages before exploring further.
Selectors are structured addresses used throughout nb to identify notebooks, folders, and items. Every nb subcommand that targets a specific item, folder, or notebook accepts a selector as its argument — from nb show and nb edit to nb move and nb delete. Mastering the selector syntax unlocks nb’s full composability.
Notebooks are identified by their name followed by a colon (:). When the selector is only a notebook name and colon — with no folder path or item identifier — the command runs in the root folder of that notebook:
# list items in the "example" notebooknb example:# add a new note named "Example Title" to the "example" notebooknb add example: --title "Example Title"# edit item with id "123" in the notebook "example"nb edit example:123
A notebook selector can also be combined with a subcommand name to run the command within that notebook:
# list all items in the "example" notebook and display excerptsnb example:list -e# edit item with id "123" in the "example" notebooknb example:edit 123# show the git history for the notebook named "example"nb example:history
Folders are identified by their relative path from the notebook root. A trailing slash signals that the command should operate on the contents of the folder. Without the trailing slash, the selector refers to the folder item itself:
❯ nb list sample[1] 📂 sample❯ nb list sample/[sample/3] Title Three[sample/2] Title Two[sample/1] Title One
Folder path segments can use either names or ids, and they can be mixed freely:
# list items in "sample/demo/"nb sample/demo/# add a new item to the folder named "demo" inside the folder with id "3"nb add 3/demo/# show history for folder id "4" inside "sample/" in the "example" notebooknb history example:sample/4/
Use a trailing slash (folder/) to address folder contents, and omit it to address the folder item itself.
# edit item with id "123"nb edit 123# show item with id "123" in the "example" notebooknb show example:123# show item with id "123" in the "folder/" of "example"nb show example:folder/123
# open an item by title in the current notebooknb open "Example Title"# open an item by title in the "example" notebooknb open notebook:"Example Title"# open the item titled "demo title" in the folder with id "3"nb open 3/demo\ title
Path segments can mix names and numeric ids at any level of nesting:
# reference folder by id "3" then folder named "demo"nb add 3/demo/# reference "sample" by name then folder by id "4" inside "example" notebooknb history example:sample/4/