Skip to main content
Version: 0.20.0

CLI Reference

Complete reference for all Invowk™ command-line commands and flags.

Global Flags​

These flags are available for all commands:

FlagShortDescription
--help-hShow help for the command
--ivk-colorControl color output for Invowk's own CLI output: auto (default), always, never. Precedence: --ivk-color > NO_COLOR / CLICOLOR_FORCE / TERM=dumb > TTY detection. Invalid values exit 2
--ivk-config-cConfig file path. Overrides INVOWK_CONFIG and the user config file; a missing or invalid file is an error (exit 1; invowk audit uses its scan-error code, 2). See which config file is used
--ivk-no-cwdIgnore the current directory's invowkfile.cue and *.invowkmod modules during command discovery (overrides INVOWK_NO_CWD)
--ivk-interactive-iRun commands in alternate screen buffer (interactive mode)
--ivk-verbose-vEnable verbose output
--versionShow version information (root command only, not inherited by subcommands)

Environment Variables​

VariableDescription
INVOWK_CONFIGAbsolute path of the config file to use when --ivk-config is not given. Empty means unset; a relative, missing or invalid value is an error (exit 1; invowk audit uses its scan-error code, 2). Never resolved against the current directory
INVOWK_NO_CWDSame as --ivk-no-cwd when the flag is not given. Accepts the values of Go's strconv.ParseBool (1, true, 0, false, ...); empty means off, anything else is an error (exit 2) in the commands that discover command sources
NO_COLORWhen non-empty, omits ANSI escape sequences from Invowk's own CLI output and renders Glamour issue cards with "notty" unless --ivk-color=always is passed
CLICOLOR_FORCEWhen non-empty and not "0", enables ANSI styling in non-TTY pipes for Invowk's own CLI output unless NO_COLOR is set or --ivk-color=never is passed
TERMTERM=dumb disables ANSI styling for Invowk's own CLI output unless CLICOLOR_FORCE or --ivk-color=always is set

Nested invowk calls inherit INVOWK_CONFIG and INVOWK_NO_CWD only when the caller set them, under the command's normal env_inherit_mode rules; the flag forms are never exported to child processes. User commands always receive raw, unwrapped stdout/stderr file descriptors, and invowk tui style / invowk tui format remain opt-in to ANSI styling in pipelines unless --ivk-color=never is passed. Color enablement is orthogonal to ui.color_scheme ("auto", "dark", "light"), which selects the theme when color is enabled.

Commands​

invowk​

The root command. Running invowk without arguments shows the help message.

invowk [flags]
invowk [command]

invowk cmd​

Execute commands defined in invowkfiles.

invowk cmd [flags]
invowk cmd [command-name] [flags] [-- args...]

Without a command name, invowk cmd lists the available commands: the root invowkfile first, then modules alphabetically, and within each source, commands alphabetically by full name (grouped by category, uncategorized first). Commands configured with passthrough: true are annotated with [passthrough].

Flags:

FlagShortDescription
--ivk-runtime-rOverride the runtime (must be allowed by the command)
--ivk-from-fSource to run command from (e.g., 'invowkfile' or module name)
--ivk-force-rebuildForce rebuild of container images (container runtime only)
--ivk-container-nameOverride the persistent container target name (container runtime only)
--ivk-dry-runPrint resolved execution plan without executing
--ivk-watch-WWatch mode: re-execute on file changes
--ivk-env-file-eLoad environment variables from file (repeatable)
--ivk-env-var-ESet environment variable (KEY=VALUE, repeatable); a value without KEY= is an error (exit 2), while KEY= sets an empty value
--ivk-env-inherit-modeInherit host environment variables: none, allow, all
--ivk-env-inherit-allowAllowlist host env vars to inherit; requires --ivk-env-inherit-mode=allow (repeatable)
--ivk-env-inherit-denyDenylist host env vars to inherit (repeatable)
--ivk-workdir-wOverride working directory for this command

