Dashboard › craft › Distillation
d485a356-db79-4f71-b99c-acfb5e1462bb["lore_tm_v1_HEE9PgDpjjAsgAhgjmGefXz8A2WbyyAiNzjMF2QFonk"]
Date: Aug 24, 2026
/home/byk/Code/getsentry/craft-workspaces-schema/src/index.ts (137 lines). CLI imports extractWorkspaceSelection from ./utils/helpers and setActiveWorkspace from ./config.src/index.ts:66-75 defines fixGlobalBooleanFlags(argv: string[]): string[], which appends '1' immediately after standalone arguments whose arg.slice(2) is a key in GLOBAL_BOOLEAN_FLAGS; GLOBAL_BOOLEAN_FLAGS contains 'no-input' and 'dry-run'.src/index.ts:80-98 main() calls sanitizeDynamicLinkerEnv(), printVersion(), warnIfCraftEnvFileExists(), processes process.argv.slice(2) through fixGlobalBooleanFlags(), then calls setActiveWorkspace(extractWorkspaceSelection(argv)) before yargs parsing.src/index.ts:91-98 documents the pre-parse workspace-selection rationale: yargs command builders can read configuration before middleware; specifically, publish derives --target choices from config.targets, so resolving workspace in middleware would be too late. extractWorkspaceSelection(argv) is documented as the single source of truth and as handling CLI/environment precedence.src/index.ts:100-134 configures yargs with parser setting 'boolean-negation': false, .env('CRAFT'), commands prepare, publish, targets, config, artifacts, and changelog; .demandCommand(), version alias v, help alias h, global boolean options, strict commands, showHelpOnFail(true), setGlobals middleware, and .parse(argv).src/index.ts:124-130 registers global string option --workspace with description: “Select a named workspace (release unit) from the configuration. Required when the config defines "workspaces". Env: CRAFT_WORKSPACE”.src/index.ts:137 invokes withTracing(main, { name: 'craft.cli', op: 'cli' })().