# gt: General Translation CLI tool: 认证 URL: https://generaltranslation.com/zh/docs/cli/auth.mdx --- title: 认证 description: 使用 General Translation 验证你的项目 --- ## 用法 ```bash npx gt auth ``` ## 概述 使用此 CLI 命令可为你的项目生成 API 密钥和项目 ID。 此命令将会: 1. 提示用户登录 General Translation 仪表板。 2. 为你的项目生成 API 密钥和项目 ID。 3. 在项目根目录创建 `.env.local` 文件,并将其添加到 `.gitignore` 文件中 (如果该文件尚不存在) 。 4. 将 API 密钥和项目 ID 写入 `.env.local` 文件。 ## 选项 | 参数 | 描述 | 类型 | 可选 | 默认值 | | ----------------------- | ------------------------------------------- | -------- | ------ | ------------------ | | `-c, --config ` | GT config file 的路径 | `string` | `true` | `"gt.config.json"` | | `-t, --key-type ` | 要生成的密钥类型:`production`、`development` 或 `all` | `string` | `true` | 交互式提示 |