Manage a personal knowledge base using Dnote CLI.
# 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
Dnote follows XDG directories:
~/.config/dnote/dnoterc~/.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
# To sync across devices
dnote login
# Or local-only mode (no setup required)
# 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
| Command | Description |
|---|---|
| --------- | ------------- |
add | Add note to book |
add-stdin | Add from stdin (pipe-friendly) |
quick | Quick add to 'inbox' book |
| Command | Description |
|---|---|
| --------- | ------------- |
view [book] | List books or notes in book |
get | Get specific note by index |
find | Full-text search (use -b 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 |
| Command | Description |
|---|---|
| --------- | ------------- |
edit | Edit note by ID |
move | Move note to different book |
remove | Delete note |
remove-book | Delete entire book |
| 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) |
cli, docker, git, ideas, snippets, journal, inbox# 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
# 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
# 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"
# 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
# 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"
# Build a CLI reference
curl -s https://api.example.com | {baseDir}/scripts/dnote.sh add api
# Quick lookup
{baseDir}/scripts/dnote.sh view api
The skill provides helper functions for common patterns:
| Function | Use Case |
|---|---|
| ---------- | ---------- |
dnote:search | Find relevant context before answering |
dnote:capture | Save useful info discovered during task |
dnote:recent [n] | Review recently captured notes |
dnote:export-book | Load entire book into context |
Create ~/.config/dnote/dnoterc:
editor: code --wait # or vim, nano, subl -w
apiEndpoint: https://api.dnote.io
enableUpgradeCheck: true
python, bash, docker, kubernetes, ideas1, not 0For 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/
共 1 个版本