:::note Pre-command --ivk-* boundary for passthrough commands All invowk cmd persistent --ivk-* flags are accepted before the command path as well as after normal commands. For commands with passthrough: true, only --ivk-* flags placed before the command path configure Invowk; every token after the command path (including --help, -h, unknown flags, --, and nested --ivk-* flags) is forwarded verbatim to the script across direct, @source, --ivk-from, and <source> <cmd> invocations. Because invowk cmd <name> --help executes the passthrough command, use invowk help cmd <name> to inspect Invowk's command help without executing. :::

note

The ivk-, invowk-, and i- prefixes are reserved for system flags and cannot be used for user-defined flags.

note

When --ivk-watch runs attached to a terminal with OSC7577_TOKEN set, Invowk emits signed OSC 7577 Program Resume reports (clear=1 on Ctrl+C or post-setup errors, preserved on Unix SIGHUP/SIGTERM, skipped when --ivk-env-var is passed or limits are exceeded) and strips OSC7577_TOKEN from watched child commands. On attached terminals, --ivk-watch and -i / invowk tui * also emit OSC 7501 Program Status (app="invowk", cleared on exit) while keeping non-interactive invowk cmd silent.

Examples:

# List all available commands
invowk cmd

# Run a command
invowk cmd build

# Run a nested command
invowk cmd test unit

# Run with a specific runtime
invowk cmd build --ivk-runtime container

# Run with arguments
invowk cmd greet -- "World"

# Run with flags
invowk cmd deploy --env production
# Watch mode (re-execute on file changes)
invowk cmd dev --ivk-watch
invowk cmd dev -W

# Dry-run mode (print execution plan, don't execute)
invowk cmd build --ivk-dry-run

Command Discovery:

Commands are discovered from (in priority order):

  1. Current directory invowkfile.cue (highest priority)
  2. Sibling *.invowkmod module directories
  3. Configured includes entries (modules only)
  4. ~/.invowk/cmds/ (modules only, non-recursive)

Command Disambiguation:

When a command name exists in multiple sources (e.g., both invowkfile.cue and a module), you must disambiguate:

Using @source prefix:

invowk cmd @invowkfile deploy # Run deploy from invowkfile
invowk cmd @tools deploy # Run deploy from tools.invowkmod
invowk cmd @tools.invowkmod deploy # Full module name also works

Using --ivk-from flag:

invowk cmd --ivk-from invowkfile deploy
invowk cmd --ivk-from tools deploy

If you run an ambiguous command without disambiguation, invowk shows an error listing available sources.

tip

You can use @source or --ivk-from even for unique command names to be explicit about where a command comes from.


invowk init​

Create a new invowkfile in the current directory.

invowk init [flags] [filename]

Optionally pass a custom filename to write.

Flags:

FlagShortDescription
--force-fOverwrite existing invowkfile
--template-tTemplate to use: default, minimal, full

Templates:

  • default - A hello command demonstrating the platform-split pattern across the built-in runtime options
  • minimal - Bare minimum invowkfile structure
  • full - Template demonstrating subcommands, flags, environment configuration, and command dependencies

Examples:

# Create a default invowkfile
invowk init

# Create a minimal invowkfile
invowk init --template minimal

# Overwrite existing invowkfile
invowk init --force

invowk config​

Manage Invowk configuration.

invowk config [command]

Subcommands:

invowk config show​

Display current configuration in a readable format.

invowk config show

invowk config dump​

Output raw configuration as CUE.

invowk config dump

invowk config path​

Show configuration paths (config directory, file, and commands directory).

invowk config path

invowk config init​

Create a default configuration file.

invowk config init

invowk config set​

Set a configuration value.

invowk config set <key> <value>

Examples:

# Set container engine
invowk config set container_engine podman

# Set default runtime
invowk config set default_runtime virtual-sh

# Set UI options
invowk config set ui.color_scheme dark
invowk config set ui.verbose true
invowk config set ui.interactive false

# Set virtual runtime options
invowk config set virtual.utilities.enabled true

invowk module​

Manage invowk modules (self-contained command folders).

