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
- Open app.langctl.com → API Keys and click New API Key.
- Choose the permissions (scopes) the key needs — see below.
- Copy the key. It starts with
lc_and is shown only once.
Scopes
| Scope | Allows |
|---|---|
translations:read | pull, export, keys list/get, project stats |
translations:write | push, import, create/update/delete/publish keys (implies read) |
projects:read | Reading project details |
projects:write | Creating and updating projects, adding and removing project languages |
org:admin | Team 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:
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:
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:
$ 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:
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:
- 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:
--api-key <key>flagLANGCTL_API_KEYenvironment variable- 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
| Message | Exit code | What to do |
|---|---|---|
| Not authenticated | 3 | Run langctl init / langctl auth, or set LANGCTL_API_KEY |
| Your API key is invalid or has been revoked | 3 | Create a new key in the dashboard |
| API key missing required scope: … | 3 | Create a key with that scope |
| That does not look like a Langctl API key | 3 | The key must be lc_ + 64 hex characters — check for truncation when copying |
See Configuration for every exit code.