Skip to content

CLI reference

Authentication

langctl authenticates with an organization API key. Store it once on your machine, or provide it as an environment variable in CI.

Create an API key

  1. Open app.langctl.com → API Keys and click New API Key.
  2. Choose the permissions (scopes) the key needs — see below.
  3. Copy the key. It starts with lc_ and is shown only once.

Scopes

ScopeAllows
translations:readpull, export, keys list/get, project stats
translations:writepush, import, create/update/delete/publish keys (implies read)
projects:readReading project details
projects:writeCreating and updating projects, adding and removing project languages
org:adminTeam members, invitations and API keys (langctl team …), and deleting projects. Off by default.

Every key can read basic organization and project details. Give CI keys only what the job needs — translations:read is enough for langctl pull --check. Deleting the organization or transferring ownership is never possible with an API key.

On your machine

The easiest way is langctl init, which asks for the key when needed. To store a key directly:

terminal
langctl auth

auth prompts for the key with hidden input, verifies it against the API, and saves it to ~/.langctl/config.json (readable only by you). To pipe it in instead — for example from a password manager:

terminal
echo "$LANGCTL_API_KEY" | langctl auth --stdin

Warning

langctl auth lc_… with the key as an argument still works, but the key ends up in your shell history. Prefer the prompt or --stdin.

Check which organization and key you’re using:

terminal
$ langctl whoami
Acme Inc (acme, pro plan)
key      lc_3f1a…9c2e  from /Users/you/.langctl/config.json
scopes   translations:read, translations:write, projects:read
api      https://api.langctl.com/api/v1  142ms

Remove the stored key:

terminal
langctl logout

In CI/CD

Don’t run auth in CI. Store the key as a secret and expose it as LANGCTL_API_KEY — no config file or login step is needed:

.github/workflows/i18n.yml
- run: npx langctl@0 pull --check
env:
  LANGCTL_API_KEY: ${{ secrets.LANGCTL_API_KEY }}

Verify a key in a pipeline with langctl whoami --json.

Where credentials come from

langctl uses the first one it finds:

  1. --api-key <key> flag
  2. LANGCTL_API_KEY environment variable
  3. The stored key in ~/.langctl/config.json (or $LANGCTL_CONFIG_DIR/config.json)

langctl config shows the effective key (masked) and where it came from, without making any network call.

Errors

MessageExit codeWhat to do
Not authenticated3Run langctl init / langctl auth, or set LANGCTL_API_KEY
Your API key is invalid or has been revoked3Create a new key in the dashboard
API key missing required scope: …3Create a key with that scope
That does not look like a Langctl API key3The key must be lc_ + 64 hex characters — check for truncation when copying

See Configuration for every exit code.