runok update-presets
runok update-presets updates all remote presets referenced in your configuration’s extends field. For branch references, it forces a re-fetch bypassing the TTL cache. For version-tagged references, it finds the latest compatible version and updates your config file.
runok update-presetsBehavior
Section titled “Behavior”- Collect references — Scans all configuration layers (global, global local override, project, project local override) for remote
extendsreferences (GitHub shorthand and git URLs). Local file references are ignored. - Skip immutable references — Presets pinned to a commit SHA (40-character hex) are permanently cached and skipped.
- Version tag upgrade — For references with a version tag, queries the remote repository for all available tags and finds the latest compatible version. The upgrade scope depends on the tag precision (see Version upgrade rules below). If a newer compatible version exists, fetches it and updates the
extendsentry in your config file. - Branch/Latest re-fetch — For non-version references (e.g.,
@main, no version), forces a re-fetch regardless of cache TTL. - Show diff — Displays a colored unified diff for any preset whose content changed.
- Summary — Prints a summary of how many presets were updated, upgraded, already up to date, skipped, or errored.
Examples
Section titled “Examples”Update all remote presets:
runok update-presetsExample output when a version tag is upgraded:
Upgraded: github:org/[email protected] → github:org/[email protected]--- a/runok.yml+++ b/runok.yml@@ -1,3 +1,3 @@ extends:- - github:org/[email protected]+ - github:org/[email protected]
Summary: 0 updated, 1 upgraded, 0 already up to date, 0 skipped, 0 errorsExample output when a branch reference has new content:
Updated: github:org/shared-rules@main (abc1234 → def5678)
Summary: 1 updated, 0 upgraded, 0 already up to date, 0 skipped, 0 errorsVersion upgrade rules
Section titled “Version upgrade rules”- Major-only tags (
v1,2): Upgraded to the latest major version (e.g.,@v1→@v2). Crosses major version boundaries. - Major.minor tags (
v1.0,1.2): Upgraded to the latest minor version within the same major (e.g.,@v1.0→@v1.3). Does not cross major version boundaries. - Full semver tags (
v1.0.0,1.2.3): Upgraded to the latest stable version within the same major version (e.g.,@v1.0.0→@v1.2.0). Does not cross major version boundaries. - Non-version tags (
main,stable): Treated as branch references and force-re-fetched. - Commit SHA (40-character hex): Skipped entirely (immutable).
- Pre-release exclusion: Pre-release versions (e.g.,
v2.0.0-beta.1) are never selected as upgrade candidates. - v-prefix matching: If your current tag uses a
vprefix (e.g.,v1), only tags with avprefix are considered as upgrade candidates, and vice versa.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | All presets updated successfully (or already up to date / skipped). |
| 1 | One or more presets failed to update. |
Related
Section titled “Related”- Extending configuration — How to use
extendsto share presets. - CLI Overview — All available commands.