Skip to main content
Version: 0.4.0

Module Dependency CLI Commands

Invowk provides a set of invowk module commands for managing module dependencies declared in invowkmod.cue.

Command Overview

CommandDescription
invowk module addAdd a module dependency (resolves, caches, updates lock file and invowkmod.cue)
invowk module removeRemove a module dependency (updates lock file and invowkmod.cue)
invowk module depsList resolved dependencies
invowk module syncResolve dependencies from invowkmod.cue
invowk module updateUpdate dependencies to latest matching versions
invowk module vendorVendor dependencies into invowk_modules/

invowk module add

Resolve a dependency, cache it, update the lock file, and auto-edit invowkmod.cue to add the requires entry.

Usage

invowk module add <git-url> <version> [flags]

Arguments

ArgumentDescription
git-urlGit repository URL (HTTPS or SSH)
versionSemantic version constraint

Flags

FlagDescription
--alias <name>Custom namespace for the dependency
--path <path>Subdirectory within the repository

Examples

# Add a dependency with caret version
invowk module add https://github.com/user/mod.invowkmod.git ^1.0.0

# Add with SSH URL
invowk module add git@github.com:user/mod.invowkmod.git ~2.0.0

# Add with custom alias
invowk module add https://github.com/user/common.invowkmod.git ^1.0.0 --alias tools

# Add from monorepo subdirectory
invowk module add https://github.com/user/monorepo.invowkmod.git ^1.0.0 --path modules/cli

Output

Add Module Dependency

ℹ Resolving https://github.com/user/mod.invowkmod.git@^1.0.0...
✓ Module resolved and lock file updated

ℹ Git URL: https://github.com/user/mod.invowkmod.git
ℹ Version: ^1.0.0 → 1.2.3
ℹ Namespace: mod@1.2.3
ℹ Cache: /home/user/.invowk/modules/github.com/user/mod.invowkmod/1.2.3
✓ Updated invowkmod.cue with new requires entry
note

invowk module add performs three actions automatically:

  1. Resolves and caches the module
  2. Updates the lock file
  3. Auto-edits invowkmod.cue to add the requires entry (if the file exists)

The output looks like:

ℹ Resolving <url>@<version>...
✓ Module resolved and lock file updated
ℹ Git URL: <url>
ℹ Version: <requested> → <resolved>
ℹ Namespace: <namespace>
ℹ Cache: <path>
✓ Updated invowkmod.cue with new requires entry

invowk module remove

Remove a module dependency from the lock file and invowkmod.cue.

Usage

invowk module remove <identifier>

Arguments

ArgumentDescription
identifierModule identifier: git URL, alias, module name, or full key (modulename@version)

Examples

invowk module remove https://github.com/user/mod.invowkmod.git

Output

Remove Module Dependency

ℹ Removing https://github.com/user/mod.invowkmod.git...
✓ Removed mod@1.2.3

✓ Lock file and invowkmod.cue updated
note

invowk module remove performs two actions automatically:

  1. Removes the module from the lock file
  2. Auto-edits invowkmod.cue to remove the corresponding requires entry

The output looks like:

Remove Module Dependency
ℹ Removing <identifier>...
✓ Removed <namespace>

✓ Lock file and invowkmod.cue updated

Cached files are not deleted.

invowk module deps

List all resolved dependencies from the lock file.

Usage

invowk module deps

Output

Module Dependencies

• Found 2 module dependency(ies)

✓ build-tools@2.3.1
Git URL: https://github.com/company/build-tools.invowkmod.git
Version: ^2.0.0 → 2.3.1
Commit: abc123def456
Cache: /home/user/.invowk/modules/github.com/company/build-tools.invowkmod/2.3.1

✓ deploy-utils@1.5.2
Git URL: https://github.com/company/deploy-tools.invowkmod.git
Version: ~1.5.0 → 1.5.2
Commit: 789xyz012abc
Cache: /home/user/.invowk/modules/github.com/company/deploy-tools.invowkmod/1.5.2

No Dependencies

Module Dependencies

• No module dependencies found

• To add modules, use: invowk module add <git-url> <version>

invowk module sync

Sync all dependencies declared in invowkmod.cue. This reads the requires field, resolves version constraints, downloads modules, and updates the lock file.

Usage

invowk module sync

Output

Sync Module Dependencies

• Found 2 requirement(s) in invowkmod.cue

✓ build-tools@2.3.1 → 2.3.1
✓ deploy-utils@1.5.2 → 1.5.2

✓ Lock file updated: invowkmod.lock.cue

No Requirements

Sync Module Dependencies

• No requires field found in invowkmod.cue

invowk module update

Update dependencies to their latest versions matching the declared constraints.

Usage

invowk module update [identifier]

Arguments

ArgumentDescription
identifier(Optional) Specific dependency to update: git URL, alias, module name, or full key (modulename@version)

Examples

# Update all modules
invowk module update

# Update a specific module
invowk module update https://github.com/user/mod.invowkmod.git

Output

Update Module Dependencies

• Updating all modules...

✓ build-tools@2.3.1 → 2.4.0
✓ deploy-utils@1.5.2 → 1.5.3

✓ Lock file updated: invowkmod.lock.cue

No Updates

Update Module Dependencies

• Updating all modules...
• No modules to update

invowk module vendor

Vendor dependencies into the invowk_modules/ directory for offline use and distribution.

Usage

invowk module vendor [module-path]

Output

Vendor Module Dependencies

• Found 2 requirement(s) in invowkmod.cue
• Loading from lock file
• Vendor directory: /home/user/project/invowk_modules

✓ common@1.2.3
✓ deploy@1.5.4

✓ Vendored 2 module(s) successfully
note

invowk module vendor resolves dependencies and copies them into invowk_modules/. If invowkmod.lock.cue exists, vendoring uses locked versions by default. Use --update to force re-resolution and --prune to remove stale vendored modules.

Common Workflows

Initial Setup

# 1. Resolve dependencies
invowk module add https://github.com/company/build-tools.invowkmod.git ^2.0.0 --alias build
invowk module add https://github.com/company/deploy-tools.invowkmod.git ~1.5.0 --alias deploy

# 2. Add requires to invowkmod.cue manually or verify
cat invowkmod.cue

# 3. Sync to generate lock file
invowk module sync

# 4. Commit the lock file
git add invowkmod.lock.cue
git commit -m "Add module dependencies"

Fresh Clone

# On a fresh clone, sync downloads all modules
git clone https://github.com/yourorg/project.git
cd project
invowk module sync

Regular Updates

# Update all modules periodically
invowk module update

# Review changes
git diff invowkmod.lock.cue

# Commit if tests pass
git add invowkmod.lock.cue
git commit -m "Update module dependencies"

Troubleshooting

# List current dependencies to verify state
invowk module deps

# Re-sync if something seems wrong
invowk module sync

# Check commands are available
invowk cmd

Environment Variables

VariableDescription
INVOWK_MODULES_PATHOverride module cache directory
GITHUB_TOKENGitHub authentication
GITLAB_TOKENGitLab authentication
GIT_TOKENGeneric Git authentication

Exit Codes

CodeMeaning
0Success
1General error
1Module not found (for remove)
1No invowkmod.cue found (for sync)
1Version resolution failed
1Git clone/fetch failed