跳到导航

全局选项

探索 Fern CLI 全局选项。
以 Markdown 格式查看

这些选项可以与任何 Fern CLI 命令配合使用,用于控制日志记录和获取帮助。

选项描述示例
--help显示命令帮助和选项fern --help
--log-level设置日志详细程度fern generate --log-level debug

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

help

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

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: 仅错误信息
fern generate --log-level debug