pscale: unknown flag: --org (put --org on the subcommand)
Fixes pscale failing with unknown flag: --org. Use when targeting a non-default organization and the CLI rejects the flag placement. Moves --org after the subcommand (pscale database list --org my-org) instead of before it. Not for auth errors or genuinely unknown flags.
pscale: unknown flag: --org (put --org on the subcommand)
TL;DR: pscale parses flags per subcommand, so a global-looking pscale --org my-org database list is rejected: --org is not a root flag. Put it after the subcommand instead: pscale database list --org my-org. The same applies to other subcommand flags that look global.
unknown flag: --orgSteps
- Rewrite the command with the flag after the subcommand:
pscale database list --org my-org.
- Rerun. Expected: the command executes against that org instead of the flag error.
- If you script it, set the org once per command or export the default org so scripts do not need the flag at all.
- For other
unknown flagerrors, runpscale [subcommand] --helpto see which flags that subcommand actually accepts.
When this applies
- the exact
unknown flag: --orgerror - scripts that worked with an older CLI layout and broke after an update
- any pscale flag rejected at the root but accepted on the subcommand
When it doesn't
- auth failures — those happen after the flags parse
- flags that truly do not exist on the subcommand either (check --help)
- shell quoting issues around the org name
Compatibility
pscale CLI; per-subcommand flag parsing. Verified against the official PlanetScale CLI docs.
Variant phrasings
- pscale unknown flag org
- pscale --org flag placement
- planetscale cli org flag error
Root cause
pscale uses per-command flag sets rather than global flags, so the parser only knows --org in the context of commands that declare it. Root-level placement fails parsing before anything else runs.
Edge cases
- the default org can be set so most commands skip the flag entirely
- in scripts, prefer the explicit flag over env defaults for readability
- copy-pasted commands from docs for a different subcommand often carry misplaced flags
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.