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.

Tags are one of the most flexible organizational tools in nb. Rather than forcing a rigid taxonomy, tags let you label and cross-reference notes, bookmarks, and todos using plain #hashtag syntax that lives right inside your documents. Because tags are just text, they travel with your files in Git and remain readable in any editor — no proprietary metadata required.

How Tags Work

Tags in nb are written as #hashtags and can be placed anywhere in a document. A valid hashtag is a # character followed by any combination of letters, numbers, underscores, or dashes. Tags integrate naturally with nb browse, where they are rendered as clickable links that filter to all items sharing that tag.
Tags placed via --tags are automatically formatted as #hashtags in the document. You can also write #tags directly into your note content by hand.

Adding Tags at Creation

The --tags option is available when creating notes, bookmarks, and todos. It accepts a comma-separated list of tag names and inserts them as #hashtags in the new document.
# add a note with a title and two tags
nb add --title "Example Title" "Example note content." --tags tag1,tag2
Tags are inserted between the title and the body:
# Example Title

#tag1 #tag2

Example note content.

Inline Hashtags

You can write #hashtags directly anywhere inside a note’s content without using --tags. nb recognizes any #word as a tag when listing and searching, and nb browse renders all inline hashtags as clickable filter links.
# Meeting Notes

#project/design #weekly

Discussed the new component library and deployment timeline.

Nested Tags

nb supports hierarchical tags using slash-separated segments, such as #project/design/ui. Nested tags let you build a parent-child taxonomy without needing separate notebooks or folders. Searching for a parent prefix matches all descendants:
QueryMatches
#project#project, #project/design, #project/design/ui
#project/design#project/design, #project/design/ui
#project/design/ui#project/design/ui only
#project/uinothing (branch does not exist)
# create a note tagged with a nested tag
nb add --title "UI Spec" --tags "project/design/ui" "Component spacing rules."

Listing Items by Tag

Pass a #hashtag (escaped or quoted) directly to nb / nb ls to list matching items, or use the --tags option:
# list items tagged with #tag1, escaped
nb \#tag1

# list items tagged with #tag2 in the "example" notebook, quoted
nb example: "#tag2"

# list items tagged with #tag3 across all notebooks
nb --tags tag3 --all
nb --tags tag3 -a
Combine multiple tags to filter items that contain all specified tags:
# items tagged with #tag1 AND #tag2
nb \#tag1 "#tag2"

# items tagged with #tag2 AND #tag3, using --tags option
nb --tags tag2,tag3

# items in all notebooks tagged with all four tags
nb \#tag1 "#tag2" --tags tag3,tag4 --all

Listing All Tags

Use --tags on nb ls or nb list to display every tag present in a notebook, folder, or individual item:
# list all tags in the current notebook
nb --tags

# list all tags in the folder named "example"
nb example/ --tags

# list all tags on a specific item (id 123 in the "sample" notebook)
nb sample:123 --tags

Searching by Tag

Use nb search (shortcut nb q) for richer tag queries, including AND and OR logic:
# search for items tagged #tag1
nb search --tag tag1
nb q -t tag1
nb q \#tag1

# search for items tagged #tag1 AND #tag2
nb q --tag tag1 --tag tag2
nb q -t tag1 -t tag2
nb q \#tag1 \#tag2
nb q --tags tag1,tag2

# search for items tagged #tag1 OR #tag2
nb q -t tag1 --or -t tag2
nb q \#tag1 --or \#tag2
nb q "#tag1|#tag2"

# search for #tag1 AND #tag2 AND #tag3
nb q -t tag1 --tags tag2,tag3

# search for #tag1 OR #tag2 OR #tag3
nb q -t tag1 --or --tags tag2,tag3
Append --all (or -a) to any tag listing or search command to search across every notebook:
# list all items tagged #tag3 across all notebooks
nb --tags tag3 --all

# search for #tag1 across all notebooks
nb q -t tag1 --all

Browsing Tags

When viewing notes in nb browse, every #hashtag is rendered as a clickable link that opens a filtered list of all items in the current notebook sharing that tag. Use the --tag / -t option with nb browse to open directly to a tag-filtered view:
# open browser to items tagged #tag2 in the "example" notebook
nb browse example: --tag tag2

# shortcut alias and short option
nb b example: -t tag2
The filtered browser view looks like:
❯nb · example

search: [#tag2               ]

[example:321] Example Title
[example:654] Sample Title
[example:789] Demo Title
Tag browsing pairs naturally with [[wiki-style links]]. Together they let you navigate your notes by both topic (tags) and explicit relationships (links) entirely within a terminal browser.

Combining Tags with Other Filters

Tags can be combined with notebook selectors, folder paths, and text queries in most nb commands:
# list items in the "work" folder tagged #urgent
nb work/ \#urgent

# search for "deadline" in items tagged #project across all notebooks
nb q "deadline" -t project --all

# open the browser to a folder filtered by tag
nb browse work/ --tag urgent

Build docs developers (and LLMs) love