{"id":16392987,"url":"https://github.com/yjl9903/breadc","last_synced_at":"2026-02-21T15:14:13.777Z","repository":{"id":37365827,"uuid":"505298867","full_name":"yjl9903/Breadc","owner":"yjl9903","description":"🥪 Yet another Command Line Application Framework with fully TypeScript support","archived":false,"fork":false,"pushed_at":"2025-02-22T08:33:14.000Z","size":3390,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T09:13:59.771Z","etag":null,"topics":["cli","command-line","framework","typescript","vscode"],"latest_commit_sha":null,"homepage":"https://breadc.onekuma.cn/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yjl9903.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["yjl9903"]}},"created_at":"2022-06-20T04:55:38.000Z","updated_at":"2025-02-22T08:33:17.000Z","dependencies_parsed_at":"2023-09-24T05:00:38.913Z","dependency_job_id":"63b90324-2173-4a01-a10d-5430b307d740","html_url":"https://github.com/yjl9903/Breadc","commit_stats":{"total_commits":399,"total_committers":2,"mean_commits":199.5,"dds":"0.44611528822055135","last_synced_commit":"ece59d6e98d306ca7e699ee0771bbfeb94555b79"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjl9903%2FBreadc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjl9903%2FBreadc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjl9903%2FBreadc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjl9903%2FBreadc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yjl9903","download_url":"https://codeload.github.com/yjl9903/Breadc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822292,"owners_count":20353499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","command-line","framework","typescript","vscode"],"created_at":"2024-10-11T04:52:02.425Z","updated_at":"2026-02-14T10:11:52.978Z","avatar_url":"https://github.com/yjl9903.png","language":"TypeScript","funding_links":["https://github.com/sponsors/yjl9903"],"categories":[],"sub_categories":[],"readme":"# 🥪 Breadc\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/yjl9903/Breadc)\n[![version](https://img.shields.io/npm/v/breadc?label=Breadc)](https://www.npmjs.com/package/breadc)\n[![CI](https://github.com/yjl9903/Breadc/actions/workflows/ci.yml/badge.svg)](https://github.com/yjl9903/Breadc/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/yjl9903/Breadc/branch/main/graph/badge.svg?token=F7PGOG62EF)](https://codecov.io/gh/yjl9903/Breadc)\n\nYet another **Command Line Application Framework** desgined for **[TypeScript](https://www.typescriptlang.org/)**.\n\n- **TypeScript Infer**: infer command arguments, option values, and action signatures in IDE automatically\n- **Command**: support default command, command alias, and nested sub-commands like `git remote add \u003cname\u003e \u003curl\u003e`\n- **Group**: organize commands by modules and build large multi-command CLI applications with clear structure\n- **Option**: support boolean, required, optional, spread options, `--no-*` negation, and `--` passthrough arguments\n- **Middleware**: support middleware pipeline and unknown option handling\n- **Builtin CLI Features**: provide common help / version options and i18n support out of the box\n- **Toolkits**: contains many useful tools to build your next CLI application, such as [ansi color](https://github.com/yjl9903/Breadc/tree/main/packages/color), [process death handler](https://github.com/yjl9903/Breadc/tree/main/packages/death), [shell compelete script generation](https://github.com/yjl9903/Breadc/tree/main/packages/complete) and so on.\n\n![vscode](https://raw.githubusercontent.com/yjl9903/Breadc/v1.0.0-beta.1/assets/typescript.png)\n\n## Installation\n\n```bash\nnpm i breadc\n```\n\n## Usage\n\nTry [./examples/echo.ts](./examples/echo.ts).\n\n```ts\nimport { breadc } from 'breadc';\n\nconst cli = breadc('echo', { version: '1.0.0' })\n  .option('--host \u003chost\u003e', 'specify hostname', { initial: 'localhost' })\n  .option('--port \u003cport\u003e', 'specify port', { initial: '3000', cast: (t) =\u003e +t });\n\ncli.command('[message]', 'Say something!').action((message, option) =\u003e {\n  console.log(message ?? 'You can say anything!');\n  const { host, port } = option; // { host: string, port: number, '--': string[] }\n  console.log(`Host: ${host}`);\n  console.log(`Port: ${port}`);\n});\n\ncli.run(process.argv.slice(2)).catch((err) =\u003e console.error(err));\n```\n\nIf you are using IDEs that support TypeScript (like [Visual Studio Code](https://code.visualstudio.com/)), input something using `option`, and then you will find the `option` is automatically typed with `{ host: string, port: number }`. In the figure below, [Visual Studio Code](https://code.visualstudio.com/) will automatically infer that the type of `option.host` is `string` and the type of `option.port` is `number`.\n\n![vscode](https://raw.githubusercontent.com/yjl9903/Breadc/v1.0.0-beta.1/assets/typescript.png)\n\n## Inspiration\n\n- [cac](https://github.com/cacjs/cac): Simple yet powerful framework for building command-line apps.\n- [Commander.js](https://github.com/tj/commander.js): Node.js command-line interfaces made easy.\n- [TypeScript: Documentation - Template Literal Types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html)\n\n## License\n\nMIT License © 2023 [XLor](https://github.com/yjl9903)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjl9903%2Fbreadc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjl9903%2Fbreadc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjl9903%2Fbreadc/lists"}