# 安装CLI

本指南将帮助您在不同平台上安装 Zenlayer Cloud CLI (`zeno`)。

## 系统要求

* **Linux**: 支持主流 Linux 发行版
* **macOS**: 支持 macOS 10.15 及以上版本
* **Windows**: 支持 Windows 10 及以上版本

## 安装方法

### 方法一：快速安装（Linux / macOS）（推荐）

```bash
curl -fsSL https://raw.githubusercontent.com/zenlayer/zenlayercloud-cli/main/install.sh | bash
```

### 方法二：使用预编译二进制文件

从 [GitHub Releases](https://github.com/zenlayer/zenlayercloud-cli/releases) 页面下载适合您平台的预编译二进制文件：

| 平台      | 架构        | 二进制文件                    |
| ------- | --------- | ------------------------ |
| Linux   | amd64     | `zeno_linux_amd64`       |
| Linux   | arm64     | `zeno_linux_arm64`       |
| macOS   | Universal | `zeno_darwin_all`        |
| Windows | amd64     | `zeno_windows_amd64.exe` |

下载后安装：

* **Linux/macOS**:

  ```bash
  # 将二进制文件移动到系统 PATH 目录
  chmod +x zeno_*_*
  sudo mv zeno_*_* /usr/local/bin/zeno
  ```
* **Windows**:
  * 将下载的 `zeno_windows_amd64.exe` 文件重命名为 `zeno.exe`
  * 将其移动到系统 PATH 环境变量包含的目录中，如 `C:\Windows\System32`

### 方法三：从源码构建

需要 Go 1.21 或更高版本。

```bash
git clone https://github.com/zenlayer/zenlayercloud-cli.git
cd zenlayercloud-cli
make build
```

编译后的二进制文件位于 `bin/zeno`。

## 验证安装

安装完成后，运行以下命令验证 Zenlayer Cloud CLI 是否安装成功：

```bash
zeno version
```

如果安装成功，您将看到以下对应的版本号输出：

```
1.0.0
```

## 升级 CLI

要升级 Zenlayer Cloud CLI，只需重新执行快速安装命令即可：

```bash
curl -fsSL https://raw.githubusercontent.com/zenlayer/zenlayercloud-cli/main/install.sh | bash
```

或按照上述其他安装方式重新安装最新版本的二进制文件。

## 卸载 CLI

要卸载 Zenlayer Cloud CLI，只需删除对应的二进制文件：

* **Linux/macOS**:

  ```bash
  sudo rm /usr/local/bin/zeno
  ```
* **Windows**:
  * 删除之前移动到系统 PATH 目录中的 `zeno.exe` 文件

## 常见问题

### 权限错误

如果在安装过程中遇到权限错误，请确保您有足够的权限将文件移动到系统目录。在 Linux/macOS 上，可以使用 `sudo` 命令获取管理员权限。

### 命令未找到

如果运行 `zeno` 命令时出现 "command not found" 错误，请确保二进制文件已正确安装到系统 PATH 目录中，或者您可以使用绝对路径运行二进制文件。

## 下一步

安装完成后，您可以继续阅读 [配置指南](https://docs.console.zenlayer.com/zenlayer-cli/cn/configure) 来配置 Zenlayer Cloud CLI 的访问凭证。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/zenlayer-cli/cn/install.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
