Skip to content
LOOMLOCALE

CLI commands

The tongue CLI (also available as next-tongue) connects your repo to Loomlocale; only init, update and translate can incur charges, and every run shows the cost first.

CommandAccountBehaviour
`npx next-tongue` / `tongue init`YesGuided wizard: detect, sign in, link, source, files, targets, estimate, translate, summary
`tongue login` / `logout` / `whoami`—Device-code auth, token revoke, identity and usage
`tongue link`YesPick or create a project; writes `cloud.projectId`
`tongue update`YesHash-diff sync; only new or changed keys are billed
`tongue status`YesPer-locale counts: current, stale, missing, deleted, in review, conflicts
`tongue push`YesUpload source catalogue, hashes and glossary. No charge
`tongue pull`YesDownload accepted translations and web edits. No charge
`tongue build` / `check` / `extract` / `export` / `import` / `report` / `migrate`NoOffline, unchanged

init

tongue init runs the wizard in an existing project. Add --yes and flags (--source, --files, --targets, --project, --max-cost) to run it in scripts.

login

$ tongue login
┌  Sign in to Loomlocale
│  Your code:  WDJB-MJHT
│  Open:       https://www.loomlocale.com/device
◒  Waiting for approval…
◇  Signed in as louis@… (Loomlocale Labs, Pro)
└  Token saved to macOS Keychain

The CLI uses the OAuth 2.0 device grant (RFC 8628). Approve the code at /device. Tokens are stored in the OS keychain, or ~/.config/loomlocale/credentials.json (mode 0600). LOOMLOCALE_TOKEN always wins. tongue logout revokes the token server-side; tongue whoami shows user, org, plan, linked project and allowance used (Free: the one-time 50,000 characters per organisation, which never resets).

link

tongue link searches your organisation's projects or creates one, writes cloud.projectId to tongue.config.ts and pushes the source catalogue so the project appears in the dashboard straight away.

update

$ tongue update --dry-run
◇  Compared 1,252 keys with tongue.lock and server rev 41
│  + 9 new   ~ 3 changed   - 2 deleted   = 1,238 unchanged
│  ↓ 5 web edits
│  ! 1 conflict   dashboard.title [fr]
│  Billable  12 keys × 6 locales = 3,960 chars · £0.10
└  Dry run: no files written, nothing billed

tongue update pushes source, pulls web edits, translates new and changed keys, removes deleted keys, validates ICU and writes files. Flags: --dry-run, --ci, --prefer=web|local, --locale, --keys, --max-cost. A target edited both locally and on the web is shown side by side; --ci never prompts and exits 1 unless --prefer is set.

status

tongue status prints per-locale counts. tongue status --check exits 1 if anything is stale, for CI gates.

push

tongue push uploads the source catalogue, hashes, $description/$meta and your local glossary. Nothing is translated or billed.

pull

tongue pull downloads accepted translations and dashboard edits into local files and updates tongue.lock. No charge.

CI

Create a project token (llt_…) in the dashboard and store it as LOOMLOCALE_TOKEN. Personal device tokens are refused with --ci.

- uses: loomlocale/update@v1
  with:
    token: ${{ secrets.LOOMLOCALE_TOKEN }}
    mode: pr

Exit codes

CodeMeaning
0OK
1Validation failure or unresolved conflict
2Error
3Authentication required
4Not enough prepaid credit (`insufficient_credit`, top up at www.loomlocale.com/dashboard/billing) or `--max-cost` exceeded