:::tip Alias mod is an alias for module. For example, invowk mod list works the same as invowk module list. :::

invowk module [command]

Subcommands:

invowk module create​

Create a new invowk module.

invowk module create <name> [flags]

Flags:

FlagShortDescription
--path-pParent directory for the module (default: current directory)
--scriptsCreate a scripts/ subdirectory
--module-id-gModule identifier for invowkmod.cue (default: module name)
--description-dDescription for invowkmod.cue

Examples:

# Create a module with RDNS naming
invowk module create com.example.mytools

# Override module ID and description
invowk module create mytools --module-id com.example.tools --description "Shared tools"

# Create with scripts directory
invowk module create mytools --scripts

invowk module list​

List all discovered modules.

invowk module list

invowk module archive​

Create a ZIP archive from a module.

invowk module archive <path> [flags]

Flags:

FlagShortDescription
--output-oOutput file path

invowk module import​

Import a module from a ZIP file or URL.

invowk module import <source> [flags]

Flags:

FlagShortDescription
--path-pOutput directory
--overwriteOverwrite existing module if present

invowk module add​

Resolve a module dependency, update the lock file, and add the requirement to invowkmod.cue.

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

Flags:

FlagDescription
--aliasAlias for the module command source ID
--pathSubdirectory path within the repository

Examples:

invowk module add https://github.com/user/utils.git ^1.0.0
invowk module add git@github.com:user/tools.git ~2.1.0 --alias mytools
invowk module add https://github.com/user/monorepo.git ^1.0.0 --path packages/io.example.cli.invowkmod

invowk module remove​

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

invowk module remove <identifier>

invowk module sync​

Sync dependencies from invowkmod.cue.

invowk module sync

invowk module update​

Update module dependencies to latest matching versions.

invowk module update [identifier]

invowk module tidy​

Add missing transitive dependencies to invowkmod.cue. Invowk uses an explicit-only dependency model (like Go modules): every module in the dependency tree must be declared in your root invowkmod.cue. This command scans resolved modules and auto-adds any missing transitive requirements.

invowk module tidy

invowk module deps​

List resolved module dependencies.

invowk module deps

invowk module vendor​

Vendor dependencies into invowk_modules/.

invowk module vendor [module-path]

Flags:

FlagDescription
--updateForce re-fetch of all dependencies
--pruneRemove unused vendored modules
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.


invowk tui​

Interactive terminal UI components for shell scripts.

invowk tui [command] [flags]
tip

TUI components work great in invowkfile scripts! They provide interactive prompts, spinners, file pickers, and more.

Subcommands:

invowk tui input​

Prompt for single-line text input.

invowk tui input [flags]

Flags:

FlagDescription
--titleTitle for the input prompt
--descriptionDescription below the title
--placeholderPlaceholder text
--valueInitial value
--char-limitCharacter limit
--widthInput field width
--passwordHide input (for passwords)
--promptPrompt character(s) before input

invowk tui write​

Multi-line text editor.

invowk tui write [flags]

Flags:

FlagDescription
--titleTitle for the editor
--descriptionDescription below the title
--placeholderPlaceholder text
--valueInitial value
--char-limitCharacter limit
--widthEditor width
--heightEditor height
--show-line-numbersShow line numbers

invowk tui choose​

Select from a list of options.

invowk tui choose [options...] [flags]

Flags:

FlagDescription
--titleTitle for the selection
--limitMaximum number of selections (default: 1)
--no-limitAllow unlimited selections
--heightList height

invowk tui confirm​

Prompt for yes/no confirmation.

invowk tui confirm [prompt] [flags]

Flags:

FlagDescription
--titleTitle displayed above the prompt
--defaultDefault to yes when present
--affirmativeText for "yes" option
--negativeText for "no" option

invowk tui filter​

Fuzzy filter a list of options.

invowk tui filter [options...] [flags]

Options can also be provided via stdin.

Flags:

FlagDescription
--titleTitle displayed above the filter
--placeholderPlaceholder text
--widthFilter width
--heightList height
--limitMaximum selections (default: 1)
--no-limitAllow unlimited selections
--reverseDisplay list in reverse order
--fuzzyEnable fuzzy matching

