Dashboard › craft › Craft workspace selection must be parse…
01a06c95-9de2-705e-bef0-0b8e33b4000d| Project | Hits | Last recalled |
|---|---|---|
| opencode-lore | 1 | 2026-08-05 |
Parse Craft workspace selection from raw argv before yargs builders and set it once: builders run before middleware, so builder-time configuration otherwise misses --workspace. Use parseArgs({ tokens: true }) and explicitly narrow token.kind === 'option' before reading option-only fields such as value or inlineValue. For separated --workspace, accept only a following non-flag string; accept inline --workspace=-foo; empty, bare, or flag-followed forms fall back to CRAFT_WORKSPACE. Repeated options use the last value, but a final valueless option clears earlier CLI selection. Do not let middleware overwrite this selection with a falsy bare option. Builders needing target choices should tolerate configuration failure and fall back to all target names.