On Bitbucket, run the @lingo.dev/cli inside a pipeline step: install it, run lingo push to translate changed source strings through your engine, then commit the results or open a pull request with Bitbucket's own tooling.
Prerequisites
You need a committed .lingo/config.json (with an engineId, source and target locales, and files patterns) and your Lingo.dev API key stored as a repository variable. See the CLI quickstart to create the config.
Authentication#
The CLI authenticates with the LINGO_API_KEY environment variable. Add your key as a secured repository variable so it is available to pipeline steps:
Repository settings > Repository variables — add LINGO_API_KEY and mark it secured.
To push commits or open pull requests back to the repository, the pipeline also needs Git write access. The standard options are a repository SSH key (Repository settings > SSH keys) or a repository access token with Read & write repositories (and pull requests, for PR mode) scope, stored as a secured repository variable such as BB_TOKEN.
Workflow examples#
Direct commit (default)#
Install the CLI, run lingo push, and commit the translated files back to the branch:
image: node:22
pipelines:
branches:
main:
- step:
name: Translate
script:
- npm install -g @lingo.dev/cli
- lingo push
- git config user.name "lingo-bot"
- git config user.email "support@lingo.dev"
- git add .
- git diff --cached --quiet || git commit -m "chore: update translations"
- git push origin HEAD:mainlingo push translates only what changed since the last run (tracked in .lingo/lock.json), waits for the run to finish, and writes the outputs to disk.
Pull request mode#
Push the translations to a dedicated branch instead of committing to main, then open a pull request with Bitbucket's tooling:
image: node:22
pipelines:
branches:
main:
- step:
name: Translate
script:
- npm install -g @lingo.dev/cli
- lingo push
- git config user.name "lingo-bot"
- git config user.email "support@lingo.dev"
- git checkout -b lingo/translations
- git add .
- git diff --cached --quiet || git commit -m "feat: update translations"
- git push origin lingo/translations
# Open a PR from lingo/translations into main via the Bitbucket UI or APIMonorepo#
Run the CLI from a subdirectory when your config lives inside a workspace. The CLI resolves .lingo/config.json from the working directory:
image: node:22
pipelines:
branches:
main:
- step:
name: Translate
script:
- cd apps/web
- npm install -g @lingo.dev/cli
- lingo pushPipeline variables#
| Variable | Required | Description |
|---|---|---|
LINGO_API_KEY | Yes | Lingo.dev API key. Store as a secured repository variable. |
BB_TOKEN | For push/PR write access | Repository access token (or SSH key) used by Git to commit or open pull requests. |
Everything else — source locale, target locales, file patterns, and the engine to route through — lives in .lingo/config.json, not in pipeline variables.
Verify before deploy#
Add a lingo check step to fail the pipeline when any source string is missing a translation:
- step:
name: Check translations
script:
- npm install -g @lingo.dev/cli
- lingo check