{"id":50479537,"url":"https://github.com/mcpplibs/template","last_synced_at":"2026-06-01T16:31:06.468Z","repository":{"id":329874582,"uuid":"1119543387","full_name":"mcpplibs/template","owner":"mcpplibs","description":"mcpplibs template","archived":false,"fork":false,"pushed_at":"2026-05-24T00:36:45.000Z","size":47,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T02:22:03.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcpplibs.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-19T12:47:14.000Z","updated_at":"2026-05-24T00:36:49.000Z","dependencies_parsed_at":"2025-12-23T15:00:48.935Z","dependency_job_id":null,"html_url":"https://github.com/mcpplibs/template","commit_stats":null,"previous_names":["mcpplibs/templates","mcpplibs/template"],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/mcpplibs/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcpplibs%2Ftemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcpplibs%2Ftemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcpplibs%2Ftemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcpplibs%2Ftemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcpplibs","download_url":"https://codeload.github.com/mcpplibs/template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcpplibs%2Ftemplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33784625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-01T16:31:03.982Z","updated_at":"2026-06-01T16:31:06.462Z","avatar_url":"https://github.com/mcpplibs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcpplibs.mylib\n\n\u003e 一个最小 mcpp C++23 模块库示例：`import mcpplibs.mylib;`\n\n[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23)\n[![Module](https://img.shields.io/badge/module-ok-green.svg)](https://en.cppreference.com/w/cpp/language/modules)\n[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE)\n\n一个基于 mcpp 构建工具的**现代C++模块化库**模板仓库\n\n## Quick Start / 快速开始\n\n1. 打开模板仓库：https://github.com/mcpplibs/template\n2. 点击 [**Use this template**](https://github.com/new?template_name=template\u0026template_owner=mcpplibs) 创建自己的库仓库。\n3. 克隆新仓库到本地：\n\n```bash\ngit clone https://github.com/\u003cyour-org\u003e/\u003cyour-lib\u003e.git\ncd \u003cyour-lib\u003e\n```\n\n4. 先运行默认模板，确认环境可用：\n\n\u003cdetails\u003e\n\u003csummary\u003e点击查看xlings安装命令\u003c/summary\u003e\n\n**Linux / macOS**\n```bash\ncurl -fsSL https://d2learn.org/xlings-install.sh | bash\n```\n\n**Windows — PowerShell**\n```powershell\nirm https://d2learn.org/xlings-install.ps1.txt | iex\n```\n\n\u003e xlings 详情 → [xlings.d2learn.org](https://xlings.d2learn.org)\n\n\u003c/details\u003e\n\n```bash\nxlings install\nmcpp build\nmcpp test\n```\n\n5. 再把 `mylib` 替换成你的库名，重点修改：\n\n- `mcpp.toml` 的包名、描述和仓库地址\n- `src/mylib.cppm` 的模块名和 API\n- `tests/mylib_test.cpp` 的测试用例\n- `examples/basic/` 的依赖和 import\n- README 与 `docs/architecture.md` 中的说明\n\n## Library Example\n\n当前库导出一个简单 API：\n\n```cpp\nimport std;\nimport mcpplibs.mylib;\n\nint main() {\n    std::println(\"{}\", mcpplibs::mylib::hello_mcpplibs());\n}\n```\n\n输出：\n\n```text\nhello mcpplibs\n```\n\n相关文件：\n\n- `src/mylib.cppm`: 模块接口\n- `tests/mylib_test.cpp`: 单元测试\n- `examples/basic/`: 使用方示例\n\n运行使用方示例：\n\n```bash\ncd examples/basic\nmcpp run\n```\n\n需要添加依赖时，在 `mcpp.toml` 中声明：\n\n```toml\n[dependencies.mcpplibs]\ncmdline = \"0.0.2\"\n```\n\n然后在需要的位置直接 `import mcpplibs.cmdline;`。不要默认在主模块里 `export import` 第三方依赖，除非公开 API 确实要暴露依赖包类型。\n\n## 其他项目如何使用编写的库\n\n开发期或同项目内可以直接用本地路径：\n\n```toml\n[dependencies]\nmylib = { path = \"../mylib\" }\n```\n\n还没有进入包索引时，可以引用 Git 仓库：\n\n```toml\n[dependencies]\nmylib = { git = \"https://github.com/mcpplibs/mylib.git\", tag = \"v0.1.0\" }\n```\n\n发布到 mcpp 包索引后，可以只按名字和版本引用：\n\n```toml\n[dependencies]\nmylib = \"0.1.0\"\n```\n\n代码里统一直接导入模块：\n\n```cpp\nimport mcpplibs.mylib;\n```\n\n## AI Agent 辅助了解和开发\n\n可以让 AI Agent 辅助你了解这个仓库及开发，可以先添加下面提示词：\n\n```text\n仓库地址：https://github.com/mcpplibs/template\n\n先阅读 .agents/skills/more-details/SKILL.md、.agents/skills/mcpp-style-ref/SKILL.md 和 docs/architecture.md。\n\n先只了解这个模板的 mcpp 项目结构、模块组织、测试方式和依赖管理方式，不要直接修改文件。\n\n需要更多资料时，从 more-details 里的 mcpp docs、mcpp-index、mcpplibs/cmdline 等链接继续查。\n保持 mcpp-only；测试遵循 mcpp test 规范；默认不要重新导出第三方依赖。\nREADME 只做入口引导，细节放到 docs/architecture.md。\n```\n\n## More Information\n\n- mcpp 工具与文档：https://github.com/mcpp-community/mcpp\n- mcpp docs：https://github.com/mcpp-community/mcpp/tree/main/docs\n- mcpp.toml 指南：https://github.com/mcpp-community/mcpp/blob/main/docs/05-mcpp-toml.md\n- mcpp 包索引：https://github.com/mcpp-community/mcpp-index\n- mcpplibs 组织：https://github.com/mcpplibs\n- 模板仓库：https://github.com/mcpplibs/template\n- 依赖库参考案例：https://github.com/mcpplibs/cmdline\n- C++23 模块风格参考：https://github.com/mcpp-community/mcpp-style-ref\n- xlings 工具环境：https://github.com/openxlings/xlings\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcpplibs%2Ftemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcpplibs%2Ftemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcpplibs%2Ftemplate/lists"}