Command Dependencies (cmds)
Command dependencies (depends_on.cmds) are a discovery check: they ensure specific Invowk™ commands are available (discoverable) before your command runs.
Invowk does not execute those commands automatically.
For commands inside modules, this is also a static access check. A module command may depend on commands from the same module, globally installed modules in ~/.invowk/cmds, or direct dependencies declared in the root invowkmod.cue:requires and resolved in invowkmod.lock.cue. Commands from unrelated modules, stale or unsynced lock entries, or undeclared transitive dependencies fail validation even if they are otherwise discoverable. Root invowkfile commands are checked for discoverability only.
Basic Usage
depends_on: {
cmds: [
{alternatives: ["build"]}
]
}
If none of the listed alternatives can be found, Invowk fails with a Missing Commands dependency error.
Naming & Resolution
- Same invowkfile: reference commands by name (e.g.,
"build","test unit"). - Modules: use an explicit source-qualified ref (e.g.,
"@shared generate-types").
Alternatives (OR Semantics)
depends_on: {
cmds: [
// Either command being discoverable satisfies this dependency
{alternatives: ["build debug", "build release"]},
]
}
The dependency is satisfied if any alternative is discoverable.
For module commands, the chosen alternative must also pass the static access check described above.
If a command dependency is declared in requires but still fails the access check, run invowk module sync so the lock file records the dependency's stable module ID and command source namespace.
Multiple Requirements (AND Semantics)
depends_on: {
cmds: [
{alternatives: ["build"]},
{alternatives: ["test unit", "test integration"]},
]
}
All entries must be satisfied.
Cross-Invowkfile Requirements
depends_on: {
cmds: [{alternatives: ["@shared generate-types"]}]
}
This is especially useful when your invowkfile expects another invowkfile/module to be installed.
If you want workflows…
If you want deploy to actually run build first, do it explicitly in your script (or create a dedicated “workflow” command). Invowk doesn’t orchestrate command execution via depends_on.cmds.
invowk cmd build && invowk cmd deploy
Next Steps
- Capabilities - Check system capabilities
- Environment Variables - Check for required env vars