@gbits-jszx/dg-cli
v0.8.16
Published
DataGateway CLI — 部署/运维/配置一站式(Go binary,npx 分发)
Readme
@gbits-jszx/dg-cli
DataGateway CLI — 部署 / 运维 / 配置一站式工具,Go 二进制经由 npx 分发。
安装与使用
# 一次性运行(推荐,--prefer-online 确保拉最新版)
npx -y --prefer-online @gbits-jszx/dg-cli@latest doctor
# 全局安装
npm i -g @gbits-jszx/dg-cli
dg-cli doctor
# 项目本地依赖
npm i -D @gbits-jszx/dg-cli
npx dg-cli doctor平台支持
| OS | Arch | |---|---| | Linux | x64 / arm64 | | macOS | Intel / Apple Silicon | | Windows | x64 |
npm 装包时根据
process.platform/arch自动只下载当前平台的二进制(约 15MB),其它子包跳过。
主要命令
dg-cli doctor— 环境自检dg-cli config init|validate|path— 配置文件管理(schema 驱动)dg-cli helm install|uninstall— Helm Chart 部署(K8s/K3s)dg-cli image build|push— 镜像构建发布dg-cli system rotate-secret— 业务系统密钥轮换dg-cli release npm build|publish— npm 包构建与发布
完整文档:DataGateway 项目仓库。
0.4.0 Breaking Changes
helm install --scope all/app不再接受空 tag 或可变别名(latest/main/master/stable/current),必须传入确定性 tag(如 git SHA)。违反时 Exit 3。- npx 入口启动时异步检测 dist-tags,旧版本会打印升级提示(可设
DG_NPX_NO_VERSION_CHECK=1禁用)。
常见问题
Q1:装完执行报「不支持的平台」 当前平台未被收录。请联系维护者补齐子包,或通过仓库内 GitLab 渠道安装本地构建版本。
Q2:npx 报错「需要登录 https://registry.npmjs.org」
本机 ~/.npmrc 把 registry 切到了私有镜像。临时切回:
npm config set registry https://registry.npmjs.org/
npx -y --prefer-online @gbits-jszx/dg-cli@latest doctorQ3:helm install 报 Exit 3
说明 --tag 为空或传入了可变别名。正确做法:
IMG_TAG=$(git rev-parse --short HEAD)
npx -y --prefer-online @gbits-jszx/dg-cli@latest helm install --scope app --tag $IMG_TAGQ4:与 configs/config.yaml、.env 文件的优先级
CLI flag > env (DG_*) > configs/config.yaml > 默认值。
License
MIT
