tendr-cli
v0.0.25
Published
cli tools for markdown-based digital gardening
Maintainers
Keywords
Readme
🪴 tendr-cli 🎍
⚠️ 🌱 This project is under active development: Backup all data and use version control.
CLI tooling to edit [[wikirefs]] and semantic trees in a collection of markdown files. Commands will feel familiar to typical cli commands to inspect files and directories.
🧑🌾 🚰 ✂️ Tend your 🎋 WikiBonsai digital garden with minimalist tooling.
Install
Install with npm:
npm install -g tendr-cliUse
Example:
$ tendr stat <filename>Manual:
usage: tendr <command>
cli tools for markdown-based digital gardening.
Commands:
tendr doctor check garden health. [aliases: doc, dr]
tendr list list garden contents. [aliases: ls]
tendr lint deprecated: use doctor.
tendr tree print full knowledge bonsai.
tendr check <concepts...> check which concepts exist, are zombies, or missing.
tendr status <filename> show status of file relationships. [aliases: stat]
tendr find <fname> show full path of matching file(s). [aliases: f]
tendr add <fname> create a new markdown file. [aliases: a]
tendr del <fname> move a file to the trash. [aliases: d]
tendr rm <fname> move a file to trash without confirmation.
tendr move <from> <to> move a file on disk; sync wikilinks. [aliases: mv]
tendr rename <old-fname> <new-fname> rename a file and all of its references.
[aliases: rn]
tendr rehead <old-frag> <new-frag> rewrite #header fragments. [aliases: rh]
tendr retypedoc <old-type> <new-type> rename document type. [aliases: rtdoc, rtd]
tendr retyperef <old-type> <new-type> rename reference type. [aliases: rtref, rtr]
tendr graft <child> <parent> reparent a node in the tree index.[aliases: gr]
tendr prune <node> remove a node from the tree index.[aliases: pr]
tendr mkdntowiki [glob] convert [markdown](links) to [[wikirefs]].
[aliases: mtow]
tendr wikitomkdn [glob] convert [[wikirefs]] to [markdown](links).
[aliases: wtom]
tendr camltoyaml [glob] convert caml to yaml attributes. [aliases: ctoy]
tendr yamltocaml [glob] convert yaml to caml attributes. [aliases: ytoc]
tendr seed <concept> seed a concept file from an llm.
Options:
--version Show version number [boolean]
--help Show help [boolean]Commands
Note:
- Commands expect markdown files using the
.mdextension. - Commands that perform anything other than read operations will display a confirmation prompt before executing. This may typically be skipped with the force flag (
-f).
doctor, doc, dr
Example:
$ tendr doctorSample output:
// success
✅ all clean
// warnings
⚠️ [config] [lint] is deprecated — rename to [format]
// errors
❌ [tree] duplicate entity names found:
- File ".bonsai"
- "duplicate-filename" on lines: 1, 4Manual:
tendr doctor
check garden health
Options:
--version Show version number [boolean]
--help Show help [boolean]
-c, --config relative path to config file, including filename; defaults to "
./config.toml" [string] [default: "./config.toml"]
-d, --doctype relative path to doctype file, including filename; defaults to
"t.doc.toml" [string] [default: "./t.doc.toml"]
--reltype relative path to reltype file, including filename; defaults to
"t.rel.toml" [string] [default: "./t.rel.toml"]
-r, --root filename for root of tree [string]
-g, --glob glob to index files [string]list, ls
List garden information. Runs on all files in current directory and all subdirectories.
Example:
$ tendr listSample output:
structure
nodes 5
tree 3
web 3
orphans 2
isolates 2
references
wikiattrs 1
wikilinks 3
wikiembeds 0
types
doctypes 1
attrtypes 1
linktypes 1Manual:
tendr list
list garden contents
Options:
--version Show version number [boolean]
--help Show help [boolean]
-c, --config relative path to config file, including filename; defaults to "
./config.toml" [string] [default: "./config.toml"]
-d, --doctype relative path to doctype file, including filename; defaults to
"t.doc.toml" [string] [default: "./t.doc.toml"]lint
lint is a backwards-compatible shim that delegates to doctor for now.
Example:
$ tendr linttree
Example:
$ tendr treeSample output:
bk.how-to-read-a-book
├── demanding-reader
| └── active-reading
| ├── reading-comprehension
| └── the-art-of-reading
└── 4-levels-of-reading
├── elementary-reading
├── inspectional-reading
├── analytical-reading
└── syntopical-readingManual:
tendr tree
print full knowledge bonsai/semantic tree
Options:
--version Show version number [boolean]
--help Show help [boolean]
-c, --config relative path to config file, including filename; defaults to "
./config.toml" [string] [default: "./config.toml"]
-d, --doctype relative path to doctype file, including filename; defaults to
"t.doc.toml" [string] [default: "./t.doc.toml"]
-r, --root filename for root of tree [string]
-g, --glob glob to index files [string]check
Check which concepts exist as files, which are referenced but have no file (zombies), or which are missing entirely.
Example:
$ tendr check concept-a concept-b concept-cstatus, stat
Example:
$ tendr status <filename>Sample output:
📄 fname-a [default]
🌳 Tree
ancestors: i.bonsai
children: fname-b, fname-c, fname-d, fname-e
🕸️ Web
back fore
attr ◦ attrtype ◦ reftype
• fname-b • fname-b
◦ attrtype
• fname-c
link • fname-c [linktype] • fname-d [linktype]
• fname-d • fname-e
• i.bonsai • no-doc
embed • fname-f --Manual:
tendr status <filename>
show status of file relationships
Options:
--version Show version number [boolean]
--help Show help [boolean]
-k, --kind kind of relationships to list
(kinds: rel, fam, ancestor, child
, ref, attr, link, embed, fore, foreref, foreattr, forelink, fo
reembed, back, backref, backattr, backlink, backembed; default
is "rel") [string] [default: "rel"]find , f
Example:
$ tendr find <fname>Sample output:
Single file:
/path/to/notes/fname.mdMultiple files:
/path/to/notes/fname.md
/path/to/notes/folder/fname.mdManual:
tendr find <fname>
show full path of markdown file(s) with the given filename.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-r, --regex usage: find <regex>; use regex pattern instead of string -- thi
s will find all filenames containing matches to the regex patte
rn. (use quotes around regex if the terminal is preemptively ex
ecuting it) [boolean] [default: false]add, a
Create a new markdown file. Optionally placed per doctype rules in t.doc.toml.
Example:
$ tendr add my-note
$ tendr add my-note --type entry
$ tendr add my-note --attr title="My Note" --attr tags=wiki
$ tendr add my-note --body "# Hello World"Manual:
tendr add <fname>
create a new markdown file.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-t, --type document type name (section key in t.doc.toml) [string]
--path override doctype directory path for this note [string]
--prefix override doctype filename prefix for this note [string]
-a, --attr set metadata attribute as key=value (repeatable) [array]
--body markdown body after the front matter [string]del, d
Move a file to the OS trash (recoverable). Prompts for confirmation.
Example:
$ tendr del old-note
$ tendr del old-note --forcerm
Move a file to the OS trash without confirmation. Equivalent to del --force.
Example:
$ tendr rm old-notemove, mv
Move a file on disk. Syncs wikilinks across the vault when the basename changes.
Example:
$ tendr move note.md subdir/note.md
$ tendr move note.md subdir/new-name.md
$ tendr move --regex "^old-dir/" "new-dir/"Manual:
tendr move <from> <to>
move a markdown file on disk; syncs wikilinks when the basename changes.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-f, --force skip verification prompt [boolean]
-r, --regex use regex pattern for bulk moves [boolean]
--no-title skip updating the title attribute [boolean]
--title explicit title value to set [string]
--title-case override config.format.title_case [string]rename, rn
Example:
$ tendr rename <old-fname> <new-fname>Sample Output:
$ tendr rename '4-levels-of-reading' 'four-levels-of-reading'
are you sure you want to rename "4-levels-of-reading" to "four-levels-of-reading"? [y/n]
y
UPDATED FILENAMES:
4-levels-of-reading -> four-levels-of-reading
UPDATED FILE CONTENT:
analytical-reading
demanding-reading
elementary-reading
inspectional-reading
syntopical-readingManual:
tendr rename <old-fname> <new-fname>
rename a file and all of its references.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-r, --regex usage: rename <regex> <replace-string>; use regex replacement i
nstead of string replacement -- this will rename all filenames
containing matches to the regex pattern; the regex argument wil
l be replaced by the string argument. (use quotes around regex
if the terminal is preemptively executing it)
[boolean] [default: false]
-f, --force skip verification prompt and perform operation
[boolean] [default: false]
--no-title skip updating the renamed note title attribute
[boolean] [default: false]
--title explicit title value to set on the renamed note [string]
--title-case, --case
override config.format.title_case
(kinds: "Title Case", "lower case", "kabob-case", "snake_case")
[string]rehead, rh
Rewrite #header fragments on wikilinks and wikiembeds.
Example:
$ tendr rehead "Old Header" "New Header" --fname my-noteManual:
tendr rehead <old-fragment> <new-fragment>
rewrite #header fragments on wikilinks and wikiembeds.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-n, --fname target note filename (without .md extension) [string] [required]
-f, --force skip verification prompt [boolean] [default: false]retypedoc, rtdoc, rtd
Rename a document type and update all occurrences.
Example:
$ tendr retypedoc old-type new-typeretyperef, rtref, rtr
note: keep in mind this will not retype caml primitive properties! this is for wikirefs only.
Example:
$ tendr retyperef <old-type> <new-type>Manual:
tendr retyperef <old-type> <new-type>
rename reference type and all its occurrences.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-k, --kind kind of entity to rename (kinds: "reftype", "attrtype", "linkty
pe"; default is "reftype") [string] [default: "reftype"]graft, gr
Reparent a node in the semantic tree index.
Example:
$ tendr graft child-node new-parent
$ tendr graft child-node new-parent --dry-runManual:
tendr graft <child> <parent>
reparent a note in the semantic tree index (wikilink list under a new parent).
Options:
--version Show version number [boolean]
--help Show help [boolean]
-f, --force skip verification prompt [boolean] [default: false]
-r, --root filename for root of tree [string]
-g, --glob glob to index files [string]
--dry-run show what would change without writing files [boolean]prune, pr
Remove a node from the semantic tree index.
Example:
$ tendr prune dead-node
$ tendr prune dead-node --single
$ tendr prune dead-node --dry-runManual:
tendr prune <node>
remove a note from the semantic tree index (wikilink list entry).
Options:
--version Show version number [boolean]
--help Show help [boolean]
-f, --force skip verification prompt [boolean] [default: false]
-s, --single remove only the bullet line; outdent children one level
[boolean] [default: false]
--node-only same as --single [boolean] [default: false]
-r, --root filename for root of tree [string]
-g, --glob glob to index files [string]
--dry-run show what would change without writing files [boolean]mkdntowiki, mtow
Example:
$ tendr mkdntowikiManual:
tendr mkdntowiki [glob]
convert from "[markdown](style)" to "[[wiki-style]]" internal links.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-F, --format how to parse markdown links -- "filename", "relative" urls, or
"absolute" urls [string] [default: "filename"]
-k, --kind kind of references to convert
(kinds: rel, fam, ancestor, child
, ref, attr, link, embed, fore, foreref, foreattr, forelink, fo
reembed, back, backref, backattr, backlink, backembed; default
is "rel") [string] [default: "ref"]wikitomkdn, wtom
Example:
$ tendr wikitomkdnManual:
tendr wikitomkdn [glob]
convert from "[[wiki-style]]" to "[markdown](style)" internal links.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-F, --format how to format the resulting markdown links -- "filename", "rela
tive" urls, or "absolute" urls [string] [default: "filename"]
-k, --kind kind of references to convert
(kinds: rel, fam, ancestor, child
, ref, attr, link, embed, fore, foreref, foreattr, forelink, fo
reembed, back, backref, backattr, backlink, backembed; default
is "rel") [string] [default: "ref"]camltoyaml, ctoy
Example:
$ tendr camltoyaml [glob]Manual:
tendr camltoyaml [glob]
convert from "caml" to "yaml" style attributes.
Options:
--version Show version number [boolean]
--help Show help [boolean]yamltocaml, ytoc
Example:
$ tendr yamltocaml [glob]Manual:
tendr yamltocaml [glob]
convert from "yaml" to "caml" style attributes.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-f, --format how to format caml output (kinds: "none", "pretty", or "pad
"; default is "none") [string] [default: "pretty"]
-l, --list-format how to format caml output lists (kinds: "mkdn" or "comma";
default is "mkdn") [string] [default: "mkdn"]
-p, --no-prefix do not use colon prefix in caml output
[boolean] [default: true]seed
Seed a concept file with generated content from an LLM. Uses the wisp-ai package.
Example:
$ tendr seed 4-levels-of-readingSample output:
[[knowledge]] > [[learning]] > [[literacy]] > [[reading]] > [[the-art-of-reading]] > [[4-levels-of-reading]]
: title :: 4 Levels Of Reading
: alias :: ''
: hypernym :: [[the-art-of-reading]]
: hyponym ::
- [[elementary-reading]]
- [[inspectional-reading]]
- [[analytical-reading]]
- [[syntopical-reading]]
: synonym :: ''
: antonym :: ''
: tldr :: "The four levels of reading represent the ideal steps and skills in the art of reading."
- [[4-levels-of-reading]]
- [[elementary-reading]]
- [[reading-readiness]]
- [[word-mastery]]
- [[inspectional-reading]]
- [[skimming]]
- [[superficial-reading]]
- [[analytical-reading]]
- [[outline]]
- [[interpret]]
- [[criticize]]
- [[syntopical-reading]]
- [[prepare-bibliography]]
- [[inspect-passages]]Manual:
tendr seed <concept>
seed a concept file from an llm.
Options:
--version Show version number [boolean]
--help Show help [boolean]
-p, --provider llm provider (anthropic, openai, xai)
[string] [default: "anthropic"]
-k, --api-key api key (overrides env var) [string]
-m, --model model name (overrides default per provider) [string]
-o, --output write to <concept>.md file instead of stdout
[boolean] [default: false]
-c, --config relative path to config file [string] [default: "./config.toml"]
--attrs attribute format (caml, yaml) [string]
--case case style (upper, lower) [string]
--text text format (regular, [[wikitext]]) [string]
--indent indent style (2 spaces, 4 spaces, 1 tab) [string]
--whitespace whitespace style (white space, snake_case, kabob-case)
[string]