Expand description
Typed Rust interface to the nb note-taking CLI.
Handles notebook qualification, escaping, and output parsing.
Wraps the nb CLI as a subprocess, providing async methods for
all note-taking operations.
Structs§
Enums§
- Edit
Mode - Behavior mode for
nb editcontent updates. - NbError
- Errors from nb CLI invocation.
- Search
Mode - Matching mode for
nb searchquery terms. - Task
Status - Status filter for
nb tasks.
Functions§
- derive_
git_ notebook_ name - Derive the notebook name from the current Git repository.
- git_
rev_ parse - Run
git rev-parsewith the given arguments and return the output as a path. - leaked_
git_ names - Returns the names of every environment variable in the current
process whose name starts with
GIT_. Exposed so other call sites (a futurestd::process::Commandvariant ingit_env, or any caller that wants the list without the scrub) share one enumeration policy. - scrub_
git_ env - Removes every environment variable whose name starts with
GIT_from the given tokioCommand’s environment. The spawned process inherits every other variable from the parent (PATH, HOME, LANG, …), just not the ones that redirect Git’s view of the repository. - scrub_
git_ env_ std - Synchronous-
Commandvariant ofscrub_git_env. nb-api usestokio::process::Commandfor everynbinvocation, butgit_rev_parse(the only directgitspawn) usesstd::process::Command. Both spawn sites must be scrubbed; if a future helper spawns git synchronously, use this overload.