The parser of one subcommand, with every option a front end can render.
build_parser registers the options of mutate itself, but leaves those of the driver local to the driver, which registers them when it runs. A front end that builds a form needs them without running the driver, so this function reads them from the driver (the module is imported here, not when spotregen.parser is). The driver that calls the Claude CLI is not offered to front ends.
If command is not a subcommand, or is the driver that front ends do not offer.
Examples
from spotregen.parser import command_parserfor command in ("mutate", "local"): flags = [a.option_strings[-1] for a in command_parser(command)._actionsif a.option_strings and a.dest !="help"]print(command, flags[:4])
mutate ['--max', '--timeout', '--python', '--out']
local ['--model', '--endpoint', '--allow', '--attempts']