prefer-typed-cli
Declare Node CLI arguments with a typed parsing contract.
Why
Raw positional and option lookups scatter a command contract across individual uses. A declared parser makes positional meanings, options and defaults visible together.
Fix
Prefer a Zod schema for application arguments, with native Node flag parsing for transport. Existing adequate typed parser boundaries remain allowed. Preserve positional meanings, option aliases, defaults and exit behavior.
Examples
deploy(process.argv[2]);import { z } from "zod";const Args = z.tuple([z.string().min(1)]);const [service] = Args.parse(process.argv.slice(2));deploy(service);