CLI

Push, pull and run any op from a terminal or CI with the Glossa CLI.

The CLI is @meterapp/glossa on npm. It needs Node 20 or later and no install: run it with npx. It reads the op catalog from the API at runtime, so every op the API has is a command, including ones added after your version was published.

npx @meterapp/glossa --help

Authentication

Run npx @meterapp/glossa login. It prints a short code and opens https://getglossa.dev/activate; sign in, check the code matches and approve, and the CLI receives a workspace API key named for your machine. Over SSH or from an agent, open the printed URL on any device (add --no-browser to skip opening one). To use an existing key, run npx @meterapp/glossa login --key gls_…. In CI and scripts, set GLOSSA_API_KEY instead. GLOSSA_HOST overrides the API origin (default https://getglossa.dev).

Commands

CommandWhat it does
glossa login [--no-browser]Sign in with your browser: approve the code at /activate and the CLI saves a new workspace API key.
glossa login --key gls_…Save an existing API key instead (scripts, machines without a browser). --key alone prompts for one.
glossa logoutForget the saved key. Revoke it in Settings → API keys to stop it working.
glossa push [files…] [--project p] [--locale l] [--with-translations]Push files (or directories). Without arguments, pushes the files in .glossa.json. An .xcstrings catalog Glossa already holds goes as its source language only (translations stay in Glossa, and pull still writes every locale); --with-translations sends it whole to import the translations in it.
glossa pull [paths…] [--project p] [--locale es,fr] [--out dir] [--approved-only] [--no-validate] [--strict]Write every locale of each file in its own format. Each translation is validated first (placeholders, ICU plurals, max_length, escaping, numbers, prices, URLs); a failing one keeps the value already on disk, is printed and goes to the review queue. Exits 0 unless --strict.
glossa sync [files…] [--wait 10m] [--no-pull] [--locale es,fr] [--out dir] [--context [--src dir…]] [--no-validate] [--strict]Push the files in .glossa.json, wait for AI translation (ai mode, up to --wait), then pull every locale of them. Exits 1 if a push or job fails or jobs outlast --wait. --context records where new keys are used in the code before they are translated.
glossa missing [--project p] [--locale es,fr] [--out file]Strings still missing a translation, with every key, file path, glossary term and rule an agent needs to translate them from the code.
glossa context [--project p] [--src dir…] [--dry-run] [--all]Find where each key is used in the code (next-intl and i18next calls with literal keys) and record it with set_key_context, so the AI knows what a string is. Only keys without context unless --all. Page metadata titles get max_length 60 and descriptions 160; AI drafts over a new limit are translated again.
glossa fill <file.json|-> [--status s] [--overwrite m]Write translations from a JSON array of {"unit", "locale", "text"}, in batches of 200.
glossa check [--max-missing n] [--min-coverage pct] [--stale fail|warn|ignore] [--wait 10m]The release gate: exits 1 unless every string in this commit's source files is translated and the locale files match what pull writes.
glossa tasks [--kind k] [--limit n]Show the review queue.
glossa opsList every op, read live from the API.
glossa <op> [--field value…] [--json '{…}' | @file | -]Run any op. Flags map to the op's input fields; --json passes the whole input, inline, from a file or from stdin.
glossa mcpA stdio MCP bridge to the hosted server, for hosts without HTTP MCP.

Project config

Put a .glossa.json at your repository root so push and pull need no arguments:

.glossa.json
{  "project": "web",  "files": [    "locales/en.json"  ],  "locales": [    "es",    "fr",    "de"  ]}

Running any op

Every op in the API reference is a command with the same name. Pass input fields as flags, or the whole input as JSON:

npx @meterapp/glossa run_audit --locale es --question "Are brand names consistent?"npx @meterapp/glossa list_tasks --json '{"kind":"merge_review","limit":10}'npx @meterapp/glossa tasks --kind translation_review

Translating with your agent

Set a project's translation mode to agent (dashboard → project settings → Who translates, or update_project --translation-mode agent) and pushes no longer queue AI translation. A coding agent then works through the missing strings with the code where each key is used in view, and writes them back:

npx @meterapp/glossa missing --project web --locale es --out missing.jsonnpx @meterapp/glossa fill translations.json   # [{"unit": "…", "locale": "es", "text": "…"}]

Sync

sync is push, wait and pull in one command, for a developer before opening a pull request and for CI on every pull request. It pushes each source file in .glossa.json; in translation_mode ai it waits for the translate jobs those pushes started (default --wait 10m); then it writes every target locale of those files to its path and prints a summary: keys pushed, strings translated and flagged for review per locale, files written and changed. In agent mode nothing is translated automatically: it pulls what is there and says how many new strings wait for missing and fill.

npx @meterapp/glossa sync --wait 10m   # push, wait for AI translation, pull every locale

It exits 1 when a push fails, a file is in a format Glossa is still learning, a translate job fails, or jobs are still running at the deadline (it still writes what is done; run it again to pull the rest). --json prints the whole result.

With --context, new strings get their code context before they are translated: the pushes create the keys without translating them (push_file with translate: false), context records where each new key is used, then one translate job runs with that context in the prompt. Fewer strings come back flagged for review. If the code scan fails, the strings are translated anyway and the error is reported.

In CI

Push the source file on every change to your main branch. Translations arrive in the background; pull them in a scheduled job or before release.

# .github/workflows/translations.ymlname: Translationson:  push:    branches: [main]    paths: ["locales/en.json"]jobs:  sync:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - run: npx @meterapp/glossa push locales/en.json --project web        env:          GLOSSA_API_KEY: ${{ secrets.GLOSSA_API_KEY }}

To stop a deploy until its strings are translated, run npx @meterapp/glossa check before it. See Release gate.

MCP bridge

Most agents connect to the hosted MCP server directly (see MCP). For a host that only speaks stdio, run npx @meterapp/glossa mcp as the server command with GLOSSA_API_KEY set.