invowk tui file​

File picker.

invowk tui file [path] [flags]

Flags:

FlagDescription
--titleTitle displayed above the picker
--descriptionDescription below the title
--directoryOnly show directories
--fileShow files (default: true)
--hiddenShow hidden files
--heightPicker height
--allowedAllowed file extensions

invowk tui table​

Display and select from a table.

invowk tui table [flags]

Reads CSV or TSV data from file or stdin.

Flags:

FlagDescription
--fileCSV file to display
--separatorColumn separator (default: ,)
--columnsColumn headers (override file header)
--widthsColumn widths
--heightTable height
--selectableEnable row selection

invowk tui spin​

Show a spinner while running a command.

invowk tui spin [flags] -- command [args...]

Flags:

FlagDescription
--titleSpinner title
--typeSpinner style

invowk tui pager​

Scroll through content.

invowk tui pager [file] [flags]

Reads from file or stdin.

Flags:

FlagDescription
--titleTitle displayed above the pager
--line-numbersShow line numbers
--soft-wrapSoft wrap long lines

invowk tui format​

Format text with markdown, code, emoji, or templates.

invowk tui format [text...] [flags]

Flags:

FlagDescription
--typeFormat type: markdown, code, emoji, template
--languageLanguage for code highlighting
--themeGlamour theme for code highlighting

invowk tui style​

Apply styles to text.

invowk tui style [text...] [flags]

Flags:

FlagDescription
--foregroundText color (hex or name)
--backgroundBackground color
--boldBold text
--italicItalic text
--underlineUnderlined text
--strikethroughStrikethrough text
--faintDimmed text
--blinkBlinking text
--reverseReverse colors
--margin-*Margins (left/right/top/bottom)
--padding-*Padding (left/right/top/bottom)
--widthFixed width
--heightFixed height
--alignText alignment
--borderBorder style: none, normal, rounded, double, thick, hidden

invowk validate​

Validate invowkfiles, modules, or the entire workspace.

invowk validate [path]

Without arguments, validates the current workspace by running full discovery and reporting all diagnostics from every search path.

With a path argument, auto-detects the target type:

PathValidation
*.invowkmod directoryModule validation (structure, plus invowkfile parsing and command tree when invowkfile.cue is present)
invowkfile.cue fileInvowkfile validation (CUE schema + structural + command tree)
Directory with invowkfile.cueInvowkfile validation
invowkmod.cue fileModule validation (parent directory)
tip

invowk validate performs deep validation on module structure and metadata. When the module contains invowkfile.cue, it also parses that file and validates its command tree; library-only modules do not run those file-specific checks.

Examples:

# Validate the entire workspace (discovery + diagnostics)
invowk validate

# Validate a single invowkfile
invowk validate ./invowkfile.cue

# Validate a module (always includes deep validation)
invowk validate ./mymod.invowkmod

# Validate a directory containing an invowkfile
invowk validate ./my-project/

invowk audit​

Scan for security risks in invowkfiles, modules, and scripts. See the Security Auditing guide for full documentation.

invowk audit [path] [flags]

Flags:

FlagDefaultDescription
--formattextOutput format: text, json
--severitylowMinimum severity: info, low, medium, high, critical
--include-globalfalseInclude ~/.invowk/cmds/ in scan
--llm-providerAuto-detect or force provider: auto, claude, codex, gemini, ollama
--llmfalseEnable LLM using configured or API settings
--llm-urlhttp://localhost:11434/v1OpenAI-compatible API base URL
--llm-modelAPI/Ollama fallback: qwen2.5-coder:7b; CLI provider tool default when omittedModel name; required for cloud API providers and optional for CLI providers
--llm-api-key(empty)API key (empty for local servers)
--llm-timeout2mPer-request timeout
--llm-concurrency2Max parallel LLM requests

--llm and --llm-provider are mutually exclusive. Use --llm for the configured/API backend and --llm-provider to force provider detection.

