> 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.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJiNzgyZDFhZi00MWZkLTQ4ZmQtOTNjOC1hZTIwMmY2NDA4NjUiLCJleHAiOjE3ODExODc2NTIsImlhdCI6MTc4MTE4NzM1Mn0.aN2UkeFX6LFHFlIa8PPSEA4BVNAtIgQURqBuR75qepo
>
> 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` |

使用 `--log-level debug` 在排查问题时查看详细输出。

## help

在任何 Fern CLI 命令中使用 `--help` 选项来查看说明和可用选项。

```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]
```

## log-level

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

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

* `debug`: 调试信息、提示信息、警告和错误
* `info`: 提示信息、警告和错误
* `warn`: 仅警告和错误
* `error`: 仅错误信息

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