Support plugin command directories for extensible command discovery #323
Labels
No labels
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#323
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
As part of the kanon/iw-cli relationship redesign (see iterative-works/dev-docs#123), we're extracting AI-specific commands (like
batch-implement,implement) from iw-cli core into platform-specific plugins (e.g., kanon's Claude Code plugin). This requires iw-cli to support loading commands from external directories beyond the current two search paths (shared + project-local).Current State
iw-runresolves commands from two directories:$IW_COMMANDS_DIR(from iw-cli installation)$PROJECT_DIR/.iw/commands/(invoked with./prefix)Proposed Change
Plugin Command Directories
Add support for additional command directories registered by plugins. Resolution order:
./name) — project-local, highest priorityRegistration Mechanism
Support both:
IW_PLUGIN_DIRS(colon-separated paths) for ad-hoc use.iw/config.conffor persistent registration$XDG_DATA_HOME/iw/plugins/*/commands/for installed pluginsCommand Listing
./iw --listshould show plugin commands in a separate section (like project commands already are), with the plugin name/source clearly indicated:Version Compatibility
Add a
// REQUIRES: <version>header convention to command files.iw-runchecks this before attempting compilation and gives a human-readable error:This is preferred over letting scala-cli produce opaque compilation errors when plugin commands use core APIs that don't exist in the installed version.
Deployment
A plugin registers its commands by either:
./iw plugin install <path-or-name>Key Considerations
$IW_CORE_DIRas shared commands — no separate dependency management needed.hook-*.scala) should work for plugin commands too--describeshould indicate the command source (core/plugin/project)Related
Merged in PR #329 (
bd5b5c1)