{"id":16751647,"url":"https://github.com/lq782655835/yiai-cli","last_synced_at":"2025-03-21T22:32:08.739Z","repository":{"id":33006832,"uuid":"149440380","full_name":"lq782655835/yiai-cli","owner":"lq782655835","description":"CLI Tools","archived":false,"fork":false,"pushed_at":"2022-12-11T03:59:11.000Z","size":1289,"stargazers_count":8,"open_issues_count":17,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T05:51:14.898Z","etag":null,"topics":["cli","project-templates","tool"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/yiai-cli","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/lq782655835.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-19T11:29:09.000Z","updated_at":"2022-10-08T07:07:16.000Z","dependencies_parsed_at":"2023-01-14T23:01:11.031Z","dependency_job_id":null,"html_url":"https://github.com/lq782655835/yiai-cli","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fyiai-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fyiai-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fyiai-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fyiai-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lq782655835","download_url":"https://codeload.github.com/lq782655835/yiai-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880449,"owners_count":20525507,"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","project-templates","tool"],"created_at":"2024-10-13T02:44:30.645Z","updated_at":"2025-03-21T22:32:08.394Z","avatar_url":"https://github.com/lq782655835.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yiai-cli\n\ninit project from uniform cli-tool base on [AI TEAM STANDARD](https://lq782655835.github.io/blogs/team-standard/0.standard-ai-summary.html)\n\n[![NPM Version][npm-img]][npm-url]\n[![NPM Download][download-img]][download-url]\n\n[npm-img]: http://img.shields.io/npm/v/yiai-cli.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/yiai-cli\n[david-img]: https://img.shields.io/github/repo-size/lq782655835/yiai-cli.svg\n[david-url]: https://npmjs.org/package/yiai-cli\n[download-img]: https://img.shields.io/npm/dm/yiai-cli.svg?style=flat-square\n[download-url]: https://npmjs.org/package/yiai-cli\n\n## Insall\n\n``` bash\nnpm install -g yiai-cli\n```\n\n## Usage\n\n``` bash\nyiai\n```\n\n``` bash\nUsage: yiai \u003ccommand\u003e [options]\n\nOptions:\n  -V, --version                output the version number\n  -h, --help                   display help for command\n\nCommands:\n  init [name]                  Initialize a kind of template\n  list                         List templates\n  serve [dir]                  server built by local static folder\n  publish \u003cversion\u003e            Publish a new version\n  screenshot \u003curl|local-file\u003e  Take a screenshot of a web page\n  ghpages                      Push a directory to gh-pages\n  help [command]               display help for command\n```\n\n## Commands\n\n脚手架包含多个独立命令。\n\n### 1. yiai init\n\n根据模板初始化项目\n\n![image](https://user-images.githubusercontent.com/6310131/56708337-ddee4200-674e-11e9-81cc-f051d064ddbd.png)\n\nyou can choice one of below templates:\n* [vue-typescirpt](https://github.com/lq782655835/standard-vue-typescript-project)\u003csup\u003e`new`\u003c/sup\u003e\n* [vue](https://github.com/lq782655835/standard-vue-project)\u003csup\u003e`base on vue-cli3`\u003c/sup\u003e\n* [electron](https://github.com/lq782655835/electron-vue-template.git)\u003csup\u003e`base on electron-vue`\u003c/sup\u003e\n* [official-website](https://github.com/lq782655835/official-website-project)\u003csup\u003e`base on nuxt`\u003c/sup\u003e\n* [mini-app](https://github.com/lq782655835/mpvue-project)\u003csup\u003e`base on mpvue`\u003c/sup\u003e\n* [node-tool](https://github.com/lq782655835/json2ts)\n\n### 2. yiai list\n\n列出所有项目模板\n\n### 3. yiai serve\n\n对项目中build打包后的静态文件，快速开启本地node服务器。使得可以快速预览项目的生产包。默认指向静态文件是`当前执行命令位置`，端口是`3000`\n\n更多参数可使用`yiai serve --help`查看：\n\n``` bash\nUsage: yiai-serve [options] [dir]\n\nOptions:\n  -o, --open                automatically opens a browser window to this server\n  -a, --auth \u003cuser\u003e:\u003cpass\u003e  specify basic auth credentials\n  -F, --format \u003cfmt\u003e        specify the log format string (default: \"dev\")\n  -p, --port \u003cport\u003e         specify the port [3000] (default: 3000)\n  -r, --root \u003croot\u003e         specify the root directory [] (default: \"\")\n      --https-port \u003cport\u003e   specify the port [3443] (default: 3443)\n  -H, --hidden              enable hidden file serving\n  -S, --no-stylus           disable stylus rendering\n  -J, --no-pug              disable pug rendering\n      --no-less             disable less css rendering\n  -I, --no-icons            disable icons\n  -L, --no-logs             disable request logging\n  -D, --no-dirs             disable directory serving\n  -C, --cors                allows cross origin access serving\n  -s, --https               also serve over https\n      --key                 key file path for https\n      --cert                certificate file for https\n      --ca                  CA certificate file for https\n      --compress            gzip or deflate the response\n      --exec \u003ccmd\u003e          execute command on each request\n  -h, --help                display help for command\n```\n\n## 4. yiai gitsync\n\n支持配置`git-sync.target`,支持`branch、dist`参数设置。更多该工具详情，可看独立npm版本: [git-sync-tool](https://github.com/lq782655835/git-sync-tool)\n\n\u003e 在vue项目的package.json中配置`git-sync.target`，指向egg项目（最终node项目部署）\n\n## 问题列表\n\n1. `yiai gitsync`和`gh-pages`同步工具有何区别?\n\n两者核心功能一致，都可以把指定dist静态文件，同步到另外一个项目的dest目录下，不过yiai gitsync可以有较多的自定义能力，更符合项目扩展。\n\n附上[ghpages](https://github.com/tschaub/gh-pages#publish)同步文件代码：\n\n``` js\nconst ghpages = require('gh-pages')\n\n// ghpages api方式，同步静态文件\nghpages.publish('dist'), {\n  dest: 'app/public',\n  repo: 'xxx/webserver-egg.git',\n  branch: 'develop'\n}, (e) =\u003e {\n  if (e) {\n    console.log('sync failed', e.message)\n    return process.exit(1)\n  }\n})\n```\n\n\u003e gh-pages publish[核心源码](https://github.com/tschaub/gh-pages/blob/main/lib/index.js#L48)流程：1. gitclone/git pull/git checkout拿到最新代码到cache文件夹中  2. 清空dest文件夹，并同步dist内容到dest文件夹中  3. git tag/git push推送。\n\n## License\n\nThe code is distributed under the ![MIT](https://badgen.net/badge/license/MIT/blue)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flq782655835%2Fyiai-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flq782655835%2Fyiai-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flq782655835%2Fyiai-cli/lists"}