Context
--org <org> is a required CLI flag on every invocation of the default command and the query subcommand. Most users only ever query a single organization, so passing --org on every single call is repetitive friction.
Solution
- Read a new
GCS_DEFAULT_ORG environment variable as a fallback default for --org.
--org (the CLI flag) still takes precedence whenever it's explicitly passed.
- When neither
--org nor GCS_DEFAULT_ORG is set, exit with a clear, actionable error message (no raw Commander "required option" stack trace).
- Implementation: switch
--org from a Commander requiredOption to a regular Option using Commander's native .env("GCS_DEFAULT_ORG") support (precedence CLI flag > env var is handled by Commander itself), then validate presence explicitly in the action handler.
- Update documentation end to end:
docs/reference/environment.md, docs/reference/cli-options.md, README.md, docs/getting-started/index.md / first-search.md.
Acceptance Criteria
Definition of Done
Context
--org <org>is a required CLI flag on every invocation of the default command and thequerysubcommand. Most users only ever query a single organization, so passing--orgon every single call is repetitive friction.Solution
GCS_DEFAULT_ORGenvironment variable as a fallback default for--org.--org(the CLI flag) still takes precedence whenever it's explicitly passed.--orgnorGCS_DEFAULT_ORGis set, exit with a clear, actionable error message (no raw Commander "required option" stack trace).--orgfrom a CommanderrequiredOptionto a regularOptionusing Commander's native.env("GCS_DEFAULT_ORG")support (precedence CLI flag > env var is handled by Commander itself), then validate presence explicitly in the action handler.docs/reference/environment.md,docs/reference/cli-options.md,README.md,docs/getting-started/index.md/first-search.md.Acceptance Criteria
--org <org>continues to work exactly as before and always takes precedence overGCS_DEFAULT_ORGwhen both are set.--orgis omitted andGCS_DEFAULT_ORGis set, its value is used transparently (both the default command and thequerysubcommand, since they shareaddSearchOptions).--orgnorGCS_DEFAULT_ORGis set, the CLI prints a clear error to stderr and exits with a non-zero code.--helpoutput documents theGCS_DEFAULT_ORGfallback for--org.docs/reference/environment.md,docs/reference/cli-options.md,README.mdand the getting-started docs are updated to documentGCS_DEFAULT_ORG.Definition of Done
bun test,bun run lint,bun run format:check,bun run knip,bun run build.tsall green.