> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI4YWZiN2NkNC05ZjEyLTQ5OWEtYjFiMS1iMWM2Y2FkNDdlZmIiLCJleHAiOjE3NzgzNjI5MjAsImlhdCI6MTc3ODM2MjYyMH0.z7uPK228wGvTIaw1T01ctBgAJvxoW6LJjZQa9PwzOAg
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# 全局选项

> Fern CLI 的全局选项

这些选项适用于任何 Fern CLI 命令，用于控制日志记录和获取帮助。

| 选项                          | 描述        | 示例                                |
| --------------------------- | --------- | --------------------------------- |
| [`--help`](#help)           | 显示命令帮助和选项 | `fern --help`                     |
| [`--log-level`](#log-level) | 设置日志详细程度  | `fern generate --log-level debug` |

<Tip>
  使用 `--log-level debug` 在故障排除时查看详细输出。
</Tip>

## help

使用 `--help` 选项与任何 Fern CLI 命令一起查看说明和可用选项。

<CodeBlocks>
  ```bash maxLines=10 title="fern add --help"
  fern add --help
  fern add <generator>

  Add a code generator to generators.yml

  Positionals:
    generator                                                [string] [required]

  Options:
    --help     Show help                                               [boolean]
    --log-level    [choices: "debug", "info", "warn", "error"] [default: "info"]
    --api      Only run the command on the provided API                 [string]
    --group    Add the generator to the specified group                 [string]
  ```

  ```bash maxLines=10 title="fern write-definition --help"
  fern write-definition --help
  fern write-definition

  Write underlying Fern Definition for OpenAPI Specifications and API Dependencies.

  Options:
    --help     Show help                                               [boolean]
    --log-level    [choices: "debug", "info", "warn", "error"] [default: "info"]
    --api      Only run the command on the provided API                 [string]
  ```
</CodeBlocks>

## log-level

使用 `--log-level` 选项设置 Fern 日志输出的详细程度。默认级别为 `info`。

可用级别（从详细到简略）：

* `debug`：调试消息、信息消息、警告和错误
* `info`：信息消息、警告和错误
* `warn`：仅警告和错误
* `error`：仅错误消息

```bash
fern generate --log-level debug
```