Skip to main content
The Omni CLI signals success or failure with two exit codes: You can’t branch on the exit code to tell failure types apart. An unrecognized subcommand, such as a typo like omni document list, counts as a failure too, even though an invalid invocation can otherwise look like a successful --help print. Anything other than 0 means the command didn’t complete successfully, which is enough to script against:

Where the error detail goes

For HTTP error responses, the CLI writes an error document to stderr. See JSON requests and responses for its shape in --format json versus --format human. Local usage errors print plain text to stderr, even with --format json. For example, omni content search without the required --q flag exits with code 1 and prints Error: required flag(s) "q" not set, followed by usage help. Check the exit code before parsing command output.