Exit codes: 0 = clean, 1 = findings detected, 2 = scan error.

Examples:

# Scan current workspace
invowk audit

# Scan a single module
invowk audit ./tools.invowkmod

# Scan with high severity threshold
invowk audit --severity high

# JSON output for CI pipelines
invowk audit --format json --severity high

# Include global modules in scan
invowk audit --include-global

# Auto-detect LLM provider
invowk audit --llm-provider auto

# Use specific provider (Claude Code, Codex CLI, Gemini CLI)
invowk audit --llm-provider claude

# Manual LLM with custom server
invowk audit --llm --llm-url http://localhost:1234/v1

invowk agent guide​

Print a compact coding-agent orientation guide covering Invowk's mental model, hard invariants, dynamic top-level CLI tree, verification workflow, and deep-dive topics (runtimes, modules, config, security, cli).

invowk agent guide [topic] [flags]

Flags:

FlagDefaultDescription
--formattextOutput format: text, json

invowk agent schema​

Print an index of embedded CUE schemas (invowkfile, invowkmod, config) or print one verbatim schema without generation-prompt wrappers.

invowk agent schema [invowkfile|invowkmod|config] [flags]

Flags:

FlagDefaultDescription
--formattextOutput format: text, json

invowk agent audit prompt​

Print the embedded security-audit LLM system prompt and (with --format json) structured findings JSON schema used by invowk audit --llm.

invowk agent audit prompt [flags]

Flags:

FlagDefaultDescription
--formattextOutput format: text, json

invowk agent cmd prompt​

Print operation-aware system prompts that LLM agents should use when authoring custom Invowk commands.

invowk agent cmd prompt [operation] [flags]

The optional operation is create, change, or remove. Omit it to print all three operation prompts.

Flags:

FlagDefaultDescription
--formattextOutput format: text, json

invowk agent cmd create​

Generate one custom command with an LLM, validate it, and patch invowkfile.cue. The generated command name must match <name>. See LLM-Assisted Agent Authoring for the full workflow.

invowk agent cmd create <name> [description...] [flags]

Flags:

FlagDefaultDescription
--fileinvowkfile.cueInvowkfile to update
--from-fileRead the command request from a file
--dry-runfalsePrint the patch without writing
--printfalsePrint only the generated command CUE
--verifyfalseAfter writing, resolve the generated command with a dry-run execution plan
--llm-providerAuto-detect or force provider: auto, claude, codex, gemini, ollama
--llmfalseEnable LLM using configured or API settings
--llm-urlhttp://localhost:11434/v1OpenAI-compatible API base URL
--llm-modelAPI/Ollama fallback: qwen2.5-coder:7b; CLI provider tool default when omittedModel name; required for cloud API providers and optional for CLI providers
--llm-api-key(empty)API key (empty for local servers)
--llm-timeout2mPer-request timeout
--llm-concurrency2Max parallel LLM requests

invowk agent cmd change​

Generate a replacement for one existing custom command with an LLM. The generated command name must still match <name>, and only that command is replaced.

invowk agent cmd change <name> [description...] [flags]

Flags: same as agent cmd create.

invowk agent cmd remove​

Remove one custom command from an invowkfile without resolving an LLM provider.

invowk agent cmd remove <name> [flags]

Flags:

FlagDefaultDescription
--fileinvowkfile.cueInvowkfile to update
--dry-runfalsePrint the patch without writing

invowk agent mod prompt​

Print operation-aware system prompts that LLM agents should use when authoring local Invowk modules.

invowk agent mod prompt [operation] [flags]

The optional operation is create, change, or remove. Omit it to print all three operation prompts.

Flags:

FlagDefaultDescription
--formattextOutput format: text, json

invowk agent mod create​

Generate invowkmod.cue and invowkfile.cue for <module-id>.invowkmod with an LLM. The generated module ID must match <module-id>.

invowk agent mod create <module-id> [description...] [flags]

Flags:

