{"id":20059245,"url":"https://github.com/qddegtya/cf","last_synced_at":"2026-04-27T17:32:52.793Z","repository":{"id":57099616,"uuid":"334114070","full_name":"qddegtya/cf","owner":"qddegtya","description":"✨ A guided, interactive CLI framework for Node.js that helps you create elegant command-line tools with minimal effort. Built with its own tools!","archived":false,"fork":false,"pushed_at":"2025-03-04T13:16:37.000Z","size":160,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T16:16:39.638Z","etag":null,"topics":["cli","cli-framework","cli-frameworks","framework","javascript","nodejs","tool"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/qddegtya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-01-29T10:40:38.000Z","updated_at":"2025-06-08T05:55:52.000Z","dependencies_parsed_at":"2025-02-08T11:24:09.398Z","dependency_job_id":"0f56dee9-d0e6-46ec-9252-ada12f155cf3","html_url":"https://github.com/qddegtya/cf","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/qddegtya/cf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qddegtya%2Fcf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qddegtya%2Fcf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qddegtya%2Fcf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qddegtya%2Fcf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qddegtya","download_url":"https://codeload.github.com/qddegtya/cf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qddegtya%2Fcf/sbom","scorecard":{"id":752997,"data":{"date":"2025-08-11","repo":{"name":"github.com/qddegtya/cf","commit":"96743e837f8c53fd202ef11ca5c4a1bfc3b961cb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T20:50:53.839Z","repository_id":57099616,"created_at":"2025-08-22T20:50:53.847Z","updated_at":"2025-08-22T20:50:53.847Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"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":["cli","cli-framework","cli-frameworks","framework","javascript","nodejs","tool"],"created_at":"2024-11-13T13:06:39.083Z","updated_at":"2026-04-27T17:32:52.776Z","avatar_url":"https://github.com/qddegtya.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n\t\u003cimg width=\"256\" src=\"media/cf-logo-with-animation.svg\" alt=\"cf\"\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cem\u003e✨ A guided, interactive CLI framework for Node.js that helps you create elegant command-line tools with minimal effort.\u003c/em\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cem\u003eCF\u003c/em\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003c/p\u003e\n\n# 关于\n\n✨ 一个引导式的、基于类的 Node.js CLI 开发框架，具有强大的钩子系统。专为创建优雅且易维护的命令行应用而设计。有趣的是，这个框架本身就是使用自己来构建的！\n\n# Projects Using CF\n\nProjects that use CF:\n\n* [efc](https://github.com/qddegtya/efc): 📃 Elegant devtool for formily component.\n* [portrayal](https://github.com/qddegtya/portrayal): 🎭 Generate your portrayal, rich and powerful.\n* [zao](https://github.com/qddegtya/zao): 🔨 Tiny \u0026 elegant scaffolding tool.\n\n\u003e 💗 Waiting for you.\n\n## 包结构\n\n| Package | Version | Description |\n|---------|---------|-------------|\n| [@atools/cf-core](./packages/core) | [![NPM Version](https://img.shields.io/npm/v/%40atools%2Fcf-core)](https://www.npmjs.com/package/@atools/cf-core) | 核心功能包，提供基础命令系统、钩子系统等 |\n| [@atools/cf](./packages/cf) | [![NPM Version](https://img.shields.io/npm/v/%40atools%2Fcf)](https://www.npmjs.com/package/@atools/cf) | 主应用包，提供命令行工具和模板 |\n\n## 重要更新\n\n🚀 **2.0.0 版本已发布！**\n\n在这个重大版本更新中，我们：\n- 重构了项目结构，采用 monorepo 架构\n- 将核心功能抽离到 `@atools/cf-core` 包\n- 1.x 版本需要使用迁移 🔧 工具\n- 优化了项目配置和构建流程\n\n## 开发\n\n```bash\n# 安装依赖\npnpm install\n\n# 构建所有包\npnpm build\n\n# 运行测试\npnpm test\n\n# 代码检查\npnpm lint\n\n# 发布新版本\npnpm release       # 正式版\npnpm release:canary # 预览版\n```\n\n# 特性\n\n- 🎯 **引导式开发** - 交互式创建和添加命令，告别繁琐的手动配置\n- 🔌 **强大的钩子系统** - 灵活的插件架构，支持异步钩子\n- 🎨 **现代化架构** - 采用现代 JavaScript 特性和最佳实践\n- 🚀 **易于扩展** - 以最小的样板代码创建和注入自定义命令\n- 📦 **零配置** - 开箱即用的合理默认配置\n- 🛠️ **自举实现** - 框架本身就是最好的示例代码\n\n# 快速开始\n\n## 安装\n\n```bash\n# 使用 npm\nnpm install @atools/cf\n\n# 使用 yarn\nyarn add @atools/cf\n\n# 使用 pnpm\npnpm add @atools/cf\n```\n\n## 使用 add 命令\n\n`add` 命令用于快速创建新的命令模块，支持以下选项：\n\n- `-o, --output \u003cpath\u003e`: 输出目录，默认为 `commands`\n- `-t, --template \u003cpath\u003e`: 模板文件路径，默认使用内置模板\n\n```bash\n# 使用默认配置\n$ cf add\n\n# 自定义输出目录\n$ cf add -o custom-commands\n\n# 自定义模板\n$ cf add -t custom-template.tpl\n\n[CF] -\u003e command name: hello\n[CF] -\u003e command alias: h\n[CF] -\u003e command description: Say hello to someone\n```\n\n这将创建一个新的命令文件，例如 `commands/hello/index.js`：\n\n```javascript\nconst { BaseCommand } = require('@atools/cf-core');\n\nclass Hello extends BaseCommand {\n  constructor(config) {\n    super(config);\n  }\n\n  init(commander) {\n    commander\n      .option('-n, --name \u003cname\u003e', '要问候的名字');\n  }\n\n  async do() {\n    const { name = '世界' } = this.config;\n    console.log(`你好, ${name}!`);\n  }\n}\n\nHello.command = 'hello';\nHello.alias = 'h';\nHello.description = 'Say hello to someone';\n\nmodule.exports = Hello;\n```\n\n\u003e **注意**：`ui`、`init` 和 `remove` 命令目前正在开发中，敬请期待！\n\n## 基本使用\n\n```javascript\nconst { BaseCommand } = require('@atools/cf-core');\n\nclass MyCommand extends BaseCommand {\n  constructor(config) {\n    super(config);\n  }\n\n  init(commander) {\n    // 配置命令选项\n  }\n\n  async do() {\n    // 实现命令逻辑\n  }\n}\n```\n\n## Hook 系统\n\nCF 框架使用 `bootstrap.hooks` 提供了简单而强大的钩子系统：\n\n```javascript\nconst { bootstrap } = require('@atools/cf-core');\n\n// 注册 will-inject 钩子\nbootstrap.hooks.tap('will-inject', async (next) =\u003e {\n  // 在命令注入前执行的逻辑\n  console.log('Command injection starting...');\n  await next();\n});\n\n// 启动应用\nbootstrap({\n  root: path.join(__dirname, 'commands'),\n  version: '1.0.0'\n});\n```\n\n## 贡献\n\n欢迎提交 issue 和 PR！\n\n## 许可证\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqddegtya%2Fcf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqddegtya%2Fcf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqddegtya%2Fcf/lists"}