{"_id":"@aaa321/deploy-cli","_rev":"16-2b1183bf8d607de36cd1578d7d36ec0a","name":"@aaa321/deploy-cli","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.5":{"name":"@aaa321/deploy-cli","version":"1.0.5","author":{"url":"https://webclown.net","name":"Keystion","email":"i@webclown.net"},"_id":"@aaa321/deploy-cli@1.0.5","maintainers":[{"name":"keystion","email":"i@webclown.net"}],"homepage":"https://github.com/Keystion/deploy-cli#readme","bugs":{"url":"https://github.com/Keystion/deploy-cli/issues"},"bin":{"deploy-cli":"bin/index.js"},"dist":{"shasum":"e27b10c7aaba69d3e283ca8c208509675e1bdda4","tarball":"https://registry.npmjs.org/@aaa321/deploy-cli/-/deploy-cli-1.0.5.tgz","fileCount":6,"integrity":"sha512-txMnYqLA3PKzL66cxHCmVOW4vvIabozUsv49Ii200JCbuygvg+TulDpd99NN9F/i8MZA/tR6Z4n1alMgrIvesQ==","signatures":[{"sig":"MEQCIGNsBib+hTnxZ3B6fLOMxca+eZBNfvaDIIgk13rs8v5BAiAsCZjNNsFuMRd5arHrnG6cyGnEARnbZ2TO9rkkkIAjxg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23235},"type":"module","gitHead":"1e46c3454354880da45960130d9e4457b8dd9ce1","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"keystion","email":"i@webclown.net"},"repository":{"url":"git+ssh://git@github.com/Keystion/deploy-cli.git","type":"git"},"_npmVersion":"8.19.4","description":"用于部署项目的命令行工具","directories":{},"_nodeVersion":"16.20.2","dependencies":{"inquirer":"^9.2.22","commander":"^12.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/deploy-cli_1.0.5_1717386697189_0.11489408156719216","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"@aaa321/deploy-cli","version":"1.0.6","author":{"url":"https://webclown.net","name":"Keystion","email":"i@webclown.net"},"_id":"@aaa321/deploy-cli@1.0.6","homepage":"https://github.com/Keystion/deploy-cli#readme","bugs":{"url":"https://github.com/Keystion/deploy-cli/issues"},"bin":{"deploy-cli":"bin/index.js"},"dist":{"shasum":"4ab9c146d73ef252d5a26aa3aad4b8004daf1c9e","tarball":"https://registry.npmjs.org/@aaa321/deploy-cli/-/deploy-cli-1.0.6.tgz","fileCount":7,"integrity":"sha512-aXraOJ+FtC/PA8atepxTrq5xdskFixkfRnO9jGV0VclrnuS9RoXC0CqWHLuYb7LQds+UiTwmEF1vnlAXdaz8BQ==","signatures":[{"sig":"MEQCIFMvikxTLE3ZAXyrLpIRrogJK+xIorTdenSC+xYC/b/yAiBOozWBiV+Up0E70BFYr9KC4Uo9t4WrAJclrUVMG4FWSw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29034},"type":"module","gitHead":"aeab6d6c75d115a574fdd67b93eec52703ee6eb2","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"keystion","email":"i@webclown.net"},"repository":{"url":"git+ssh://git@github.com/Keystion/deploy-cli.git","type":"git"},"_npmVersion":"8.19.4","description":"用于部署项目的命令行工具","directories":{},"_nodeVersion":"16.20.2","dependencies":{"axios":"^1.7.2","inquirer":"^9.2.22","commander":"^12.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/deploy-cli_1.0.6_1718948876221_0.8107223366906857","host":"s3://npm-registry-packages"}},"1.0.7":{"name":"@aaa321/deploy-cli","version":"1.0.7","author":{"url":"https://webclown.net","name":"Keystion","email":"i@webclown.net"},"_id":"@aaa321/deploy-cli@1.0.7","homepage":"https://github.com/Keystion/deploy-cli#readme","bugs":{"url":"https://github.com/Keystion/deploy-cli/issues"},"bin":{"deploy-cli":"bin/index.js"},"dist":{"shasum":"54a9c513761f74a3d6d78e5b297b28f458e73e97","tarball":"https://registry.npmjs.org/@aaa321/deploy-cli/-/deploy-cli-1.0.7.tgz","fileCount":7,"integrity":"sha512-U+0fxZGf70j0dQFtO+1UpV70MU3/P/ViITwkPPZmTjRu9nmsFf+dIHDXbHyxJQD9DNStvMaZRYA2A5+biW0okw==","signatures":[{"sig":"MEYCIQC1JP4TcZt/iP7wRR6xvMk70gt7lHzEJVIHTMuubFDvsAIhANP+1SxaOMhY3teHqZphACm8omLiLLrGNS9yD/0Vp5rO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28197},"type":"module","gitHead":"9c68bf9dfcbd39dc9d72cfec687c7eb5efdc108b","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"keystion","email":"i@webclown.net"},"repository":{"url":"git+ssh://git@github.com/Keystion/deploy-cli.git","type":"git"},"_npmVersion":"8.19.4","description":"用于部署项目的命令行工具","directories":{},"_nodeVersion":"16.20.2","dependencies":{"axios":"^1.7.2","inquirer":"^9.2.22","commander":"^12.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/deploy-cli_1.0.7_1718950468972_0.06217657387931208","host":"s3://npm-registry-packages"}},"1.0.8":{"name":"@aaa321/deploy-cli","version":"1.0.8","description":"用于部署项目的命令行工具","type":"module","bin":{"deploy-cli":"bin/index.js"},"author":{"name":"Keystion","email":"i@webclown.net","url":"https://webclown.net"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"dependencies":{"axios":"^1.7.2","commander":"^12.1.0","inquirer":"^9.2.22"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Keystion/deploy-cli.git"},"bugs":{"url":"https://github.com/Keystion/deploy-cli/issues"},"gitHead":"d3d3e544e7efcfafe545baf1cf97975dffec3b8f","homepage":"https://github.com/Keystion/deploy-cli#readme","_id":"@aaa321/deploy-cli@1.0.8","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-2qB99a5NkYneUu/SzSiRqL8DJU4sNA1fCaN6DAf/PgvzyW7/+MRi2UHJGI91hhbblGO50+sZQvH7FEsffnL9Vg==","shasum":"dc037b8b4a6bb3774bffbd94fb39930bc6d3cc5c","tarball":"https://registry.npmjs.org/@aaa321/deploy-cli/-/deploy-cli-1.0.8.tgz","fileCount":7,"unpackedSize":28290,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID5E+EXlIlY4GzzQJ5SJdfLWiirpc0e5YeHP664VdjmVAiEAjb71zHNsWYqNSVXmU9glnsqImpaDFrN/lKG3SQgrY5s="}]},"_npmUser":{"name":"keystion","email":"i@webclown.net"},"directories":{},"maintainers":[{"name":"keystion","email":"i@webclown.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/deploy-cli_1.0.8_1742897676870_0.07298893657269478"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-31T12:21:16.415Z","modified":"2025-03-25T10:14:37.263Z","1.0.0":"2024-05-31T10:57:46.900Z","1.0.1":"2024-05-31T11:41:19.780Z","1.0.2":"2024-05-31T12:21:16.688Z","1.0.3":"2024-06-01T08:18:28.048Z","1.0.4":"2024-06-02T03:07:19.572Z","1.0.5":"2024-06-03T03:51:37.339Z","1.0.6":"2024-06-21T05:47:56.429Z","1.0.7":"2024-06-21T06:14:29.131Z","1.0.8":"2025-03-25T10:14:37.078Z"},"bugs":{"url":"https://github.com/Keystion/deploy-cli/issues"},"author":{"name":"Keystion","email":"i@webclown.net","url":"https://webclown.net"},"homepage":"https://github.com/Keystion/deploy-cli#readme","repository":{"type":"git","url":"git+ssh://git@github.com/Keystion/deploy-cli.git"},"description":"用于部署项目的命令行工具","maintainers":[{"name":"keystion","email":"i@webclown.net"}],"readme":"# deploy-cli\n\n![NPM Version](https://img.shields.io/npm/v/%40aaa321%2Fdeploy-cli) ![NPM Downloads](https://img.shields.io/npm/d18m/%40aaa321%2Fdeploy-cli)\n\n用于部署项目的命令行工具。\n\n配合[【shell脚本】](#示例shell脚本)使用，实现自动化部署。目的是不手动输入部署项目的 `分支` 和 `环境标识`。\n\n> 不要相信手敲命令的人，因为他们可能会犯错 🤪。\n>\n> 不要相信复制粘贴的人，因为他们可能会复制错 🤪。\n\n## 功能\n\n- [x] 服务管理：添加、删除、查看服务列表、发布服务\n- [x] 支持推送发布状态到企业微信群\n\n## 安装\n\n```bash\nnpm install -g @aaa321/deploy-cli\n```\n\n## 使用\n\n```bash\ndeploy-cli\n\n> Usage: deploy-cli [options] [command]\n\n> 用于部署项目的命令行工具\n\n> Options:\n>   -v, --version     查看当前版本\n>   -h, --help        display help for command\n\n> Commands:\n>   init              初始化服务文件\n>   add [options]     添加服务\n>   remove [options]  删除服务\n>   list              服务列表\n>   deploy            发布服务\n>   addwxwork         添加企业微信群机器人\n>   help [command]    display help for command\n```\n\n## add\n\n```bash\ndeploy-cli add\n? 请输入服务名称: test\n? 请输入Git仓库地址: \n? 请输入部署脚本位置:\n? 请输入发布环境（多个环境用逗号分隔）：test,prod\n```\n\n**数据保存在 `~/.deploy-cli/service.json` 文件中。**\n\n## remove\n\n```bash\ndeploy-cli remove\n```\n\n## deploy\n\n```bash\ndeploy-cli deploy\n? 请选择要部署的服务: (Use arrow keys)\n❯ test\n? 请选择要部署的分支: (Use arrow keys)\n❯ master\n  dev\n? 请选择要部署的环境: (Use arrow keys)\n❯ test\n  prod\n```\n\n## addwxwork\n\n```bash\ndeploy-cli addwxwork\n? 请输入企业微信群机器人Webhook地址: \n```\n\n**数据保存在 `~/.deploy-cli/webhook.json` 文件中。**\n\n数据结构查看 [webhook-sample.json](./webhook-sample.json)\n\n企业微信消息支持 4 种：\n\n1. 开始部署\n2. 部署成功\n3. 部署失败\n4. 取消部署\n\n可在配置文件中查看 `~/.deploy-cli/webhook.json`\n\n## One more thing\n\n快速add服务\n\n```bash\ndeploy-cli add -n [name] -r [repository] -s [scriptPath] -e [environments]\n\n# deploy-cli add -n deploy-cli -r git@github.com:Keystion/deploy-cli.git -s /data/deploy/update.sh -e test\n```\n\n- `-n, --name` 服务名称\n- `-r, --repository` Git仓库地址\n- `-s, --scriptPath` 部署脚本位置\n- `-e, --environments` 发布环境（多个环境用逗号分隔）\n\n## 示例shell脚本\n\n```bash\n#!/bin/bash\n\nset -euo pipefail\n\n# 默认值设置\nbranch_name=\"main\"\nenv=\"prod\"\n\n# 参数解析\nwhile [[ $# -gt 0 ]]; do\n    case \"$1\" in\n        -b|--branch)\n            branch_name=$2\n            shift 2\n            ;;\n        -e|--env)\n            env=$2\n            shift 2\n            ;;\n        *)\n            echo \"🚧 错误：无效的参数\"\n            exit 1\n            ;;\n    esac\ndone\n\n# 输出环境和分支信息\necho \"> 部署环境：${env}\"\necho \"> 部署分支：${branch_name}\"\n\n# pnpm run build:${env}\n```\n","readmeFilename":"README.md"}