# gt: General Translation CLI tool: gt configure URL: https://generaltranslation.com/zh/docs/cli/reference/commands/configure.mdx --- title: gt configure description: 创建 General Translation 的 gt.config.json 文件。gt configure 命令的 API 参考。 --- 在项目根目录创建或更新一个 `gt.config.json` 文件。与 [`gt init`](/docs/cli/reference/commands/init) 不同,该命令不会安装依赖、修改框架设置或生成凭据,只会写入配置。 该命令会提示你输入缺失的区域设置和要翻译的文件类型。它会保留有效的现有区域设置和文件设置。若想了解生成后的文件,请参阅[配置 CLI](/docs/cli/guides/configuring)。 ```bash npx gt configure ``` ## 工作方式 [#how-it-works] 1. 读取现有配置,并提示你输入缺失的默认区域设置、目标区域设置和文件类型。 2. 写入 `defaultLocale`、`locales` 和一个 `files` 对象,不会替换无关的文件设置。 `configure` 是 [`gt init`](/docs/cli/reference/commands/init) 向导中的配置步骤。单独运行它即可创建配置文件,而不会涉及依赖项、框架设置或凭据。 ## 标志 [#flags] `configure` 没有任何命令专用标志——它完全通过交互方式运行,并且始终写入 `gt.config.json` (如果该文件已存在,则写入 `src/gt.config.json`) 。和所有命令一样,它也接受全局 `--skip-version-check` 标志。 ## 示例 [#example] ```bash # 以交互方式生成 gt.config.json npx gt configure ``` ## 其他说明 [#notes] * 在 monorepo 中,请在特定 app directory 中运行 `configure`。如果当前目录是包含 `pnpm-workspace.yaml` 或 `workspaces` field 的 workspace root,该命令会停止,且不会更改文件。 * Electron 应用程序不支持自动配置。 * 生成的 `gt.config.json` 包含 `defaultLocale`、`locales`,以及一个用于说明待翻译内容的 `files` 对象。有关所有可用选项,请参阅[配置参考](/docs/cli/reference/config)。