nb
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesenb - Command Line Note-Taking
nb - 命令行笔记管理工具
⚠️ IMPORTANT: Never edit files in nb git repos () by hand! Always use the~/.nb/*CLI to ensure proper indexing and Git commits.nb
A command line and local web note-taking, bookmarking, and archiving tool with plain text data storage, Git-backed versioning, and wiki-style linking.
⚠️ 重要提示: 请勿手动编辑nb git仓库()中的文件!请始终使用~/.nb/*CLI,以确保索引和Git提交正常进行。nb
这是一款命令行及本地网页版的笔记管理、书签收藏与归档工具,采用纯文本存储数据,支持Git版本控制,并具备维基式链接功能。
Quick Reference
快速参考
Notebooks
笔记本管理
bash
undefinedbash
undefinedList all notebooks
列出所有笔记本
nb notebooks
nb notebooks
Switch to a notebook
切换到指定笔记本
nb use <notebook>
nb use <notebook>
Create a new notebook
创建新笔记本
nb notebooks add <name>
nb notebooks add <name>
Show current notebook
查看当前使用的笔记本
nb notebooks current
undefinednb notebooks current
undefinedAdding Notes
添加笔记
bash
undefinedbash
undefinedAdd a note with title
添加带标题的笔记
nb add -t "Title" -c "Content here"
nb add -t "Title" -c "Content here"
Add note to specific notebook
向指定笔记本添加笔记
nb <notebook>: add -t "Title" -c "Content"
nb <notebook>: add -t "Title" -c "Content"
Add note with tags
添加带标签的笔记
nb add -t "Title" --tags tag1,tag2
nb add -t "Title" --tags tag1,tag2
Add note from file content
从文件导入笔记内容
nb add <notebook>:filename.md
undefinednb add <notebook>:filename.md
undefinedListing Notes
列出笔记
bash
undefinedbash
undefinedList notes in current notebook
列出当前笔记本中的笔记
nb list
nb list
List all notes (no limit)
列出所有笔记(无数量限制)
nb list -a
nb list -a
List notes in specific notebook
列出指定笔记本中的笔记
nb <notebook>: list
nb <notebook>: list
List with excerpts
列出笔记并显示摘要
nb list -e
nb list -e
List with tags shown
列出笔记并显示标签
nb list --tags
undefinednb list --tags
undefinedShowing Notes
查看笔记
bash
undefinedbash
undefinedShow note by ID or title
通过ID或标题查看笔记
nb show <id>
nb show "<title>"
nb show <id>
nb show "<title>"
Show note from specific notebook
查看指定笔记本中的笔记
nb show <notebook>:<id>
nb show <notebook>:<id>
Print content (for piping)
打印笔记内容(用于管道操作)
nb show <id> --print
undefinednb show <id> --print
undefinedSearching Notes
搜索笔记
bash
undefinedbash
undefinedSearch across all notebooks
在所有笔记本中搜索
nb search "query"
nb search "query"
Search in specific notebook
在指定笔记本中搜索
nb <notebook>: search "query"
nb <notebook>: search "query"
Search with AND/OR/NOT
使用AND/OR/NOT逻辑搜索
nb search "term1" --and "term2"
nb search "term1" --or "term2"
nb search "term1" --not "exclude"
nb search "term1" --and "term2"
nb search "term1" --or "term2"
nb search "term1" --not "exclude"
Search by tag
按标签搜索
nb search --tag "tagname"
undefinednb search --tag "tagname"
undefinedEditing Notes
编辑笔记
bash
undefinedbash
undefinedEdit by ID
通过ID编辑笔记
nb edit <id>
nb edit <id>
Edit by title
通过标题编辑笔记
nb edit "<title>"
nb edit "<title>"
Append content
追加内容
nb edit <id> -c "New content to append"
nb edit <id> -c "New content to append"
Prepend content
前置内容
nb edit <id> -c "Content at top" --prepend
nb edit <id> -c "Content at top" --prepend
Overwrite content
覆盖内容
nb edit <id> -c "Replace all" --overwrite
undefinednb edit <id> -c "Replace all" --overwrite
undefinedDeleting Notes
删除笔记
bash
undefinedbash
undefinedDelete by ID (will prompt)
通过ID删除笔记(会弹出确认提示)
nb delete <id>
nb delete <id>
Force delete without prompt
强制删除,不弹出确认提示
nb delete <id> -f
undefinednb delete <id> -f
undefinedMoving/Renaming
移动/重命名
bash
undefinedbash
undefinedMove note to another notebook
将笔记移动到另一个笔记本
nb move <id> <notebook>:
nb move <id> <notebook>:
Rename a note
重命名笔记
nb move <id> new-filename.md
undefinednb move <id> new-filename.md
undefinedTodos
待办事项
bash
undefinedbash
undefinedAdd a todo
添加待办事项
nb todo add "Task title"
nb todo add "Task title"
Add todo with due date
添加带截止日期的待办事项
nb todo add "Task" --due "2026-01-15"
nb todo add "Task" --due "2026-01-15"
List open todos
列出未完成的待办事项
nb todos open
nb todos open
List closed todos
列出已完成的待办事项
nb todos closed
nb todos closed
Mark todo as done
标记待办事项为已完成
nb todo do <id>
nb todo do <id>
Mark todo as not done
标记待办事项为未完成
nb todo undo <id>
undefinednb todo undo <id>
undefinedBookmarks
书签
bash
undefinedbash
undefinedAdd a bookmark
添加书签
nb bookmark <url>
nb bookmark <url>
Add with comment
添加带备注的书签
nb bookmark <url> -c "My comment"
nb bookmark <url> -c "My comment"
Add with tags
添加带标签的书签
nb bookmark <url> --tags reference,dev
nb bookmark <url> --tags reference,dev
List bookmarks
列出书签
nb bookmark list
nb bookmark list
Search bookmarks
搜索书签
nb bookmark search "query"
undefinednb bookmark search "query"
undefinedGit Operations
Git操作
bash
undefinedbash
undefinedSync with remote
与远程仓库同步
nb sync
nb sync
Create checkpoint (commit)
创建检查点(提交)
nb git checkpoint "Message"
nb git checkpoint "Message"
Check dirty status
查看未提交的更改状态
nb git dirty
nb git dirty
Run any git command
执行任意Git命令
nb git status
nb git log --oneline -5
undefinednb git status
nb git log --oneline -5
undefinedFolders
文件夹
bash
undefinedbash
undefinedAdd folder to notebook
向笔记本添加文件夹
nb folders add <folder-name>
nb folders add <folder-name>
List folders
列出文件夹
nb folders
nb folders
Add note to folder
向文件夹添加笔记
nb add <folder>/<filename>.md
undefinednb add <folder>/<filename>.md
undefinedCommon Patterns
常用操作模式
Adding Note with Full Content
添加完整内容的笔记
For longer notes, create a temp file and import:
bash
undefined对于较长的笔记,可先创建临时文件再导入:
bash
undefinedWrite content to temp file first, then copy to nb
先将内容写入临时文件,再复制到nb
cp /tmp/note.md ~/.nb/<notebook>/
cd ~/.nb/<notebook> && git add . && git commit -m "Add note"
nb <notebook>: index rebuild
undefinedcp /tmp/note.md ~/.nb/<notebook>/
cd ~/.nb/<notebook> && git add . && git commit -m "Add note"
nb <notebook>: index rebuild
undefinedSearching Across All
全局搜索
bash
undefinedbash
undefinedSearch everything
搜索所有内容
nb search "term" --all
nb search "term" --all
Search by type
按类型搜索
nb search "term" --type bookmark
nb search "term" --type todo
undefinednb search "term" --type bookmark
nb search "term" --type todo
undefinedData Location
数据存储位置
Notes are stored in as markdown files with Git versioning.
~/.nb/<notebook>/~/.nb/
├── notebook-name-1/ # Your first notebook
├── notebook-name-2/ # Your second notebook
└── ...笔记以Markdown文件形式存储在目录下,并通过Git进行版本控制。
~/.nb/<notebook>/~/.nb/
├── notebook-name-1/ # 你的第一个笔记本
├── notebook-name-2/ # 你的第二个笔记本
└── ...Tips
小贴士
- Use prefix to work with specific notebooks
nb <notebook>: - IDs are numbers shown in
nb list - Titles can be used instead of IDs (quoted if spaces)
- All changes are automatically Git-committed
- Use to push/pull from remote repos
nb sync
- 使用前缀操作指定笔记本
nb <notebook>: - ID是命令中显示的数字
nb list - 可使用标题替代ID(含空格时需加引号)
- 所有更改会自动提交到Git
- 使用与远程仓库进行推送/拉取操作
nb sync