{"id":49320475,"url":"https://github.com/matteopolak/zod-to-cli","last_synced_at":"2026-04-26T17:30:52.516Z","repository":{"id":351463797,"uuid":"1211099477","full_name":"matteopolak/zod-to-cli","owner":"matteopolak","description":"Type-safe CLI argument parsing using Zod schemas.","archived":false,"fork":false,"pushed_at":"2026-04-15T04:45:43.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-15T06:27:36.750Z","etag":null,"topics":["args","cli","command-line","parser","zod"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/zod-to-cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matteopolak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-15T04:15:35.000Z","updated_at":"2026-04-15T04:45:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/matteopolak/zod-to-cli","commit_stats":null,"previous_names":["matteopolak/zod-to-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/matteopolak/zod-to-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Fzod-to-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Fzod-to-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Fzod-to-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Fzod-to-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matteopolak","download_url":"https://codeload.github.com/matteopolak/zod-to-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matteopolak%2Fzod-to-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32307010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T17:23:19.671Z","status":"ssl_error","status_checked_at":"2026-04-26T17:23:19.195Z","response_time":129,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["args","cli","command-line","parser","zod"],"created_at":"2026-04-26T17:30:51.917Z","updated_at":"2026-04-26T17:30:52.510Z","avatar_url":"https://github.com/matteopolak.png","language":"TypeScript","readme":"# zod to cli\n\nType-safe CLI argument parsing using Zod schemas.\n\nDefine your CLI interface with a Zod schema, get back typed arguments. Supports flags, aliases, arrays, booleans, numbers, and automatic help generation.\n\n## Install\n\n```bash\npnpm add zod-to-cli zod\n```\n\n## Quick Example\n\n```typescript\nimport { z, meta, cli } from 'zod-to-cli';\n\nconst schema = z.object({\n  name: z.string().register(meta, {\n    description: 'Your name',\n    aliases: ['n'],\n  }),\n  verbose: z\n    .boolean()\n    .default(false)\n    .register(meta, {\n      description: 'Enable verbose output',\n      aliases: ['v'],\n    }),\n});\n\nconst args = cli(schema, {\n  name: 'my-cli',\n  description: 'A simple CLI tool',\n  version: '1.0.0',\n});\n\n// args is fully typed: { name: string, verbose: boolean }\nconsole.log(args.name, args.verbose);\n```\n\nRun it:\n\n```bash\n$ my-cli --name Alice -v\nAlice true\n\n$ my-cli --help\nmy-cli v1.0.0\n\nA simple CLI tool\n\nUSAGE:\n  my-cli [OPTIONS]\n\nOPTIONS:\n  -n, --name \u003cstring\u003e     Your name (required)\n  -v, --verbose           Enable verbose output\n  -h, --help              Show help\n  --version               Show version\n```\n\n## Features\n\n- **Type-safe**: Arguments are parsed and validated against your Zod schema\n- **Flag aliases**: Short flags like `-n` for `--name`\n- **Arrays**: Collect multiple values with `--tag foo --tag bar`\n- **Booleans**: Supports negation (`--no-verbose`)\n- **Count flags**: `-vvv` for verbosity levels\n- **Help generation**: Automatic `--help` and `--version`\n- **Validation**: Uses Zod's built-in validation (min/max, email, etc.)\n\n## More Examples\n\nSee the `examples/` directory for:\n\n- [basic.ts](examples/basic.ts) - flags and options\n- [positional.ts](examples/positional.ts) - positional arguments\n- [subcommands.ts](examples/subcommands.ts) - git-style subcommands\n\n## Requirements\n\n- Node.js \u003e= 20.0.0\n- Zod ^4.0.0 (peer dependency)\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteopolak%2Fzod-to-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatteopolak%2Fzod-to-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteopolak%2Fzod-to-cli/lists"}