FlagDefaultDescription
--from-fileRead the module request from a file
--dry-runfalsePrint the file patches without writing
--printfalsePrint the generated module file bundle without writing
--verifyfalseAfter writing, validate the generated module
--scriptsfalseCreate an empty scripts/ directory with .gitkeep
--llm-providerAuto-detect or force provider: auto, claude, codex, gemini, ollama
--llmfalseEnable LLM using configured or API settings
--llm-urlhttp://localhost:11434/v1OpenAI-compatible API base URL
--llm-modelAPI/Ollama fallback: qwen2.5-coder:7b; CLI provider tool default when omittedModel name; required for cloud API providers and optional for CLI providers
--llm-api-key(empty)API key (empty for local servers)
--llm-timeout2mPer-request timeout
--llm-concurrency2Max parallel LLM requests

invowk agent mod change​

Generate replacements for invowkmod.cue and invowkfile.cue in an existing local module. No other module files are generated or edited.

invowk agent mod change <module-id-or-path> [description...] [flags]

Flags: same as agent mod create, except --scripts is not supported.

invowk agent mod remove​

Remove one validated local module directory without editing dependencies or lock files. Deletion requires --force; use --dry-run to preview the deletion plan.

invowk agent mod remove <module-id-or-path> [flags]

Flags:

FlagDefaultDescription
--dry-runfalsePrint the deletion plan without removing the module
--forcefalseDelete the validated module directory

Provide either description arguments or --from-file; they are mutually exclusive. --llm and --llm-provider are mutually exclusive. --dry-run and --print are mutually exclusive. --verify requires writing the invowkfile and cannot be combined with --dry-run or --print. For invowk agent cmd, --verify currently supports only the current directory target (./invowkfile.cue); combining --verify with --file for another path fails with exit status 2 before calling an LLM. For invowk agent mod, --verify validates the written module directory directly.

Examples:

# Coding-agent onboarding and raw schema inspection
invowk agent guide
invowk agent guide --format json
invowk agent guide security
invowk agent schema invowkfile
invowk agent audit prompt --format json

# Print the command-authoring system prompt
invowk agent cmd prompt

# Generate and add a command with provider auto-detection
invowk agent cmd create format --llm-provider auto 'add a format command'

# Preview instead of writing
invowk agent cmd create test --llm-provider codex --dry-run 'add a test command'

# Change an existing command
invowk agent cmd change lint --llm-provider claude 'improve the lint command'

# Verify the written command can resolve to an execution plan
invowk agent cmd create release --llm-provider codex --verify 'add a release command'

# Read the request from a file
invowk agent cmd create docs --llm-provider gemini --from-file command-request.md

# Author a local module
invowk agent mod create io.example.tools --llm-provider codex 'create project tools'
invowk agent mod change io.example.tools --llm-provider codex 'add formatter'
invowk agent mod remove io.example.tools --dry-run

invowk completion​

Generate shell completion scripts. Bash completions use Cobra's Bash V2 format (bash-completion v2+).

invowk completion [bash|zsh|fish|powershell] [--alias <name>] [--prefix <tokens>]

Shells: bash, zsh, fish, powershell

Flags:

FlagDefaultDescription
--aliasCommand name to bind generated completions to (alphanumeric start; [a-zA-Z0-9._-] only) with namespace-safe helper identifiers
--prefixShell-quoted tokens prepended to invowk __complete (cannot be used without --alias; rejects NUL, newlines, and unclosed quotes; escaped per target shell)

Examples:

# Bash (V2; requires bash-completion v2+)
eval "$(invowk completion bash)"

# Zsh
eval "$(invowk completion zsh)"

# Fish
invowk completion fish > ~/.config/fish/completions/invowk.fish

# PowerShell
invowk completion powershell | Out-String | Invoke-Expression

Standalone Wrapper Aliases:

Use --alias and --prefix when exposing a module as a standalone wrapper command (for example cst wrapping invowk -c <config> --ivk-no-cwd --ivk-color=auto cmd cst "$@"). Generated scripts isolate helper function names from invowk's own completions and shell-escape each prefix token before invowk __complete:

