# gt: General Translation CLI tool: gt init
URL: https://generaltranslation.com/en-US/docs/cli/reference/commands/init.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Run the General Translation setup wizard to configure a project. API reference for the gt init command.

`init` is the default command: running `npx gt` with no command runs it.

The setup wizard detects your framework and, depending on the project, installs dependencies, configures your framework, creates a `gt.config.json`, and generates credentials. For a step-by-step walkthrough, see [Configuring the CLI](/docs/cli/guides/configuring).

```bash
npx gt init
```

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

1. Detects your framework. For a Next.js App Router or Mintlify project, it offers to connect the [Locadex](/docs/platform/locadex/quickstart) AI agent instead.
2. For a React-based project, optionally installs `gt-react` or `gt-next` and configures the framework (experimental). Vite apps get an [`initializeGTSPA`](/docs/react/reference/config#initialize-spa) bootstrap that runs before the existing app entry; other supported React apps use [`GTProvider`](/docs/react/reference/components/gt-provider).
3. Prompts for any missing default and target locales and creates or updates `gt.config.json`. Existing locale and file settings are preserved. For local Vite storage, it also creates a [`loadTranslations`](/docs/react/reference/functions/load-translations) file and empty target-locale files.
4. Installs `gt` as a dev dependency when the configured workflow needs a persistent CLI installation. Vite framework setup does not add `gt`; continue to run it with `npx gt`.
5. Optionally generates an API key and project ID and writes them to `.env.local`.

*Note: The React setup step is experimental and may not work for every project. Review the changes it makes.*

## Flags [#flags]

| Parameter | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| `--src <paths...>` | Glob patterns for the app's source code. | `string[]` | Yes | `src`, `app`, `pages`, `components` globs |
| `-c, --config <path>` | Path to the config file. | `string` | Yes | `gt.config.json` |

## Example [#example]

```bash
# Run the full setup wizard
npx gt init

# Running gt with no command does the same thing
npx gt
```

## Other notes [#notes]

- `init` runs the same steps as [`gt configure`](/docs/cli/reference/commands/configure) and [`gt auth`](/docs/cli/reference/commands/auth) together, plus the experimental React setup wizard. Run either command on its own to repeat just that step. It does not run [`gt setup`](/docs/cli/reference/commands/setup), which uploads your source files.
- In a monorepo, run `init` from the specific app directory. The command stops without changing files when the current directory is a workspace root with `pnpm-workspace.yaml` or a `workspaces` field.
- Automatic setup is not available for Electron applications.
- 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.
- If the experimental React setup does not work for your project, set it up manually using the [React](/docs/react/react-quickstart) docs.

## Sitemap

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