runok migrate
runok migrate automatically updates deprecated config syntax to the latest format while preserving comments and formatting.
runok migrate [options]-c, --config <path>
Section titled “-c, --config <path>”See Global Flags. When omitted, runok discovers config files using the same logic as other commands: global config from $XDG_CONFIG_HOME/runok/ and project config from the nearest ancestor directory containing runok.yml.
What gets migrated
Section titled “What gets migrated”Sandbox fs legacy format
Section titled “Sandbox fs legacy format”The legacy writable/deny fields are rewritten to the new write.allow/write.deny structure:
# Beforefs: writable: [., /tmp] deny: [.env]
# Afterfs: write: allow: [., /tmp] deny: [.env]Bare ? in pattern strings
Section titled “Bare ? in pattern strings”A bare ? in a pattern string now means “optional value” (see Matching Behavior — Optional Flag Values). A pattern written before this change that relied on ? matching the literal character is rewritten to the escaped form \?, which keeps matching literal ?:
# Beforerules: - allow: 'git branch --abbrev ?'
# Afterrules: - allow: 'git branch --abbrev \?'This applies to every pattern-syntax field: rules[].{allow,deny,ask}, definitions.wrappers, definitions.flag_groups, definitions.aliases, and definitions.vars entries with type: pattern. rules[].tests are left untouched, since inline test commands are not patterns.
Claude Code legacy hook command
Section titled “Claude Code legacy hook command”An existing .claude/settings.json registration of the deprecated runok check --input-format claude-code-hook command is rewritten to runok hook --agent claude-code (both PreToolUse and PostToolUse entries):
// Before{ "type": "command", "command": "runok check --input-format claude-code-hook" }
// After{ "type": "command", "command": "runok hook --agent claude-code" }Unlike the config-chain migrations above, this one targets .claude/settings.json directly — at the user scope (~/.claude/settings.json) and the project scope (.claude/settings.json in the current directory), matching the locations runok init sets up. See runok hook — Migrating from runok check --input-format claude-code-hook for background.
Examples
Section titled “Examples”# Migrate all discovered config filesrunok migrate
# Migrate a specific filerunok migrate -c runok.yml