Use this file to discover all available pages before exploring further.
nb has a lightweight plugin system that lets you add new subcommands, color themes, or any other shell-based functionality without touching the core script. Plugins are plain Bash files that live in a single directory, and they can be installed from a URL or a local path in one command.
Use nb plugins install with a URL or a local file path:
# install a plugin from a raw GitHub URLnb plugins install https://raw.githubusercontent.com/xwmx/nb/master/plugins/clip.nb-plugin# install a plugin from a standard GitHub URLnb plugins install https://github.com/xwmx/nb/blob/master/plugins/example.nb-plugin# install a theme from a standard GitHub URLnb plugins install https://github.com/xwmx/nb/blob/master/plugins/turquoise.nb-theme# install a plugin from a local pathnb plugins install plugins/example.nb-plugin
nb accepts both raw GitHub URLs and standard GitHub page URLs — they can be used interchangeably.
# list plugin filenamesnb plugins# list a specific pluginnb plugins clip.nb-plugin# list plugins with full pathsnb plugins --paths# list the path to a specific pluginnb plugins turquoise.nb-theme --paths
Example output:
❯ nb pluginsclip.nb-pluginexample.nb-pluginturquoise.nb-theme❯ nb plugins --paths/home/example/.nb/.plugins/clip.nb-plugin/home/example/.nb/.plugins/example.nb-plugin/home/example/.nb/.plugins/turquoise.nb-theme
The nb API is the command line interface itself. Inside a plugin, call any internal subcommand by its underscore-prefixed function name instead of spawning a new nb process. Options designed for machine-readable output (--no-color, --filenames, etc.) make it easy to parse results in scripts:
# print the content of note 3 with no color_show 3 --print --no-color# list all unarchived global notebook names_notebooks --names --no-color --unarchived --global# list all filenames in the current notebook_list --filenames --no-id --no-indicator# print the path to the current notebook_notebooks current --path
nb automatically scans arguments for selectors (e.g., notebook:id) and updates the current notebook context when a valid one is found. Use _show <selector> --filename to resolve a selector to a filename:
_example() { local _selector="${1:-}" [[ -z "${_selector:-}" ]] && printf "Usage: example <selector>\n" && exit 1 # Resolve the selector to a filename local _filename= _filename="$(_show "${_selector}" --filename)" # Get the current notebook path local _notebook_path= _notebook_path="$(_notebooks current --path)" # Print the file contents cat "${_notebook_path}/${_filename}"}