# 配置CLI

本指南将帮助您配置 Zenlayer Cloud CLI (`zeno`)，以便安全地访问和管理您的 Zenlayer Cloud 资源。

## 配置概述

Zenlayer Cloud CLI 使用配置文件和环境变量来存储和管理访问凭证及其他设置。配置文件存储在用户目录下的 `.zenlayer` 文件夹中，包含以下文件：

* `config.json` - 存储一般设置，如语言偏好和输出格式
* `credentials.json` - 存储访问凭证，采用严格的文件权限保护

## 配置方法

您可以通过以下方式配置 Zenlayer Cloud CLI：

1. **交互式配置** - 使用 `zeno configure` 命令进行交互式配置
2. **手动编辑配置文件** - 直接编辑配置文件
3. **环境变量** - 设置环境变量来覆盖配置文件中的设置

## 配置优先级

Zenlayer Cloud CLI 按照以下优先级应用配置（从高到低）：

1. 命令行参数（如 `--profile`、`--output` 等）
2. 环境变量（如 `ZENLAYER_PROFILE`、`ZENLAYER_ACCESS_KEY_ID` 等）
3. 配置文件中的设置

## 配置内容

配置指南分为以下几个部分：

* **配置文件** - 详细介绍配置文件的结构、位置和内容
* **环境变量** - 介绍支持的环境变量和使用方法
* **命令行选项** - 介绍支持的命令行选项和使用方法
* **命令补全** - 介绍如何配置和使用命令补全功能

## 快速配置

要快速配置 Zenlayer Cloud CLI，请运行以下命令：

```bash
zeno configure
```

这将引导您完成交互式配置过程，包括输入访问凭证、选择默认区域、设置输出格式等。

## 下一步

* 阅读 [配置文件](/zenlayer-cli/cn/configure/files.md) 了解配置文件的详细结构
* 阅读 [环境变量](/zenlayer-cli/cn/configure/envvars.md) 了解支持的环境变量
* 阅读 [命令行选项](/zenlayer-cli/cn/configure/options.md) 了解支持的命令行选项
* 阅读 [命令补全](/zenlayer-cli/cn/configure/completion.md) 了解如何配置命令补全


---

# 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/configure.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.
