Summary
toolcraft@0.0.16 always exposes and parses built-in global flags such as --yes, --output, and --debug. Applications cannot disable, rename, or hide these flags while still using runCLI and shared Toolcraft command definitions.
Reproduction
import { defineCommand, defineGroup, S } from "toolcraft";
import { runCLI } from "toolcraft/cli";
const root = defineGroup({
name: "example",
children: [
defineCommand({
name: "hello",
params: S.Object({}),
handler: async () => "hello",
}),
],
});
await runCLI(root, { rootUsageName: "example" });
Observed:
- The CLI owns
--yes, --output, and --debug regardless of the application's public contract.
ALWAYS_GLOBAL_LONG_OPTION_FLAGS and global Commander options are hardcoded in dist/cli.js.
- An application that needs only
--json / --markdown, or wants no interactive control flags, must pre-parse/rewrite argv and replace generated help/error output outside Toolcraft.
Expected
Allow applications to configure built-in CLI controls, for example:
runCLI(root, {
controls: {
output: false,
yes: false,
debug: false,
},
});
Alternatively, support application-provided flag names/output selection while retaining Toolcraft rendering.
Why this matters
Toolcraft is intended to share definitions across CLI and MCP. Hardcoded CLI controls force downstream applications to duplicate argument validation and help generation, undermining the shared-definition model.
Summary
toolcraft@0.0.16always exposes and parses built-in global flags such as--yes,--output, and--debug. Applications cannot disable, rename, or hide these flags while still usingrunCLIand shared Toolcraft command definitions.Reproduction
Observed:
--yes,--output, and--debugregardless of the application's public contract.ALWAYS_GLOBAL_LONG_OPTION_FLAGSand global Commander options are hardcoded indist/cli.js.--json/--markdown, or wants no interactive control flags, must pre-parse/rewrite argv and replace generated help/error output outside Toolcraft.Expected
Allow applications to configure built-in CLI controls, for example:
Alternatively, support application-provided flag names/output selection while retaining Toolcraft rendering.
Why this matters
Toolcraft is intended to share definitions across CLI and MCP. Hardcoded CLI controls force downstream applications to duplicate argument validation and help generation, undermining the shared-definition model.