Skip to content

[OC-760] Module directory version freeze & install#397

Draft
cvaske wants to merge 2 commits into
masterfrom
cv/OC-760-module-freeze-commands
Draft

[OC-760] Module directory version freeze & install#397
cvaske wants to merge 2 commits into
masterfrom
cv/OC-760-module-freeze-commands

Conversation

@cvaske

@cvaske cvaske commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Add oc module freeze and oc module install-freeze commands

Implements a pip-style freeze/restore workflow for OpenCRAVAT modules.

oc module freeze outputs all installed modules as a JSON array with
name, version, and type fields. Use -i/--include-hidden to include
hidden modules. Output goes to stdout and can be redirected to a file.

oc module install-freeze reads a freeze JSON file and installs the
pinned versions. Analogous to pip install -r requirements.txt.

Options for oc module freeze:

  • -i, --include-hidden Include hidden modules in output
  • --md MD Specify the root directory of OpenCRAVAT modules

Options for oc module install-freeze:

  • freeze_file Path to freeze JSON file, or - to read from stdin
  • -f, --force Reinstall even if the correct version is already installed
  • -y, --yes Proceed without prompt
  • --skip-dependencies Skip installing dependencies
  • --md MD Specify the root directory of OpenCRAVAT modules

Example usage:

  # Save current module state
  oc module freeze > modules.json

  # Restore pinned modules on another system
  oc module install-freeze modules.json

  # Non-interactive restore
  oc module install-freeze -y modules.json

  # Pipe directly (no intermediate file)
  oc module freeze | oc module install-freeze -

  # Force reinstall of all pinned versions
  oc module install-freeze -f -y modules.json

cvaske added 2 commits March 17, 2026 21:32
Outputs installed modules as a JSON array with name, version, and type
fields, enabling environment snapshots (oc module freeze > modules.json).
Implements a pip-style freeze/restore workflow for OpenCRAVAT modules.

`oc module freeze` outputs all installed modules as a JSON array with
name, version, and type fields. Use `-i`/`--include-hidden` to include
hidden modules. Output goes to stdout and can be redirected to a file.

`oc module install-freeze` reads a freeze JSON file and installs the
pinned versions. Analogous to `pip install -r requirements.txt`.

Options for `oc module freeze`:
  -i, --include-hidden  Include hidden modules in output
  --md MD               Specify the root directory of OpenCRAVAT modules

Options for `oc module install-freeze`:
  freeze_file           Path to freeze JSON file, or - to read from stdin
  -f, --force           Reinstall even if the correct version is already installed
  -y, --yes             Proceed without prompt
  --skip-dependencies   Skip installing dependencies
  --md MD               Specify the root directory of OpenCRAVAT modules

Example usage:

  # Save current module state
  oc module freeze > modules.json

  # Restore pinned modules on another system
  oc module install-freeze modules.json

  # Non-interactive restore
  oc module install-freeze -y modules.json

  # Pipe directly (no intermediate file)
  oc module freeze | oc module install-freeze -

  # Force reinstall of all pinned versions
  oc module install-freeze -f -y modules.json
@kmoad

kmoad commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Please change --skip-dependencies to --include-dependencies. Default to only installing the modules in the freeze file without handling module dependencies. Most likely if a freeze file is missing a dependency it's intentional from the user.

@cvaske cvaske marked this pull request as draft March 23, 2026 18:47
@kmoad

kmoad commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Remove --include-hidden and make it the default. Include all modules that are installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants