{"repo":"privatenumber/type-flag","free":true,"listed":false,"github":"https://github.com/privatenumber/type-flag","clone":"git clone https://github.com/privatenumber/type-flag.git","description":"⛳️ Typed command-line arguments parser for Node.js","language":"TypeScript","stars":226,"topics":["cli","node","argv","flag","typed","typescript","parser","minimist","nodejs","command-line"],"license":"MIT","category":"cli-tools","readme_excerpt":"type-flag Tiny CLI flag parser whose schema returns TypeScript-inferred application values. Use parser functions like Number , Date , enum validators, or object builders, then read clean output from parsed.flags . No dependencies & tree-shakable (Max 1.4 kB). → Try it out online Comparing parser options? See how type-flag differs from util.parseArgs() , arg , and minimist . [!TIP] Looking for a full CLI framework? Try Cleye , a CLI development tool powered by type-flag . It adds command routing, argument parsing, and a polished --help generator on top of flag parsing. Already a sponsor? Join the discussion in the Development repo ! Install Quick Start Need a short alias? Only need one flag? Use getFlag() to extract a single typed value: Why Type-flag? - Parser functions return the values your app uses: numbers, dates, enums, objects, nullable values, or validated strings. - TypeScript infers the output from the schema. - The schema reads like application options: add type , alias , and default next to the flag they belong to. - Output is clean: flags.age , not result['--age'] . - Unknown flags are separated for accurate errors or forwarding. - Passing your own argv lets type-flag remove parsed tokens and leave the rest. - camelCase schema keys accept kebab-case CLI input. - It stays small and focused: a flag parser, not a CLI framework. Usage Defining Typed Flags Pass an object where each key is the flag name and each value is a parser function. Use object syntax when a flag ","default_branch":null,"files":null,"tree":[],"storefront":"/r/privatenumber","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/privatenumber/type-flag/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}