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 invkfile | ./invkfile.cue |
| 2 | Local modules | ./mytools.invkmod/ |
| 3 | User directory | ~/.invowk/cmds/invkfile.cue |
| 4 (lowest) | Configured includes | /opt/invowk-modules/ |
Key principle: Closer to the working directory = higher priority.
Module Discovery Details
Required Module Fields
// invkmod.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 invkfile | 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 invkfiles and modules are configured in ~/.config/invowk/config.cue:
includes: [
{path: "/opt/company-invowk-modules/tools.invkmod"},
{path: "/home/shared/invowk/invkfile.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 --invk-verbose
# Validate module structure
invowk module validate ./mymodule.invkmod
Related Diagrams
- Command Execution Sequence - What happens after discovery
- Runtime Selection Flowchart - How runtimes are chosen
- C4 Container Diagram - Discovery component context