LinuxCommandLibrary

nb

Open URLs in your browser

SYNOPSIS


nb [-h|--help] [-v|--version] <command> [arguments...]
Example usage:
nb new "My new project ideas"
nb list -t work,todo
nb search "important function"

PARAMETERS

-h, --help
    Displays help information for the nb command or a specific subcommand.
Usage: nb help <command> or nb <command> --help

-v, --version
    Prints the version number of the nb utility.

DESCRIPTION

nb is a minimalist command-line utility designed for efficient management of personal notes and code snippets. It leverages the power of Git, storing all notes as plain text files within a local Git repository. This design provides built-in version control, easy synchronization across devices, and robust backup capabilities. Users can create, edit, list, search, and delete notes directly from the terminal, making it ideal for developers, writers, or anyone who frequently works in a command-line environment. Its features include support for tags for better organization, powerful search capabilities using grep, and seamless integration with your preferred text editor via the $EDITOR environment variable. nb embodies the Unix philosophy, focusing on simplicity, plain text, and composability with other tools.

CAVEATS

* Requires Git to be installed and configured on your system, as it relies heavily on Git for note storage, versioning, and synchronization.
* Notes are stored as plain text files, typically Markdown, within a local Git repository. While flexible, this means rich text formatting is dependent on your viewer/editor.
* The new and edit commands depend on the $EDITOR environment variable being set to your preferred text editor (e.g., vim, nano, code --wait).
* Primarily designed for Unix-like operating systems (Linux, macOS).

KEY COMMANDS

nb operates primarily through subcommands, each performing a specific action:
new [title]: Creates a new note. If a title is provided, it's used; otherwise, a timestamp is used. Opens the note in $EDITOR.
edit <query>: Opens an existing note matching the query in $EDITOR.
list [-t <tags>] [-l <limit>]: Lists notes, optionally filtered by tags or limited in number.
search <query> [-t <tags>]: Searches note content and titles for the given query.
tags: Lists all unique tags used across your notes.
show <query>: Displays the content of a note directly in the terminal.
delete <query>: Deletes a note matching the query.
sync: Pushes and pulls changes to/from the remote Git repository, synchronizing your notes.

CONFIGURATION

The primary configuration for nb is done via environment variables:
NB_PATH: Specifies the directory where your nb Git repository is located. Defaults to ~/.nb.
$EDITOR: Used by new and edit commands to determine which text editor to open notes with (e.g., export EDITOR=vim).
For Git synchronization, ensure your NB_PATH directory is initialized as a Git repository and has a remote configured.

HISTORY

The nb command-line notebook tool was created by xwmx with the aim of providing a simple, robust, and Git-backed solution for managing notes from the terminal. Its development began around 2017, focusing on adherence to the Unix philosophy: do one thing well, work with plain text, and compose well with other tools. The design emphasizes speed, ease of use, and leveraging existing, powerful tools like Git and standard text editors rather than reinventing core functionalities. It has seen continuous development and maintenance, building a small but dedicated community of users who appreciate its minimalist approach and reliability.

SEE ALSO

git(1): Essential for version control and synchronization., vim(1) or nano(1): Common text editors used with nb., grep(1): Utilized by nb for powerful text searching within notes., t(1) (todo.txt-cli): Another command-line tool for task management, similar in philosophy., jrnl(1): A simple command-line journal application.

Copied to clipboard