# gt: General Translation CLI tool: Running in CD
URL: https://generaltranslation.com/en-US/docs/cli/guides/continuous-translation/running-in-cd.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: How to run gt translate before your build command so every deploy ships current translations.

Adding [`npx gt translate`](/docs/cli/reference/commands/translate) right before your production build is the simplest way to keep translations current on Vercel, Netlify, or any deployment pipeline.

## Setup [#setup]

1. Commit `gt.config.json` and add `GT_API_KEY` and `GT_PROJECT_ID` to your hosting or CD provider's secret environment variables. (See [Shared requirements](/docs/cli/guides/continuous-translation#credentials)).
2. Prepend [`npx gt translate`](/docs/cli/reference/commands/translate) to your build script:

```json title="package.json"
{
  "scripts": {
    "translate": "npx gt translate",
    "build": "npm run translate && <your build command>"
  }
}
```

If your deploy pipeline runs steps directly instead of an npm script, run [`npx gt translate`](/docs/cli/reference/commands/translate) immediately before your build step.

<Callout type="info">
  **Existing standalone translations:** If your repo already has translated JSON, YAML, or MDX files you want to preserve, run [`npx gt upload`](/docs/cli/reference/commands/upload) once locally before enabling automated builds.
</Callout>

## Options and guardrails [#guardrails]

- **Do not fail builds on a billing limit:** [`gt translate`](/docs/cli/reference/commands/translate) fails when enqueueing new work if your Organization hits its **Usage Limit** or runs out of credits. [`gt download`](/docs/cli/reference/commands/download) is not billing-gated, so falling back to it downloads completed translations for unchanged source files (skipping only modified files that could not be translated):

  ```bash
  npx gt translate || npx gt download
  ```

  *Note: For framework apps with inline content and `stageTranslations` off, [`gt download`](/docs/cli/reference/commands/download) requires a prior `_versionId` in `gt.config.json` unless [`omitConfigIds`](/docs/cli/reference/config#omit-config-ids) is `true`.*

- **Avoid `--force`:** `--force` re-translates everything, overwrites manual edits, and bills on every run.
- **Sync local edits:** Pass `--save-local` or set [`options.saveLocal`](/docs/cli/reference/config#save-local) to `true` if your team edits committed translation files directly.
- **Branches, tags, and CDN:** Pass `--enable-branching` to isolate feature branches ([Tracking translations by branch](/docs/cli/guides/branching)), `--tag` to tag runs with the git commit, `--dry-run` on PR checks, or `--publish` after enabling **CDN** in **Project > Settings**.
- **Applied Glossary updates:** Fresh builds with gitignored outputs pull updates automatically after **Project > Context > Apply**. If translations and `gt-lock.json` are committed, run [`npx gt translate --force-download`](/docs/cli/reference/commands/translate) to overwrite unchanged-source files.

## Next steps

- /docs/cli/guides/continuous-translation/using-github-actions
- /docs/cli/guides/continuous-translation/staging-in-ci
- /docs/cli/guides/continuous-translation/splitting-ci-stages
- /docs/cli/guides/branching

## Sitemap

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