Repository navigation
odc-cli instruments list --kind rejects FILE and SERIES #1783
Description
odc-cli instruments list --kind rejects FILE and SERIES, so an administrator cannot list file or series instruments by kind. The argparse option hard-codes choices=('FORM', 'INTERACTIVE'), but InstrumentKind has four members, and GET /v1/instruments/list?kind= accepts any of them. argparse exits before a request is sent. cli/AGENTS.md already notes the drift as an example of how this hand-written client goes stale. This issue tracks fixing it.
Where
cli/odc-cli:601:
get_parser.add_argument('--kind', choices=('FORM', 'INTERACTIVE'), help='filter instruments by kind')packages/runtime-core/src/types/instrument.base.ts:13:
type InstrumentKind = 'FILE' | 'FORM' | 'INTERACTIVE' | 'SERIES';Reproduce
- Log in with
odc-cli auth login. - Run
odc-cli instruments list --kind SERIES.
Actual: error: argument --kind: invalid choice: 'SERIES' (choose from 'FORM', 'INTERACTIVE'), with exit status 2 and no request sent. The same happens for FILE.
Expected: the CLI calls GET /v1/instruments/list?kind=SERIES and prints the series instruments.
Tests
cli/ has no test harness (cli/AGENTS.md). Verify the fix by running instruments list --kind FILE and --kind SERIES against a demo instance, which seeds both kinds.
Suggested fix
Change the choices to ('FILE', 'FORM', 'INTERACTIVE', 'SERIES') in the order of the InstrumentKind union. Then remove the drift example from cli/AGENTS.md, or replace it, in the same commit.
Activity