Skip to main content
Version: 0.1.0-alpha.1

Module Dependency CLI Commands

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

Command Overview

CommandDescription
invowk module addResolve a dependency and print a requires entry
invowk module removeRemove a dependency from the lock file
invowk module depsList resolved dependencies
invowk module syncResolve dependencies from invkmod.cue
invowk module updateUpdate dependencies to latest matching versions
invowk module vendorVendor dependencies into invk_modules/ (partial)

invowk module add

Resolve a dependency and print the requires entry to add to invkmod.cue.

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.invkmod.git ^1.0.0

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

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

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

Output

Add Module Dependency

• Resolving https://github.com/user/mod.invkmod.git@^1.0.0...
✓ Module added successfully

• Git URL: https://github.com/user/mod.invkmod.git
• Version: ^1.0.0 → 1.2.3
• Namespace: mod@1.2.3
• Cache: /home/user/.invowk/modules/github.com/user/mod.invkmod/1.2.3

• To use this module, add to your invkmod.cue:

requires: [
{
git_url: "https://github.com/user/mod.invkmod.git"
version: "^1.0.0"
},
]
note

invowk module add does not edit invkmod.cue for you. Copy the printed requires entry into your module metadata, then run invowk module sync.

invowk module remove

Remove a dependency from the lock file.

Usage

invowk module remove <git-url>

Arguments

ArgumentDescription
git-urlGit repository URL to remove

Examples

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

Output

Remove Module Dependency

• Removing https://github.com/user/mod.invkmod.git...
✓ Module removed from lock file

• Don't forget to remove the requires entry from your invkmod.cue
note

This command only removes the dependency from the lock file. You must manually remove the requires entry from invkmod.cue. 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.invkmod.git
Version: ^2.0.0 → 2.3.1
Commit: abc123def456
Cache: /home/user/.invowk/modules/github.com/company/build-tools.invkmod/2.3.1

✓ deploy-utils@1.5.2
Git URL: https://github.com/company/deploy-tools.invkmod.git
Version: ~1.5.0 → 1.5.2
Commit: 789xyz012abc
Cache: /home/user/.invowk/modules/github.com/company/deploy-tools.invkmod/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 invkmod.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 invkmod.cue

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

✓ Lock file updated: invkmod.lock.cue

No Requirements

Sync Module Dependencies

• No requires field found in invkmod.cue

invowk module update

Update dependencies to their latest versions matching the declared constraints.

Usage

invowk module update [git-url]

Arguments

ArgumentDescription
git-url(Optional) Specific dependency to update

Examples

# Update all modules
invowk module update

# Update a specific module
invowk module update https://github.com/user/mod.invkmod.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: invkmod.lock.cue

No Updates

Update Module Dependencies

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

invowk module vendor

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

Usage

invowk module vendor [module-path]

Output

Vendor Module Dependencies

• Found 2 requirement(s) in invkmod.cue
• Vendor directory: /home/user/project/invk_modules

! Vendoring is not yet fully implemented

• The following dependencies would be vendored:
• https://github.com/example/common.invkmod.git@^1.0.0
• https://github.com/example/deploy.invkmod.git@~1.5.0
note

Vendoring is currently a preview. The command reports what would be vendored and creates the directory, but does not fetch dependencies yet.

Common Workflows

Initial Setup

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

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

# 3. Sync to generate lock file
invowk module sync

# 4. Commit the lock file
git add invkmod.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 invkmod.lock.cue

# Commit if tests pass
git add invkmod.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 invkmod.cue found (for sync)
1Version resolution failed
1Git clone/fetch failed