Skip to main content

check

The check command is used to check the configuration files and commands in the omnipath for errors. This command is useful for debugging and ensuring that the configuration is correct, or to lint your omni commands metadatas.

Parameters

ParameterRequiredValue typeDescription
--search-pathnostringPath to search for omni commands to validate the metadata of. Can be repeated. If neither this nor --config-file is specified, the current omnipath is checked.
--config-filenostringPath to the configuration file to validate. Can be repeated. If neither this nor --search-path is specified, the current configuration is checked.
--globalnonullOnly validate the global configuration and global commands.
--localnonullOnly validate the configuration and commands that are local to the current worktree.
--include-packagesnonullInclude the packages in the validation.
--ignorenostringIgnore the specified error codes. Can be repeated. Can be used to only specify a prefix of the error code, e.g. --ignore=M will ignore all metadata header errors.
--selectnostringOnly validate the specified error codes. Can be repeated. Can be used to only specify a prefix of the error code, e.g. --select=M will only validate metadata header errors. Some errors are ignored by default and need to be explicitly selected to appear in the reports.
--patternnostringOnly validate the files that match the specified pattern. Can be repeated. The pattern can start with ! to exclude files. The patterns are processed in order and the first match is used.
--outputnoplain or jsonOutput format. Default is plain.

Examples

# Run a check of all the configuration files and commands, except for packages
omni config check

# Run a check of the global configuration files and commands, including packages
omni config check --include-packages

# Run a check of the worktree configuration files and commands
omni config check --local

# Run a check of the global configuration files and commands,
# ignoring all M-prefixed errors, except for the M0-prefixed errors
omni config check --ignore M --select M0

Error codes

Configuration errors

Error codeSelectedDescription
C0Key-related errors
C001Missing key in the configuration (e.g. is required but was not provided)
C002Empty key in the configuration (e.g. was provided but was empty)
C003Configuration option allows to specify an entry with a single-key-pair-table, but the table found does not have exactly one key
C1Value-related errors
C101Invalid value type in the configuration (e.g. expected a string but got a number)
C102Invalid value in the configuration (e.g. expected 'a' but got 'b')
C103Invalid range in the configuration (e.g. expected a value defining a range, but the range is invalid)
C104Invalid package in the configuration (e.g. expected a package name but got a value that can't resolve to a package)
C110Unsupported value in the configuration (e.g. a value is not supported in the current context)
C120Parsing error in the configuration (e.g. failed to parse a value)

Metadata errors

Error codeSelectedDescription
M0File-scoped metadata errors
M001Metadata header is missing the help key
M002Metadata header is missing the syntax key (ignored by default, needs to be explicitly selected)
M1Key-related errors for the metadata
M101Metadata header has an unknown key
M102Metadata header is missing a subkey
M103Metadata header has a continuation without a key
M104Metadata header has a duplicate key
M2Value-related errors for the metadata
M201Metadata header has an invalid value type
M3Definition of arggroup
M301Metadata header group is missing parameters
M308Metadata header group has an empty part
M309Metadata header group has an unknown config key
M4Definition of arg or opt
M401Metadata header parameter has an invalid key-value pair
M402Metadata header parameter is missing a description
M408Metadata header parameter has an empty part
M409Metadata header parameter has an unknown config key

Path errors

Error codeSelectedDescription
P001Path does not exist
P002A file present in the path is not executable
P003A file present in the path does not have metadata, or they couldn't be loaded