Reference
Command Syntax
treemand <cli> [flags]
treemand version
treemand cache [clear|list]
Global Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--interactive | -i | false | Launch interactive TUI explorer |
--strategy | -s | help | Discovery strategies: help, man, completions (comma-separated) |
--depth | -1 | Max tree depth (-1 = unlimited) | |
--filter | Only show nodes whose name matches pattern | ||
--exclude | Exclude nodes whose name matches pattern | ||
--commands-only | false | Hide flags and positional arguments | |
--full-path | false | Show full command paths in tree | |
--output | text | Output format: text, json, or yaml | |
--tree-style | default | Tree presentation: default, columns, compact, graph | |
--icons | unicode | Icon preset: unicode, ascii, nerd | |
--line-length | 80 | Max description chars before truncation | |
--no-color | false | Disable color output | |
--no-cache | false | Skip cache lookup and write | |
--timeout | 30 | Discovery timeout in seconds | |
--debug | false | Enable debug logging to stderr |
Subcommands
version
Print version, git commit, and build date.
treemand version
# treemand v0.3.0 (abc1234) built 2026-01-01
cache
Manage the discovery cache (~/.treemand/cache.db).
treemand cache list # List cached entries with age and size
treemand cache clear <cli> # Remove one CLI's cached entry
treemand cache clear # Remove all cached entries
Output Formats
treemand supports three output modes. The default is a colored tree for terminals; JSON and YAML are intended for scripting, diffing, and tool integration.
treemand git # colored text tree (default)
treemand --output=json git # full tree as JSON
treemand --output=yaml git # full tree as YAML (same structure)
JSON / YAML Schema
Both JSON and YAML output share the same structure:
{
"name": "git",
"description": "the stupid content tracker",
"flags": [
{"name": "--version", "value_type": "bool", "description": "Print version"}
],
"positionals": [],
"children": [
{
"name": "commit",
"description": "Record changes to the repository",
"flags": [
{"name": "--message", "value_type": "string", "description": "Commit message"},
{"name": "--all", "value_type": "bool", "description": "Stage modified files"}
],
"positionals": [
{"name": "pathspec", "required": false}
],
"children": []
}
]
}
Pipe JSON to jq for extraction:
treemand --output=json git | jq '.children[].name' # list subcommands
treemand --output=json git | jq '.children[] | select(.name == "commit") | .flags[].name'
Tree Display Styles
treemand supports four presentation styles. In the TUI, press T to cycle
through them; from the command line, use --tree-style:
default โ icon-prefixed tree with inline flag pills
โผ git the stupid content tracker
โโโ โผ remote [--verbose] Manage set of tracked repositories
โ โโโ โข add <name> <url> Add a remote
โ โโโ โข remove <name> Remove a remote
โโโ โข commit [--message=<string>, --all] Record changes
โโโ โข status [--short, --branch] Show working tree status
columns โ name ยท description alignment
git ยท the stupid content tracker
remote ยท Manage set of tracked repositories
add ยท Add a remote
remove ยท Remove a remote
commit ยท Record changes
status ยท Show working tree status
compact โ maximum density (no icons, no flags)
git
remote
add
remove
commit
status
graph โ classic tree connectors
โโโ git
โโโ remote
โ โโโ add
โ โโโ remove
โโโ commit
โโโ status
Non-Interactive Output
The default output is a Unicode tree with icons:
| Icon | Meaning |
|---|---|
โผ | Command with children (expanded) |
โถ | Command with children (collapsed, TUI only) |
โข | Leaf command (no subcommands) |
Use --icons=ascii for terminals without Unicode, or --icons=nerd for
Nerd Font glyphs.
Interactive TUI (-i)
treemand -i git
What the TUI Does
The TUI lets you explore a CLI’s command tree and assemble a specific command interactively. The workflow:
- Browse โ navigate subcommands with
โ/โ(orj/k) - Expand โ press
โto open a node; press again to enter children - Pick a command โ press
Enterto set it in the preview bar - Add flags โ press
fto open the flag picker, orEnteron a flag row - Fill positionals โ press
Enteron a positional to open an input prompt - Copy or run โ press
Ctrl+Eto copy the assembled command or run it
The preview bar at the top updates live as you build the command.
Layout
โโ โบ git remote add โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ (live command preview โ updates as you pick items) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโ Tree: git โโโโโโโโโโโโโโโโโโ Help: remote โโโโโโโโโโโโ
โ โผ git โโ Manage set of tracked โ
โ โผ remote โโ repositories. โ
โ โบ โข add <name> <url> โโ โ
โ โข remove <name> โโ --verbose (-v) โ
โ โข get-url <name> โโ Be verbose โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
git remote add [arrows] โ:collapse โ:expand H:help q:quit
Keyboard Controls
Navigation
| Keys (arrows) | Keys (vim) | Keys (WASD) | Action |
|---|---|---|---|
โ / โ | k / j | w / s | Move up / down (cursor only โ never auto-expands) |
โ | l | d | Expand node and stay (1st); enter first child (2nd) |
โ | h | a | Collapse node and stay (1st); go to parent (2nd) |
Shift+โ | Shift+L | Shift+D | Expand entire subtree (at root = expand all) |
Shift+โ | Shift+H | Shift+A | Collapse entire subtree (at root = collapse all) |
This matches the VS Code / macOS Finder tree model. To collapse a node and
move to its sibling: press โ (collapse), then โ (next sibling).
Toggle navigation scheme with Ctrl+S (cycles: arrows โ vim โ WASD).
Tree Operations
| Key | Action |
|---|---|
/ | Fuzzy filter tree nodes |
R | Refresh / re-discover current node |
F | Open flags modal for current node |
S | Toggle section headers (Sub commands, Flags, Inherited flags) |
T | Cycle display style (default โ columns โ compact โ graph) |
Building Commands
| Key | Action |
|---|---|
Enter | On a command: set it in the preview. On a flag: add it. On a positional: open input prompt. |
f | Open flag picker โ browse all flags for the current command with search |
Backspace | Remove last token from the preview |
Ctrl+E | Copy the assembled command to your clipboard, or run it (confirmation prompt) |
Esc / q | Quit (copies command to clipboard as fallback) |
View Controls
| Key | Action |
|---|---|
H | Toggle help pane (shows --help output for selected node) |
Tab | Cycle pane focus (tree โ help โ preview) |
? | Show all key bindings modal |
d / D | Open docs URL in browser (if detected in help text) |
Mouse
| Interaction | Action |
|---|---|
| Click node | Select node |
Click โถ/โผ | Toggle expand/collapse |
| Scroll | Scroll the focused pane |
Flags Modal (f)
Press f on any command node to open an interactive flag selector:
- Browse all flags for the current command (own + inherited)
- Search by typing to filter the flag list
- Press
Enteron a boolean flag to add it directly - Press
Enteron a value flag (e.g.--message=<string>) to open an input prompt - Already-added flags are marked with a checkmark
Positionals
When a command has positional arguments (e.g. git remote add <name> <url>),
navigate to the positional row and press Enter to open an input prompt.
The value is appended to the preview bar.
Caching
Discovery results are cached in an SQLite database:
| Property | Value |
|---|---|
| Location | ~/.treemand/cache.db |
| TTL | 24 hours |
| Key | CLI name + version + strategies |
| Schema | v8 |
treemand --no-cache docker # skip the cache for this run
treemand cache list # show cached CLIs
treemand cache clear git # clear one entry
Discovery Strategies
help (default)
Recursively runs <cli> --help / <cli> <subcmd> --help to build the tree.
Falls back to <cli> help <subcmd>, man page lookup, and error output mining.
man
Parses the man page for the CLI (if available) using man <cli> and stripping
groff formatting. Provides richer descriptions than --help for many Unix tools.
completions
Uses shell completion output (<cli> __complete, <cli> completion) to
enumerate subcommands without executing --help for every node.
treemand -s help git # default
treemand -s man git # man page parser
treemand -s help,man git # combine strategies, merge results
Configuration
treemand reads ~/.config/treemand/config.yaml or ~/.treemand/config.yaml:
icons: ascii # unicode (default) | ascii | nerd
desc_line_length: 80 # max chars before description is truncated
stub_threshold: 50 # subcommand count before switching to stub nodes
colors:
subcmd: "#5EA4F5"
flag: "#50FA7B"
Precedence: CLI flags > environment variables > config file > defaults.
Color Scheme
| Element | Default |
|---|---|
| Base command | bold white #FFFFFF |
| Subcommand | blue #5EA4F5 |
| Flag (bool) | green #50FA7B |
| Flag (string) | cyan #8BE9FD |
| Flag (int) | orange #FFB86C |
| Flag (other) | purple #BD93F9 |
| Positional | yellow #F1FA8C |
| Invalid/error | red #FF5555 |
| Selected bg | cyan #00BFFF |
| Selected text | black #000000 |
Self-Dogfooding
treemand treemand # explore treemand's own command tree
treemand -i treemand # interactively explore treemand itself