Router discovers plugin command directories #17

Closed
opened 2026-08-22 19:00:28 +01:00 by joshquinlan · 2 comments
Owner

Glob DONBOX_PATH/bin then every enabled plugin's bin; help generated from headers; commands --check covers all.

Glob DONBOX_PATH/bin then every enabled plugin's bin; help generated from headers; commands --check covers all.
Author
Owner

Done on branch core as cd79cf5.

The router globs $DONBOX_PATH/bin and then the bin/ of every
enabled plugin, from $DONBOX_PATH/plugins/*/ and
${XDG_DATA_HOME:-~/.local/share}/donbox/plugins/*/, with
duplicate roots collapsed. A plugin is a directory with a
plugin.toml; enablement comes from
~/.config/donbox/plugins.lua, read with luajit or lua, where a
listed id is enabled and a first-party plugin under DONBOX_PATH
is enabled unless it appears in the disabled table. A file no
interpreter can read is treated as absent, so a broken or
unreadable plugins.lua leaves the first-party set whole and
enables nothing new; both are tested.

Longest-prefix routing now runs across every directory, so the
checkout keeps a route a plugin also claims and donbox commands --check names both binaries. Metadata still comes from the
# donbox: header, now scanned over the first 80 lines, and the
listing is generated from it, grouped by first word, with the
group blurb taken from the summary of the command the group is
named after. donbox commands --json prints the same metadata.

Not yet implemented from the header table in .claude/rules/bin.md:
name, alias/aliases, examples and requires-sudo.

Done on branch `core` as cd79cf5. The router globs `$DONBOX_PATH/bin` and then the `bin/` of every enabled plugin, from `$DONBOX_PATH/plugins/*/` and `${XDG_DATA_HOME:-~/.local/share}/donbox/plugins/*/`, with duplicate roots collapsed. A plugin is a directory with a `plugin.toml`; enablement comes from `~/.config/donbox/plugins.lua`, read with luajit or lua, where a listed id is enabled and a first-party plugin under DONBOX_PATH is enabled unless it appears in the `disabled` table. A file no interpreter can read is treated as absent, so a broken or unreadable plugins.lua leaves the first-party set whole and enables nothing new; both are tested. Longest-prefix routing now runs across every directory, so the checkout keeps a route a plugin also claims and `donbox commands --check` names both binaries. Metadata still comes from the `# donbox:` header, now scanned over the first 80 lines, and the listing is generated from it, grouped by first word, with the group blurb taken from the summary of the command the group is named after. `donbox commands --json` prints the same metadata. Not yet implemented from the header table in .claude/rules/bin.md: `name`, `alias`/`aliases`, `examples` and `requires-sudo`.
Author
Owner

Integrated on master (dd951a0): router discovers plugin bin/ dirs via lib/plugins.sh and ~/.config/donbox/plugins.lua, commands --check and --json, help from headers. Deferred: name, alias, examples and requires-sudo header keys.

Integrated on master (dd951a0): router discovers plugin bin/ dirs via lib/plugins.sh and ~/.config/donbox/plugins.lua, commands --check and --json, help from headers. Deferred: name, alias, examples and requires-sudo header keys.
Sign in to join this conversation.
No description provided.