# Example standalone wrapper (/usr/local/bin/cst):
#!/usr/bin/env sh
exec invowk -c /etc/cst/config.cue --ivk-no-cwd --ivk-color=auto cmd cst "$@"

# Generate shell completions bound to 'cst' (non-colliding with 'invowk'):
eval "$(invowk completion bash --alias cst --prefix "-c /etc/cst/config.cue --ivk-no-cwd cmd cst")"
eval "$(invowk completion zsh --alias cst --prefix "-c /etc/cst/config.cue --ivk-no-cwd cmd cst")"
invowk completion fish --alias cst --prefix "-c /etc/cst/config.cue --ivk-no-cwd cmd cst" > ~/.config/fish/completions/cst.fish
invowk completion powershell --alias cst --prefix "-c /etc/cst/config.cue --ivk-no-cwd cmd cst" | Out-String | Invoke-Expression

invowk help​

Show help for any command.

invowk help [command]

Examples:

invowk help
invowk help cmd
invowk help config set

Exit Codes​

Invowk uses these exit-code classes:

CodeMeaning
0The invocation succeeded. A bare command group (for example invowk module or invowk cmd test) prints its help and exits 0.
NA user-defined command ran and exited with its own non-zero status N, forwarded unchanged for every runtime.
128 + signalOn Unix, Invowk terminated because it received a trapped termination signal (129 SIGHUP, 130 SIGINT, 143 SIGTERM) after bounded resource cleanup, except where a built-in defines another code (such as invowk tui spin).
2Invowk rejected the command line before running any user command code.
1Invowk itself failed for any other reason.

Exit status 2 covers:

  • an unknown flag, a flag value that does not parse, a flag without its required value, or a missing required flag, at any level;
  • an unknown command, including a typo under a command group and an unknown root command followed by --help, -h or --version (invowk cmd test nonexistent, invowk config bogus); the group's subcommands are listed on stderr and nothing is written to stdout;
  • an argument-count error on a built-in command (invowk init a b c);
  • a command name under invowk cmd that is not found or is ambiguous across sources, an unknown @source or --ivk-from source, a malformed source name such as a path (@./m.invowkmod; name the module m instead), and a source filter without a command name;
  • declared arguments or flags that fail validation;
  • an invalid reserved --ivk-* flag value, such as an invalid --ivk-color mode (auto, always, never), an unknown --ivk-runtime or a runtime the command does not allow, an unknown --ivk-env-inherit-mode, an invalid --ivk-env-inherit-allow/--ivk-env-inherit-deny name, a whitespace-only --ivk-workdir, an empty --ivk-env-file, an invalid --ivk-container-name, or an --ivk-env-var value without KEY=;
  • an invowk agent error detected from the command line alone, such as an invalid name, mutually exclusive flags, a missing description, an invalid --llm-* value, or an unknown guide topic, schema target, prompt format, or operation;
  • an invalid invowk completion --alias or --prefix value (including --prefix without --alias, NUL/newline characters, or unclosed quotes);
  • a conflict decided by flags and environment variables alone: an invalid INVOWK_NO_CWD value, --ivk-watch together with --ivk-dry-run, invowk config set while --ivk-config or INVOWK_CONFIG is active, and invowk agent cmd create/change --verify under --ivk-no-cwd, INVOWK_NO_CWD, or a non-default --file.

