Discovery Precedence Flowchart
This diagram shows how commands are discovered and how conflicts are resolved when the same command name appears in multiple locations.
Discovery Flow
Conflict Resolution
When the same command name exists in multiple locations:
Resolution Rules
| Priority | Source | Example Path |
|---|---|---|
| 1 (highest) | Current directory invowkfile | ./invowkfile.cue |
| 2 | Local modules | ./mytools.invowkmod/ |
| 3 | Configured includes | /opt/invowk-modules/tools.invowkmod |
| 4 (lowest) | User commands directory | ~/.invowk/cmds/mytools.invowkmod/ |
Key principles:
- Closer to the working directory = higher priority.
- Configured includes take precedence over the user commands directory because they represent explicit, intentional configuration.
- The user commands directory (
~/.invowk/cmds/) only discovers*.invowkmoddirectories as immediate children (non-recursive). Loose invowkfiles are not discovered from this location.
Module Discovery Details
Required Module Fields
// invowkmod.cue
module: "com.example.mymodule" // RDNS naming convention
version: "1.0.0" // Semantic version
// Optional
description: "My useful module"
requires: [
{
git: "https://github.com/org/repo.git"
version: "v1.0.0"
}
]
Dependency Resolution
Transitive Dependency Visibility
| From | Can Access | Cannot Access |
|---|---|---|
| Module A | A's commands, B's commands | C's commands (transitive) |
| Module B | B's commands, C's commands | - |
| Root invowkfile | Own commands, direct deps | Transitive deps |
Why this restriction?
- Prevents implicit coupling to transitive dependencies
- Makes dependencies explicit in each module
- Enables dependency upgrades without breaking consumers
Includes Configuration
Additional invowkfiles and modules are configured in ~/.config/invowk/config.cue:
includes: [
{path: "/opt/company-invowk-modules/tools.invowkmod"},
{path: "/home/shared/invowk/invowkfile.cue"},
]
Entry Processing Order
Discovery Caching
Common Discovery Issues
Problem: Command Not Found
Problem: Wrong Command Version
Debug Commands
# List all discovered commands with sources
invowk cmd --ivk-verbose
# Validate module structure
invowk module validate ./mymodule.invowkmod
Related Diagrams
- Command Execution Sequence - What happens after discovery
- Runtime Selection Flowchart - How runtimes are chosen
- C4 Container Diagram - Discovery component context