A single-file Python CLI tool ( zk.py) implementing the full Zettelkasten method as described in the Desktop Commander / Obsidian Practical Setup Guide. No dependencies beyond Python 3.8+ stdlib. Creates and manages a local markdown vault compatible with Obsidian.
ZK_VAULT environment variable to set vault location (default: ~/Zettelkasten)EDITOR environment variable for note editing (default: nano)text
~/Zettelkasten/
00-Inbox/ ← fleeting notes (quick captures)
10-Literature/ ← one note per source, in your own words
20-Permanent/ ← atomic notes, one idea, fully linked
30-MOC/ ← Maps of Content (navigation layers)
40-Templates/ ← markdown templates for each type
Copy zk.py to /mnt/user-data/outputs/zk.py and present it to the user via present_files. Also deliver README.md.
bash
chmod +x zk.py
cp zk.py ~/.local/bin/zk # optional: make globally available
export ZK_VAULT=~/Zettelkasten # add to ~/.bashrc or ~/.zshrc
bash
python3 zk.py init
# Creates all 5 folders + 4 markdown templates
Capture (fleeting note, no friction):
bash
zk new fleeting
Process inbox weekly (flags notes older than 7 days):
bash
zk inbox
Write permanent notes (one atomic idea per note):
bash
zk new permanent "Claim written as a full sentence"
Link notes — edit the ## Connections section and add [[note-stem]] links.
Promote fleeting → permanent:
bash
zk promote "fragment of title"
Generate Map of Content when a topic has 8+ notes:
bash
zk moc "Topic Name"
bash
zk links # find orphaned notes (no links in/out)
zk links "note title" # show forward + backlinks for one note
zk graph # ASCII link graph of entire vault
zk stats # counts, top tags, orphan count
zk search "query" # full-text search with highlights
zk list --folder permanent # list notes in a specific folder
zk list --tag psychology # filter by tag
zk.py — single-file Python CLI, ~400 lines, no dependenciesREADME.md — full usage guide with workflow and tipsTypeFolderFilename patternTemplate fieldsFleeting00-Inbox/``{timestamp}.mdcreated, statusLiterature10-Literature/``{date}-{slug}.mdcreated, status, source, author, tagsPermanent20-Permanent/``{date}-{slug}.mdcreated, status, tags, source, Connections, SourceMOC30-MOC/``MOC-{slug}.mdcreated, status, tags, linked notes
"Attention is a finite resource" not "Attention"[[link]]#psychology), not fine-grained ones[[double-bracket]] wiki-link syntax identical to Obsidian — vaults are fully interoperablezk graph marks missing link targets with ⇢? in red--no-edit flag on new, promote, moc skips opening the editor (useful for scripting)ZK_VAULT env var overrides --vault flag and default pathzk promote command fuzzy-matches on filename and note body content