📝
简介
基于 Dnote CLI 的本地优先笔记管理工具,支持离线知识库构建、全文检索与跨设备同步,数据完全自主可控
原始描述
Save, retrieve, and manage notes using Dnote CLI. Use when the user wants to capture information, search existing notes, reference saved knowledge, or organi...
中文使用说明 来自收录源
Dnote:极简 CLI 知识管理工具
核心用法
Dnote 是一款专为开发者设计的命令行笔记工具,采用"本地优先"架构,无需注册即可离线使用。通过 dnote add <book> <content> 快速将命令片段、代码技巧、灵感想法存入分类笔记本(books),支持管道输入实现自动化采集。全文检索 dnote find <query> 可秒级定位历史笔记,view/get/export 等多维度检索满足不同场景需求。
显著优点
- 隐私优先:SQLite 本地存储,数据不上传即可完整运行,支持可选加密同步
- 开发者友好:纯文本存储、Unix 哲学设计、完美兼容 Shell 管道与脚本自动化
- 检索高效:基于 SQLite FTS 的全文搜索,毫秒级响应海量笔记
- 零配置启动:自动遵循 XDG 规范,一条命令即可开始记录
- 跨平台:支持 macOS/Linux/Windows,同步服务端开源可自建
潜在局限
- 界面极简:无 GUI,纯 CLI 交互对非技术用户门槛较高
- 富媒体受限:不支持图片、附件存储,适合文本/代码片段
- 协作缺失:无团队共享、权限管理功能,纯个人知识库场景
- 移动端薄弱:官方 App 功能较基础,重度依赖桌面终端
- 生态封闭:导入导出格式有限,迁移至 Notion/Obisdian 需转换
适合人群
- 终端常驻开发者:需要快速捕获 Shell 命令、API 用法、配置片段
- 隐私敏感用户:拒绝云端笔记的数据监控与账号体系
- 效率工具极简主义者:厌恶 Evernote/Notion 的臃肿与网络依赖
- 技术内容创作者:积累可搜索的代码案例库与写作素材
常规风险
- 数据备份:默认仅本地存储,需手动配置
dnote sync或定期导出 JSON - 误删恢复:
remove操作无二次确认且无回收站,建议配合 Git 备份~/.local/share/dnote/ - 同步冲突:多设备离线编辑后同步可能产生冲突,需手动处理
- API 密钥安全:若启用云端同步,
DNOTE_API_KEY需妥善保管避免泄露
技能正文
name: dnote description: Save, retrieve, and manage notes using Dnote CLI. Use when the user wants to capture information, search existing notes, reference saved knowledge, or organize notes into books. Supports adding notes, searching with full-text, viewing books/notes, editing, and removing notes. Perfect for building a personal knowledge base. metadata: openclaw: emoji: '📝' homepage: https://www.getdnote.com/docs/cli/ requires: bins: - dnote primaryEnv: DNOTE_API_KEY
Dnote Notes
Manage a personal knowledge base using Dnote CLI.
Setup
Installation
# macOS/Linux auto-install
curl -s https://www.getdnote.com/install | sh
# Or Homebrew
brew install dnote
# Or download from: https://github.com/dnote/dnote/releases
Configuration
Dnote follows XDG directories:
- Config:
~/.config/dnote/dnoterc - Database:
~/.local/share/dnote/dnote.db
# Example config file (~/.config/dnote/dnoterc)
editor: vim
apiEndpoint: https://api.dnote.io
enableUpgradeCheck: true
# Or use local-only (no sync)
# No config needed - works offline by default
Sync Setup (Optional)
# To sync across devices
dnote login
# Or local-only mode (no setup required)
Quick Start
# Add a note to a book
{baseDir}/scripts/dnote.sh add cli "git rebase -i HEAD~3"
# Pipe content to a note
echo "docker system prune" | {baseDir}/scripts/dnote.sh add docker
# Search all notes
{baseDir}/scripts/dnote.sh find "docker compose"
# View recent notes
{baseDir}/scripts/dnote.sh recent
# List all books
{baseDir}/scripts/dnote.sh books
# View notes in a book
{baseDir}/scripts/dnote.sh view cli
# Get a specific note
{baseDir}/scripts/dnote.sh get cli 1
Commands
Adding Notes
| Command | Description |
|---|---|
add <book> <content> |
Add note to book |
add-stdin <book> |
Add from stdin (pipe-friendly) |
quick <content> |
Quick add to 'inbox' book |
Retrieving Notes
| Command | Description |
|---|---|
view [book] |
List books or notes in book |
get <book> <index> |
Get specific note by index |
find <query> |
Full-text search (use -b <book> to filter) |
recent [n] |
Show n most recent notes (default: 10) |
books |
List all books |
export [book] |
Export notes as JSON |
config |
Show config and paths |
Managing Notes
| Command | Description |
|---|---|
edit <id> [content] |
Edit note by ID |
move <id> <book> |
Move note to different book |
remove <id> |
Delete note |
remove-book <book> |
Delete entire book |
Sync & Info
| Command | Description |
|---|---|
sync |
Sync with Dnote server |
status |
Show status and stats |
config |
Show config file locations |
login |
Authenticate with server (native CLI) |
logout |
Remove credentials (native CLI) |
Collection IDs / Books
- Use any book name (auto-created on first use)
- Common book names:
cli,docker,git,ideas,snippets,journal,inbox - Books are created automatically when you add the first note
Examples
# Capture a shell one-liner
{baseDir}/scripts/dnote.sh add cli "grep -r pattern . --include='*.py'"
# Save from command output
git log --oneline -10 | {baseDir}/scripts/dnote.sh add git
# Quick capture to inbox
{baseDir}/scripts/dnote.sh quick "Remember to update README"
# Search for docker commands
{baseDir}/scripts/dnote.sh find "docker compose"
# Search within a specific book
{baseDir}/scripts/dnote.sh find "config" -b cli
# Get formatted note for AI context
{baseDir}/scripts/dnote.sh get cli 1 --format raw
# Export book for processing
{baseDir}/scripts/dnote.sh export cli --json | jq '.notes[].content'
# Recent notes across all books
{baseDir}/scripts/dnote.sh recent 20
# Search and export results
{baseDir}/scripts/dnote.sh find "postgres" --json
Using Notes in AI Context
Retrieve relevant notes for the current task:
# Search for related knowledge
{baseDir}/scripts/dnote.sh find "python argparse"
# Get full content of a specific note
{baseDir}/scripts/dnote.sh get cli 5
# Export entire book for context
{baseDir}/scripts/dnote.sh export python
Auto-capture useful information:
# Save a discovered solution
{baseDir}/scripts/dnote.sh add docker "Multi-stage builds reduce image size"
# Save with timestamp
{baseDir}/scripts/dnote.sh add journal "$(date): Deployed v2.3 to production"
Patterns
Daily Journal
# Create dated entry
{baseDir}/scripts/dnote.sh add journal "$(date +%Y-%m-%d): Started work on feature X"
# Review recent entries
{baseDir}/scripts/dnote.sh view journal | head -20
Code Snippets
# Save with description
{baseDir}/scripts/dnote.sh add python "List comprehension: [x for x in items if x > 0]"
# Search when needed
{baseDir}/scripts/dnote.sh find "list comprehension"
Command Reference
# Build a CLI reference
curl -s https://api.example.com | {baseDir}/scripts/dnote.sh add api
# Quick lookup
{baseDir}/scripts/dnote.sh view api
Integration with Workflows
The skill provides helper functions for common patterns:
| Function | Use Case |
|---|---|
dnote:search <query> |
Find relevant context before answering |
dnote:capture <book> <content> |
Save useful info discovered during task |
dnote:recent [n] |
Review recently captured notes |
dnote:export-book <book> |
Load entire book into context |
Config File
Create ~/.config/dnote/dnoterc:
editor: code --wait # or vim, nano, subl -w
apiEndpoint: https://api.dnote.io
enableUpgradeCheck: true
Tips
- Use specific book names:
python,bash,docker,kubernetes,ideas - Search is full-text: Works across all note content
- Indexes are 1-based: First note is
1, not0 - Pipes work great: Capture command output directly
- Sync optional: Works fully offline, sync when ready
Direct Dnote CLI
For operations not covered:
# Interactive edit
dnote edit 5
# Rename book
dnote edit oldname -n newname
# Full sync
dnote sync --full
# Custom DB path
dnote --dbPath /path/to/custom.db view
Docs: https://www.getdnote.com/docs/cli/
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。