CLI reference
CLI Installation
The langctl CLI keeps the translation files in your repository in sync with langctl — locally and in CI/CD.
Requirements
- Node.js 20 or newer (
node --version) - macOS, Linux or Windows
Install
npm install -g langctl
langctl --version Other package managers work too:
pnpm add -g langctl
yarn global add langctl Or run it without installing — handy in CI:
npx langctl@latest --help Tip
In CI, pin the major version (npx langctl@0 …) so a future breaking release can’t change your pipeline unexpectedly.
Verify
$ langctl --version
0.3.0
$ langctl --help
Usage: langctl [options] [command]
Commands:
init set up this repository: authenticate if needed and write langctl.json
auth store an API key (prefer --stdin so the key stays out of shell history)
whoami show the organization, key and scopes in use, and check connectivity
pull download translations into files
push upload translation files (by default only the source language)
export export translations to a file (one-off)
import import one translation file
projects manage projects
keys manage translation keys
team manage team members
org organization info
... Set up a repository
Run init in the root of your app. It asks for an API key if you don’t have one stored (input is hidden), lets you pick the project, file format and location, and writes a langctl.json you can commit:
langctl init Create the API key first at app.langctl.com → API Keys — it is shown only once. Then:
langctl pull # download translations into your files
langctl push # upload new strings from your source-language file Everything can also be passed as flags, so init works non-interactively too:
langctl init --project web-app --format json --output "src/locales/{lang}.json" Upgrading from 0.2
0.3 is a rewrite focused on reliability. Things to know when upgrading:
- Node.js 20+ is required.
pull/exportuse each platform’s default layout (locales/{lang}.json,res/values-xx/strings.xml,xx.lproj/Localizable.strings,lib/l10n/app_xx.arb). Pass-oor setoutputinlangctl.jsonto keep your old paths.- Exporting several languages to a single file is now an error instead of silently overwriting it.
- Destructive commands ask for confirmation and need
--yeswhen not run interactively. keys translatetakes the text with-t/--text;keys createaccepts--value LANG=TEXTfor any language.teamcommands need an API key with theorg:adminscope.
See the full changelog.
Next steps
- Authentication — API keys, scopes and CI
- Configuration —
langctl.json, environment variables, exit codes - Pull, Push & Import — the day-to-day workflow