PermDock
CLI

Errors

What each CLI problem code means, its exit code, and how to fix it.

Every error the CLI reports has a reason. In a terminal it prints the message on stderr. With --json, --format json or in agent mode, it prints the error document as one line on stderr and nothing on stdout. Its type links to the reason's section on this page:

{
  "$schema": "https://permdock.com/schemas/cli-result-v2.json",
  "status": "error",
  "reason": "unknown_command",
  "message": "unknown command 'colect' for permdock. Did you mean collect? Commands: …",
  "type": "https://permdock.com/docs/cli/errors#unknown_command",
  "next": [],
  "data": {},
  "userActionRequired": false,
  "retryable": false
}

The reasons and their exit codes are better-supabase's CLI contract 3 reasons: PermDock raises no reason better-supabase lacks. data holds the details a reason names below. userActionRequired is true for auth_required, input_required and confirmation_required, with status action_required. retryable is true for database_unreachable, network_error and request_failed. The exit code tells a script what to do next:

Exit codeMeaning
0The command succeeded.
1The command ran and failed, or found something (--check drift, doctor errors).
2The command line, the config or the environment needs a change, or the user has to give an input, confirm or log in first.
130The run was interrupted (Ctrl-C) or a prompt was cancelled.
143The process received SIGTERM.

usage

The command line is wrong in a way no more specific reason names: an extra positional, or a bare group such as permdock rls under --json, which lists its subcommands in data.choices["<command>"]. The text output adds the command's usage. Exit code 2.

unknown_command

The first argument is not a command. The message suggests the closest one and lists the rest. Run permdock --help for the tree. Exit code 2.

unknown_flag

The command does not take the flag. The message suggests the closest flag it does take. Run permdock <command> --help. Exit code 2.

invalid_value

A flag or environment variable has a value the CLI does not accept, such as --format xml, --agent=maybe or PERMDOCK_AGENT=sometimes. data.flag names the option when there is one. Exit code 2.

flag_renamed

The flag was removed or renamed. data.flag names it and data.suggestion what to pass instead, such as --yes --effects-digest <digest> for the removed --confirm. Exit code 2.

missing_value

A flag that reads a value got none, such as --db-url-stdin with empty stdin. data.flag names the option. Exit code 2.

config_not_found

--config points at a file that does not exist. The path is relative to --cwd. Exit code 2.

config_invalid

permdock.config.ts, a permissions module, a policy module or a fixtures file failed to load, or has a value the command cannot compile, such as a table name that is not an identifier. The message names the key or the file. Exit code 2.

invalid_input

cloud push built a catalog that breaks a validation rule, such as a grant naming an undeclared permission key. data.issues holds one path: message line per issue, as the text output prints them. Nothing is sent, with or without --dry-run. Exit code 1.

dependency_missing

The command needs an optional peer that is not installed. data.package names it and next holds the install command. Exit code 1.

database_unreachable

The database behind --db-url-stdin, SUPABASE_DB_URL or DATABASE_URL did not answer. The message names the command, never the connection string. Exit code 1.

network_error

PermDock Cloud or another HTTP endpoint the command calls did not answer. Exit code 1.

request_failed

The endpoint answered with an error status or a body the CLI cannot read. data.status holds the HTTP status. A Cloud answer with its own Problem Details type, such as https://permdock.com/problems/policy-not-published, keeps it as data.cloudProblem. Exit code 1.

auth_required

The command needs a PermDock Cloud credential and has none, or the credential was rejected. next holds permdock login and the CI alternative. Exit code 2.

check_failed

--check found a generated file that is missing or out of date. Run the command without --check to write it. A check that prints its report, such as collect --check, prints the result document with status: "error" on stdout instead of an error document. Exit code 1.

file_conflict

A command that rewrites files (codemod, rls migrate) found uncommitted changes in them. data.files lists them. Commit or stash first so git diff shows only the rewrite, or pass --force. Exit code 1.

input_required

The run needs a value it cannot prompt for. data.missing names the flags or positionals, data.choices the values they take when the set is known, and next the command line to run again with --yes and each placeholder filled in. Exit code 2.

confirmation_required

The change needs the user's agreement first, for example a codemod that rewrites their files. data.effects says what the run would change and data.digest is the value for --effects-digest: after the user agrees, rerun with --yes --effects-digest <digest>, the command in next. The digest is bound to the working directory and the exact command line (agent mode). Exit code 2.

cancelled

The user pressed Ctrl-C, answered no at a prompt, or the process received SIGTERM. Exit code 130, or 143 for SIGTERM.

failed

The command ran and failed in a way no more specific reason names, such as a file plan that could not write one of its files and rolled back the rest. Exit code 1.

internal

An error the CLI did not expect. It is a bug in PermDock: rerun with --debug for the stack and open an issue with it. Exit code 1.

Last updated on

On this page