Exit status 1 covers everything else: config errors that abort the command, including a config file named by --ivk-config or INVOWK_CONFIG that is missing or invalid, or a relative INVOWK_CONFIG; discovery errors; current-directory source failures (unless --ivk-no-cwd or INVOWK_NO_CWD is active), where a ./invowkfile.cue or ./*.invowkmod fails parse, schema, or invowk_version validation and aborts invowk cmd immediately with its underlying error rather than falling back to lower-precedence sources; invalid invowkfiles or command trees, including a command that is not found while a non-current-directory invowkfile or module was skipped because it failed to parse or load (the command may be defined there; the error names each skipped source and its diagnostic code, and a miss inside an @source or --ivk-from source that loaded still exits 2); unsatisfied depends_on checks; an unsupported host platform; an unavailable container engine or runtime; command timeouts (timeout) and non-signal cancellations; and invowk agent failures that need files, the config or an LLM.

On Unix, trapped termination signals (SIGHUP = 1, SIGINT = 2, SIGTERM = 15) cancel the active execution context, clean up temporary scripts, terminate non-TTY native child process groups, and stop/remove ephemeral containers within a bounded cleanup window before exiting with 128 + signal (129, 130, 143). Direct controlling-TTY native runs stay in the terminal's foreground process group so interactive prompts do not block on SIGTTIN/SIGTTOU. On Windows, Ctrl+C (os.Interrupt) cancels the execution context, cleans up resources, and exits with status 1.

Per-command exceptions:

CommandCodes
invowk audit0 clean, 1 findings detected, 2 scan or configuration error; command-line rejections also exit 2
invowk tui confirm1 when the user declines
invowk tui spinthe wrapped command's exit code; 1 when cancelled with Ctrl+C, when a signal ended the command, or when it was still running 15 seconds after it was stopped
invowk validate1 when validation finds errors
note

When forwarding a command or built-in exit status (invowk cmd, invowk audit, invowk validate, invowk tui confirm, invowk tui spin) without an Invowk error message, Invowk forwards the exit status quietly on both TTY and non-TTY streams without printing an Exit status N banner. Pass --ivk-verbose to emit a single diagnostic status line on stderr.

A user command can exit with 1 or 2 itself, and a nested invowk call inside a script can propagate its own usage error. A wrapper that must tell these cases apart reads stderr. The contract is only exact for commands whose scripts avoid codes 1 and 2.

Container-engine and OCI-runtime failures (exit codes 125 and 126) are retried as transient. After the retries run out, the code is forwarded as if it were the command's own.

Error Messages​

Invowk provides specific error messages to help diagnose issues:

No Invowkfile Found​

When no invowkfile is discovered in any search location:

# No invowkfile found!

We searched for an invowkfile but couldn't find one in the expected locations.

## Search locations (in order of precedence):
1. Current directory (invowkfile and sibling modules)
2. Configured includes (module paths from config)
3. ~/.invowk/cmds/ (modules only)

## Things you can try:
• Create an invowkfile in your current directory:
$ invowk init

• Or specify a different directory:
$ cd /path/to/your/project

This message appears when:

  • No invowkfile.cue exists in the current directory
  • No modules exist in configured includes
  • No modules exist in ~/.invowk/cmds/

Solutions:

  • Run invowk init to create an invowkfile in the current directory
  • Navigate to a directory containing an invowkfile
  • Add module paths to your config's includes

Failed to Parse Invowkfile​

When an invowkfile is found but contains syntax errors or invalid configuration:

✗ Failed to parse /path/to/invowkfile.cue: invowkfile validation failed:
#Invowkfile.cmds.0.implementations.0.runtimes.0.name: 3 errors in empty disjunction

# Failed to parse invowkfile!

Your invowkfile contains syntax errors or invalid configuration.

## Common issues:
- Invalid CUE syntax (missing quotes, braces, etc.)
- Unknown field names
- Invalid values for known fields
- Missing required fields (name, script for commands)

## Things you can try:
- Check the error message above for the specific line/column
- Validate your CUE syntax using the cue command-line tool
- Run with verbose mode for more details:
$ invowk --ivk-verbose cmd

This message appears when:

  • CUE syntax errors (missing braces, quotes, etc.)
  • Invalid field names or values
  • Schema validation failures (e.g., invalid runtime type)
  • Missing required fields

Solutions:

  • Check the specific error message shown above the help text
  • Validate your CUE syntax: cue vet invowkfile.cue
  • Run with verbose mode: invowk --ivk-verbose cmd
  • Compare against the invowkfile schema reference
tip

The error message always shows the specific parsing error first (e.g., which field failed validation), followed by general troubleshooting guidance.