# gt: General Translation CLI tool: gt upload URL: https://generaltranslation.com/en-US/docs/cli/reference/commands/upload.mdx --- title: gt upload description: Upload source files and translations to the General Translation platform. API reference for the gt upload command. --- Uploads your project's source files and any existing translations to the General Translation platform, syncing local files so they can be managed, enqueued, and tracked. Pair it with [`gt enqueue`](/docs/cli/reference/commands/enqueue) and [`gt download`](/docs/cli/reference/commands/download) to split translation across CI stages. See [Manage translations](/docs/cli/guides/managing-translations#split). *Note: For production use only. Requires a production `GT_API_KEY` and `GT_PROJECT_ID`.* ```bash npx gt upload ``` ## How it works [#how-it-works] 1. Reads `gt.config.json` to determine which files to upload. 2. Collects all translatable source files. 3. Hashes each file to generate a `fileId` (from its path) and `versionId` (from its content). 4. Queries the API to determine which files are new or changed. 5. Detects file moves — same content, different path — and preserves existing translations. 6. Uploads new and changed source files, along with any local translation files. ## Flags [#flags] `upload` accepts the same flags as [`gt translate`](/docs/cli/reference/commands/translate#flags). The flags most commonly used with it are below; the linked reference above lists the complete set. | Parameter | Description | Type | Optional | Default | | --- | --- | --- | --- | --- | | `--api-key ` | Production API key. | `string` | Yes | `GT_API_KEY` | | `--project-id ` | Project ID. | `string` | Yes | `GT_PROJECT_ID` | | `-c, --config ` | Path to the config file. | `string` | Yes | `gt.config.json` | | `--locales ` | Extra target locales, appended to config locales. | `string[]` | Yes | — | | `--default-locale ` | Source locale for the project. | `string` | Yes | `en` | | `--timeout ` | Request timeout in seconds. | `number` | Yes | `900` | | `--dry-run` | Collect files and report them without uploading. | `boolean` | Yes | `false` | ## Example [#example] ```bash # Stage 1: upload source files (this command) npx gt upload # Stage 2: enqueue translations npx gt enqueue # Stage 3: download when ready npx gt download ``` ## Other notes [#notes] - `upload` collects translatable source files of every configured type (JSON, YAML, Markdown, MDX, and more) and any local translation files. - Because it hashes each file by path and content, moved files (same content, new path) keep their existing translations instead of being re-translated.