diff --git a/.changeset/chatty-points-fetch.md b/.changeset/chatty-points-fetch.md new file mode 100644 index 0000000..aa08a27 --- /dev/null +++ b/.changeset/chatty-points-fetch.md @@ -0,0 +1,5 @@ +--- +"@effect/cli": patch +--- + +fix Subcommand type extraction diff --git a/src/CommandDescriptor.ts b/src/CommandDescriptor.ts index a08533a..662d5ed 100644 --- a/src/CommandDescriptor.ts +++ b/src/CommandDescriptor.ts @@ -96,8 +96,11 @@ export declare namespace Command { */ export type Subcommands< A extends NonEmptyReadonlyArray]> - > = A[number] extends readonly [infer Id, Command] ? readonly [id: Id, value: Value] - : never + > = { + [I in keyof A]: A[I] extends readonly [infer Id, Command] + ? readonly [id: Id, value: Value] + : never + }[number] } /**