安装 DevBox CLI
DevBox CLI 提供沙箱全生命周期、交互式终端与远程命令执行命令。
系统要求
- Bash 和
curl,或者 PowerShell 5.1 及以上版本; - x86-64 或 ARM64 架构;
- 可以访问 GitHub、GitCode 或 OBS 安装源;
- 对
~/.huawei目录具有写权限。
安装
Bash
任选一个渠道运行安装脚本:
bash
curl -fsSL https://github.com/huaweicloud/devspace-devbox/releases/latest/download/install.sh | bashbash
curl -fsSL https://gitcode.com/CloudDeveloperDepartment/devbox/releases/download/latest/install.sh | bashbash
curl -fsSL https://tools-artifact.developer.huaweicloud.com/sharedata/devbox/install.sh | bashPowerShell
任选一个渠道运行安装脚本:
powershell
irm https://github.com/huaweicloud/devspace-devbox/releases/latest/download/install.ps1 | iexpowershell
irm https://gitcode.com/CloudDeveloperDepartment/devbox/releases/download/latest/install.ps1 | iexpowershell
irm https://tools-artifact.developer.huaweicloud.com/sharedata/devbox/install.ps1 | iex标准安装会安装当前发布版本并使用默认目录,不需要指定版本或下载源。
| 内容 | 默认位置 |
|---|---|
| CLI 可执行文件 | ~/.huawei/bin |
| CLI 配置与状态 | ~/.huawei/devbox |
配置 PATH
如果终端无法直接找到 devbox,在当前会话执行:
bash
export PATH="$HOME/.huawei/bin:$PATH"如果你使用 PowerShell,则执行:
powershell
$env:Path = "$HOME/.huawei/bin;$env:Path"若要对后续终端持续生效,把相应命令加入 Shell 启动文件。Bash 或 Zsh 可写入 ~/.bashrc 或 ~/.zshrc。
验证安装
console
devbox --version
devbox --help第一条命令显示当前 CLI 版本;第二条命令显示当前版本支持的命令。