# gt: General Translation CLI tool: gt auth
URL: https://generaltranslation.com/en-US/docs/cli/reference/commands/auth.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Generate General Translation API credentials for a project. API reference for the gt auth command.

Generates an API key and project ID and writes them to your `.env.local` file. If `.env.local` does not exist, the command creates it and adds it to `.gitignore`.

When you do not pass `--key-type`, the command prompts you to choose which key type to generate.

```bash
npx gt auth
```

## How it works [#how-it-works]

1. Prompts you to sign in to the General Translation Dashboard.
2. Generates the requested API key type and project ID.
3. Creates `.env.local` (and adds it to `.gitignore`) if needed.
4. Writes `GT_API_KEY` and `GT_PROJECT_ID` to `.env.local`.

## Flags [#flags]

| Parameter | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| `-c, --config <path>` | Path to the config file. | `string` | Yes | `gt.config.json` |
| `-t, --key-type <type>` | Key type to generate: `production`, `development`, or `all`. | `string` | Yes | Prompted |

## Example [#example]

```bash
# Prompt for the key type, then write credentials to .env.local
npx gt auth

# Generate a production key without the prompt
npx gt auth --key-type production
```

## Other notes [#notes]

- The API key and project ID are not required to use `gt-react` or `gt-next` — they are only needed to call the General Translation API.
- `auth` is the credentials step of the [`gt init`](/docs/cli/reference/commands/init) wizard. Run it on its own to generate credentials for an already-configured project.

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
