Toolcraft supports GroupConfig.default, which enables a root invocation such as wire <url>. An unnamed default command (defineCommand({ name: "", ... })) renders correctly in root help as <url>, but CLI construction crashes when the group also has sibling commands.
Minimal shape:
const ingest = defineCommand({
name: "",
positional: ["url"],
params: S.Object({ url: S.String() }),
handler: async ({ params }) => params,
})
const root = defineGroup({
name: "",
children: [ingest, defineCommand({ name: "init", params: S.Object({}), handler: async () => ({}) })],
default: ingest,
})
Running any CLI command fails in Commander:
Error: Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()
Expected: unnamed default commands should support root positional usage alongside named sibling commands, and remain represented in help as the root positional form rather than requiring an extra visible command name.
Toolcraft supports
GroupConfig.default, which enables a root invocation such aswire <url>. An unnamed default command (defineCommand({ name: "", ... })) renders correctly in root help as<url>, but CLI construction crashes when the group also has sibling commands.Minimal shape:
Running any CLI command fails in Commander:
Expected: unnamed default commands should support root positional usage alongside named sibling commands, and remain represented in help as the root positional form rather than requiring an extra visible command name.