CLI Reference
Complete reference for all Invowk™ command-line commands and flags.
Global Flags
These flags are available for all commands:
| Flag | Short | Description |
|---|---|---|
--help | -h | Show help for the command |
--ivk-color | Control 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 | -c | Config 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-cwd | Ignore the current directory's invowkfile.cue and *.invowkmod modules during command discovery (overrides INVOWK_NO_CWD) | |
--ivk-interactive | -i | Run commands in alternate screen buffer (interactive mode) |
--ivk-verbose | -v | Enable verbose output |
--version | Show version information (root command only, not inherited by subcommands) |
Environment Variables
| Variable | Description |
|---|---|
INVOWK_CONFIG | Absolute 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_CWD | Same 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_COLOR | When 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_FORCE | When 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 |
TERM | TERM=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:
| Flag | Short | Description |
|---|---|---|
--ivk-runtime | -r | Override the runtime (must be allowed by the command) |
--ivk-from | -f | Source to run command from (e.g., 'invowkfile' or module name) |
--ivk-force-rebuild | Force rebuild of container images (container runtime only) | |
--ivk-container-name | Override the persistent container target name (container runtime only) | |
--ivk-dry-run | Print resolved execution plan without executing | |
--ivk-watch | -W | Watch mode: re-execute on file changes |
--ivk-env-file | -e | Load environment variables from file (repeatable) |
--ivk-env-var | -E | Set environment variable (KEY=VALUE, repeatable); a value without KEY= is an error (exit 2), while KEY= sets an empty value |
--ivk-env-inherit-mode | Inherit host environment variables: none, allow, all | |
--ivk-env-inherit-allow | Allowlist host env vars to inherit; requires --ivk-env-inherit-mode=allow (repeatable) | |
--ivk-env-inherit-deny | Denylist host env vars to inherit (repeatable) | |
--ivk-workdir | -w | Override 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.
:::
The ivk-, invowk-, and i- prefixes are reserved for system flags and cannot be used for user-defined flags.
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):
- Current directory invowkfile.cue (highest priority)
- Sibling
*.invowkmodmodule directories - Configured
includesentries (modules only) ~/.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.
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:
| Flag | Short | Description |
|---|---|---|
--force | -f | Overwrite existing invowkfile |
--template | -t | Template to use: default, minimal, full |
Templates:
default- Ahellocommand demonstrating the platform-split pattern across the built-in runtime optionsminimal- Bare minimum invowkfile structurefull- 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:
| Flag | Short | Description |
|---|---|---|
--path | -p | Parent directory for the module (default: current directory) |
--scripts | Create a scripts/ subdirectory | |
--module-id | -g | Module identifier for invowkmod.cue (default: module name) |
--description | -d | Description 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:
| Flag | Short | Description |
|---|---|---|
--output | -o | Output file path |
invowk module import
Import a module from a ZIP file or URL.
invowk module import <source> [flags]
Flags:
| Flag | Short | Description |
|---|---|---|
--path | -p | Output directory |
--overwrite | Overwrite 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:
| Flag | Description |
|---|---|
--alias | Alias for the module command source ID |
--path | Subdirectory 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:
| Flag | Description |
|---|---|
--update | Force re-fetch of all dependencies |
--prune | Remove unused vendored modules |
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]
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:
| Flag | Description |
|---|---|
--title | Title for the input prompt |
--description | Description below the title |
--placeholder | Placeholder text |
--value | Initial value |
--char-limit | Character limit |
--width | Input field width |
--password | Hide input (for passwords) |
--prompt | Prompt character(s) before input |
invowk tui write
Multi-line text editor.
invowk tui write [flags]
Flags:
| Flag | Description |
|---|---|
--title | Title for the editor |
--description | Description below the title |
--placeholder | Placeholder text |
--value | Initial value |
--char-limit | Character limit |
--width | Editor width |
--height | Editor height |
--show-line-numbers | Show line numbers |
invowk tui choose
Select from a list of options.
invowk tui choose [options...] [flags]
Flags:
| Flag | Description |
|---|---|
--title | Title for the selection |
--limit | Maximum number of selections (default: 1) |
--no-limit | Allow unlimited selections |
--height | List height |
invowk tui confirm
Prompt for yes/no confirmation.
invowk tui confirm [prompt] [flags]
Flags:
| Flag | Description |
|---|---|
--title | Title displayed above the prompt |
--default | Default to yes when present |
--affirmative | Text for "yes" option |
--negative | Text 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:
| Flag | Description |
|---|---|
--title | Title displayed above the filter |
--placeholder | Placeholder text |
--width | Filter width |
--height | List height |
--limit | Maximum selections (default: 1) |
--no-limit | Allow unlimited selections |
--reverse | Display list in reverse order |
--fuzzy | Enable fuzzy matching |
invowk tui file
File picker.
invowk tui file [path] [flags]
Flags:
| Flag | Description |
|---|---|
--title | Title displayed above the picker |
--description | Description below the title |
--directory | Only show directories |
--file | Show files (default: true) |
--hidden | Show hidden files |
--height | Picker height |
--allowed | Allowed 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:
| Flag | Description |
|---|---|
--file | CSV file to display |
--separator | Column separator (default: ,) |
--columns | Column headers (override file header) |
--widths | Column widths |
--height | Table height |
--selectable | Enable row selection |
invowk tui spin
Show a spinner while running a command.
invowk tui spin [flags] -- command [args...]
Flags:
| Flag | Description |
|---|---|
--title | Spinner title |
--type | Spinner style |
invowk tui pager
Scroll through content.
invowk tui pager [file] [flags]
Reads from file or stdin.
Flags:
| Flag | Description |
|---|---|
--title | Title displayed above the pager |
--line-numbers | Show line numbers |
--soft-wrap | Soft wrap long lines |
invowk tui format
Format text with markdown, code, emoji, or templates.
invowk tui format [text...] [flags]
Flags:
| Flag | Description |
|---|---|
--type | Format type: markdown, code, emoji, template |
--language | Language for code highlighting |
--theme | Glamour theme for code highlighting |
invowk tui style
Apply styles to text.
invowk tui style [text...] [flags]
Flags:
| Flag | Description |
|---|---|
--foreground | Text color (hex or name) |
--background | Background color |
--bold | Bold text |
--italic | Italic text |
--underline | Underlined text |
--strikethrough | Strikethrough text |
--faint | Dimmed text |
--blink | Blinking text |
--reverse | Reverse colors |
--margin-* | Margins (left/right/top/bottom) |
--padding-* | Padding (left/right/top/bottom) |
--width | Fixed width |
--height | Fixed height |
--align | Text alignment |
--border | Border 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:
| Path | Validation |
|---|---|
*.invowkmod directory | Module validation (structure, plus invowkfile parsing and command tree when invowkfile.cue is present) |
invowkfile.cue file | Invowkfile validation (CUE schema + structural + command tree) |
Directory with invowkfile.cue | Invowkfile validation |
invowkmod.cue file | Module validation (parent directory) |
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:
| Flag | Default | Description |
|---|---|---|
--format | text | Output format: text, json |
--severity | low | Minimum severity: info, low, medium, high, critical |
--include-global | false | Include ~/.invowk/cmds/ in scan |
--llm-provider | Auto-detect or force provider: auto, claude, codex, gemini, ollama | |
--llm | false | Enable LLM using configured or API settings |
--llm-url | http://localhost:11434/v1 | OpenAI-compatible API base URL |
--llm-model | API/Ollama fallback: qwen2.5-coder:7b; CLI provider tool default when omitted | Model name; required for cloud API providers and optional for CLI providers |
--llm-api-key | (empty) | API key (empty for local servers) |
--llm-timeout | 2m | Per-request timeout |
--llm-concurrency | 2 | Max 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:
| Flag | Default | Description |
|---|---|---|
--format | text | Output 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:
| Flag | Default | Description |
|---|---|---|
--format | text | Output 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:
| Flag | Default | Description |
|---|---|---|
--format | text | Output 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:
| Flag | Default | Description |
|---|---|---|
--format | text | Output 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:
| Flag | Default | Description |
|---|---|---|
--file | invowkfile.cue | Invowkfile to update |
--from-file | Read the command request from a file | |
--dry-run | false | Print the patch without writing |
--print | false | Print only the generated command CUE |
--verify | false | After writing, resolve the generated command with a dry-run execution plan |
--llm-provider | Auto-detect or force provider: auto, claude, codex, gemini, ollama | |
--llm | false | Enable LLM using configured or API settings |
--llm-url | http://localhost:11434/v1 | OpenAI-compatible API base URL |
--llm-model | API/Ollama fallback: qwen2.5-coder:7b; CLI provider tool default when omitted | Model name; required for cloud API providers and optional for CLI providers |
--llm-api-key | (empty) | API key (empty for local servers) |
--llm-timeout | 2m | Per-request timeout |
--llm-concurrency | 2 | Max 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:
| Flag | Default | Description |
|---|---|---|
--file | invowkfile.cue | Invowkfile to update |
--dry-run | false | Print 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:
| Flag | Default | Description |
|---|---|---|
--format | text | Output 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:
| Flag | Default | Description |
|---|---|---|
--from-file | Read the module request from a file | |
--dry-run | false | Print the file patches without writing |
--print | false | Print the generated module file bundle without writing |
--verify | false | After writing, validate the generated module |
--scripts | false | Create an empty scripts/ directory with .gitkeep |
--llm-provider | Auto-detect or force provider: auto, claude, codex, gemini, ollama | |
--llm | false | Enable LLM using configured or API settings |
--llm-url | http://localhost:11434/v1 | OpenAI-compatible API base URL |
--llm-model | API/Ollama fallback: qwen2.5-coder:7b; CLI provider tool default when omitted | Model name; required for cloud API providers and optional for CLI providers |
--llm-api-key | (empty) | API key (empty for local servers) |
--llm-timeout | 2m | Per-request timeout |
--llm-concurrency | 2 | Max 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:
| Flag | Default | Description |
|---|---|---|
--dry-run | false | Print the deletion plan without removing the module |
--force | false | Delete 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:
| Flag | Default | Description |
|---|---|---|
--alias | Command name to bind generated completions to (alphanumeric start; [a-zA-Z0-9._-] only) with namespace-safe helper identifiers | |
--prefix | Shell-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:
| Code | Meaning |
|---|---|
0 | The invocation succeeded. A bare command group (for example invowk module or invowk cmd test) prints its help and exits 0. |
N | A user-defined command ran and exited with its own non-zero status N, forwarded unchanged for every runtime. |
128 + signal | On 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). |
2 | Invowk rejected the command line before running any user command code. |
1 | Invowk 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,-hor--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 cmdthat is not found or is ambiguous across sources, an unknown@sourceor--ivk-fromsource, a malformed source name such as a path (@./m.invowkmod; name the moduleminstead), 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-colormode (auto,always,never), an unknown--ivk-runtimeor a runtime the command does not allow, an unknown--ivk-env-inherit-mode, an invalid--ivk-env-inherit-allow/--ivk-env-inherit-denyname, a whitespace-only--ivk-workdir, an empty--ivk-env-file, an invalid--ivk-container-name, or an--ivk-env-varvalue withoutKEY=; - an
invowk agenterror 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--aliasor--prefixvalue (including--prefixwithout--alias, NUL/newline characters, or unclosed quotes); - a conflict decided by flags and environment variables alone: an invalid
INVOWK_NO_CWDvalue,--ivk-watchtogether with--ivk-dry-run,invowk config setwhile--ivk-configorINVOWK_CONFIGis active, andinvowk agent cmd create/change --verifyunder--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:
| Command | Codes |
|---|---|
invowk audit | 0 clean, 1 findings detected, 2 scan or configuration error; command-line rejections also exit 2 |
invowk tui confirm | 1 when the user declines |
invowk tui spin | the 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 validate | 1 when validation finds errors |
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.cueexists in the current directory - No modules exist in configured
includes - No modules exist in
~/.invowk/cmds/
Solutions:
- Run
invowk initto 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
The error message always shows the specific parsing error first (e.g., which field failed validation), followed by general troubleshooting guidance.