تخطَّ إلى المحتوى
glot
القائمة

المرجع

CLI reference

Generated from the help of glot 0.3.0. Every command also prints this with glot <command> --help.

AI-native localization for SaaS apps

Usage: glot <COMMAND>

Commands:
  init       Detect the i18n stack and write glot.toml + AI agent integration
  status     Per-locale coverage and translation plan
  check      Validate every translation (placeholders, plurals, glossary). Exit 1 on errors
  translate  Translate missing and stale strings with the configured LLM
  fit        Shorten translations that overflow in the running app, re-render, repeat until they fit
  measure    Record each key's pixel budget (box width, lines, font) from the running app into .glot/layout.json
  coverage   Plural/select branch coverage per locale and CLDR category (`--render`: check each branch in a browser)
  extract    Hardcoded strings in code, plus missing and unused keys
  unused     Source keys never referenced in code
  add        Add or replace a source string
  set        Set a translation by hand (validated)
  glossary   Manage glossary.toml
  review     Back-translate translations and explain them; `--stale` sorts cosmetic vs real source changes
  push       Upload catalogs, lock and glossary to the glot server
  pull       Download catalogs, lock and glossary from the glot server
  mcp        Run the MCP server on stdio
  i18nize    Convert hardcoded UI strings to translation keys and rewrite the code (next-intl / react-i18next)
  assets     Localize emails, SVG and OG images: i18nize, translate, render per locale, check
  dev        Local server for the in-app editing overlay (@glot-i18n/overlay)
  parity     Task parity: an agent runs the same tasks in every locale (glot.tasks.yaml) and compares success
  seo        Multilingual SEO: audit hreflang/canonical/metadata per locale, fix Next.js, localize keywords
  db         Translate database content (catalog, help articles…) into glot_translations (Postgres)
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

glot init

Detect the i18n stack and write glot.toml + AI agent integration

Detect the i18n stack and write glot.toml + AI agent integration

Usage: glot init [OPTIONS]

Options:
      --source <SOURCE>      Source locale (default: `en` if found, else the first detected locale)
      --targets <TARGETS>    Target locales, comma separated (default: other detected locales)
      --provider <PROVIDER>  LLM provider: anthropic | openai | openai-compatible | mock
  -y, --yes                  Accept detected defaults without prompting
      --force                Overwrite existing files
  -h, --help                 Print help

glot status

Per-locale coverage and translation plan

Per-locale coverage and translation plan

Usage: glot status [OPTIONS]

Options:
      --json  
  -h, --help  Print help

glot check

Validate every translation (placeholders, plurals, glossary). Exit 1 on errors

Validate every translation (placeholders, plurals, glossary). Exit 1 on errors

Usage: glot check [OPTIONS]

Options:
      --format <FORMAT>  [default: text] [possible values: text, json, sarif, github]
  -h, --help             Print help

glot translate

Translate missing and stale strings with the configured LLM

Translate missing and stale strings with the configured LLM

Usage: glot translate [OPTIONS]

Options:
      --locale <LOCALE>            Locales to translate (comma separated). Default: all targets
      --key <KEY>                  Only these keys (comma separated or repeated)
      --force                      Retranslate up-to-date and hand-edited entries too
      --dry-run                    Show the plan and estimated cost only
  -y, --yes                        Do not ask for confirmation
      --visual                     Capture the running app and show the LLM where each key renders (`--base-url`, `--routes`)
      --batch                      First pass through the Anthropic Message Batches API: -50 %, asynchronous (minutes to hours). Resumable: rerun the same command if interrupted
      --provider <PROVIDER>        LLM provider for this run, overriding glot.toml (`mock`: offline, free, no API key) [possible values: mock, anthropic, openai, openai-compatible]
      --base-url <BASE_URL>        Running app to capture [default: http://localhost:3000]
      --routes <ROUTES>            Routes to capture (comma separated) [default: /]
      --url-pattern <URL_PATTERN>  URL layout; the source locale gets no prefix [default: /{locale}{route}]
      --viewports <VIEWPORTS>      [default: 1280x800]
  -h, --help                       Print help

glot fit

Shorten translations that overflow in the running app, re-render, repeat until they fit

Shorten translations that overflow in the running app, re-render, repeat until they fit

Usage: glot fit [OPTIONS]

Options:
      --base-url <BASE_URL>
          Running app to capture [default: http://localhost:3000]
      --routes <ROUTES>
          Routes to capture (comma separated) [default: /]
      --url-pattern <URL_PATTERN>
          URL layout; the source locale gets no prefix [default: /{locale}{route}]
      --viewports <VIEWPORTS>
          [default: 1280x800]
      --locales <LOCALES>
          Locales to fix (comma separated). Default: all targets
      --max-iterations <MAX_ITERATIONS>
          [default: 3]
  -y, --yes
          Write without asking
      --build-cmd <BUILD_CMD>
          Rebuild command run after each write (prod builds); dev servers just hot-reload
      --reload-ms <RELOAD_MS>
          Wait after writing before re-rendering (HMR / rebuild settle time) [default: 1500]
  -h, --help
          Print help

glot measure

Record each key's pixel budget (box width, lines, font) from the running app into .glot/layout.json

Record each key's pixel budget (box width, lines, font) from the running app into .glot/layout.json

Usage: glot measure [OPTIONS]

Options:
      --base-url <BASE_URL>        Running app to capture [default: http://localhost:3000]
      --routes <ROUTES>            Routes to capture (comma separated) [default: /]
      --url-pattern <URL_PATTERN>  URL layout; the source locale gets no prefix [default: /{locale}{route}]
      --viewports <VIEWPORTS>      [default: 1280x800]
  -h, --help                       Print help

glot coverage

Plural/select branch coverage per locale and CLDR category (--render: check each branch in a browser)

Plural/select branch coverage per locale and CLDR category (`--render`: check each branch in a browser)

Usage: glot coverage [OPTIONS]

Options:
      --locale <LOCALE>            Locales (comma separated). Default: source, targets and register variants
      --key <KEY>                  Only these keys
      --render                     Mount every branch on the app page (`--base-url`, first `--routes`) and check overflow/truncation
      --json                       
      --base-url <BASE_URL>        Running app to capture [default: http://localhost:3000]
      --routes <ROUTES>            Routes to capture (comma separated) [default: /]
      --url-pattern <URL_PATTERN>  URL layout; the source locale gets no prefix [default: /{locale}{route}]
      --viewports <VIEWPORTS>      [default: 1280x800]
  -h, --help                       Print help

glot extract

Hardcoded strings in code, plus missing and unused keys

Hardcoded strings in code, plus missing and unused keys

Usage: glot extract [OPTIONS]

Options:
      --json  
  -h, --help  Print help

glot unused

Source keys never referenced in code

Source keys never referenced in code

Usage: glot unused [OPTIONS]

Options:
      --prune  Delete them from every catalog
      --json   
  -h, --help   Print help

glot add

Add or replace a source string

Add or replace a source string

Usage: glot add [OPTIONS] <KEY> <VALUE>

Arguments:
  <KEY>    
  <VALUE>  

Options:
      --note <NOTE>  Context for translators (stored in glot.lock)
  -h, --help         Print help

glot set

Set a translation by hand (validated)

Set a translation by hand (validated)

Usage: glot set <LOCALE> <KEY> <VALUE>

Arguments:
  <LOCALE>  
  <KEY>     
  <VALUE>   

Options:
  -h, --help  Print help

glot glossary

Manage glossary.toml

Manage glossary.toml

Usage: glot glossary <COMMAND>

Commands:
  list     
  add      `glot glossary add Workspace --fr "Espace de travail" --de Arbeitsbereich [--dnt] [--description ..]`
  mine     Frequent capitalized terms translated inconsistently. Mine glossary terms with the LLM and list inconsistent translations (`--apply` fixes them)
  suggest  
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

glot glossary list

Usage: glot glossary list [OPTIONS]

Usage: glot glossary list [OPTIONS]

Options:
      --json  
  -h, --help  Print help

glot glossary add

glot glossary add Workspace --fr "Espace de travail" --de Arbeitsbereich [--dnt] [--description ..]

`glot glossary add Workspace --fr "Espace de travail" --de Arbeitsbereich [--dnt] [--description ..]`

Usage: glot glossary add <TERM> [OPTIONS]...

Arguments:
  <TERM>        
  [OPTIONS]...  `--<locale> <translation>`, `--dnt`, `--case-sensitive`, `--description <text>`

Options:
  -h, --help  Print help

glot glossary mine

Frequent capitalized terms translated inconsistently. Mine glossary terms with the LLM and list inconsistent translations (--apply fixes them)

Frequent capitalized terms translated inconsistently. Mine glossary terms with the LLM and list inconsistent translations (`--apply` fixes them)

Usage: glot glossary mine [OPTIONS]

Options:
      --apply  Write the terms to glossary.toml and retranslate the inconsistent keys
      --json   
  -y, --yes    
  -h, --help   Print help

glot glossary suggest

Usage: glot glossary suggest [OPTIONS]

Usage: glot glossary suggest [OPTIONS]

Options:
      --json  
  -h, --help  Print help

glot review

Back-translate translations and explain them; --stale sorts cosmetic vs real source changes

Back-translate translations and explain them; `--stale` sorts cosmetic vs real source changes

Usage: glot review [OPTIONS]

Options:
      --locale <LOCALE>  Locales to review (comma separated). Default: all targets
      --keys <KEYS>      Only these keys (comma separated or repeated)
      --json             
      --refresh          Ignore the cache (.glot/review.json) and ask the LLM again
      --fix              Write the suggested translation for every `different` / `nuance` row (validated)
      --stale            Stale strings: keep (source change is cosmetic) or retranslate, per key
  -y, --yes              Apply without asking
  -h, --help             Print help

glot push

Upload catalogs, lock and glossary to the glot server

Upload catalogs, lock and glossary to the glot server

Usage: glot push

Options:
  -h, --help  Print help

glot pull

Download catalogs, lock and glossary from the glot server

Download catalogs, lock and glossary from the glot server

Usage: glot pull

Options:
  -h, --help  Print help

glot mcp

Run the MCP server on stdio

Run the MCP server on stdio

Usage: glot mcp

Options:
  -h, --help  Print help

glot i18nize

Convert hardcoded UI strings to translation keys and rewrite the code (next-intl / react-i18next)

Convert hardcoded UI strings to translation keys and rewrite the code (next-intl / react-i18next)

Usage: glot i18nize [OPTIONS] [PATHS]...

Arguments:
  [PATHS]...
          Files or directories to convert (default: every file matched by `[extract].include`)

Options:
      --dry-run
          Show the diff and the keys that would be created; write nothing

  -y, --yes
          Do not ask for confirmation

      --lib <LIB>
          i18n library the rewritten code targets
          
          [default: auto]
          [possible values: auto, next-intl, react-i18next]

      --routing <ROUTING>
          Next.js locale URLs: `cookie` (`/fr/...` selects and remembers the locale, no `app/[locale]` move) or `prefix` (non-default locales always under `/fr/...`)

          Possible values:
          - prefix: Non-default locales always live under `/fr/...` (`as-needed`: the default has no prefix)
          - cookie: `/fr/...` selects the locale and stores it in a cookie; unprefixed URLs keep it
          
          [default: cookie]

      --switcher
          Also generate a ready-to-use `<LocaleSwitcher />` component

      --no-install
          Do not run the package manager; print the install command instead

      --no-setup
          Only rewrite the code: do not wire the i18n library (provider, config, proxy)

  -h, --help
          Print help (see a summary with '-h')

glot assets

Localize emails, SVG and OG images: i18nize, translate, render per locale, check

Localize emails, SVG and OG images: i18nize, translate, render per locale, check

Usage: glot assets [OPTIONS] [STEP]

Arguments:
  [STEP]
          One step only (default: i18nize, translate, preview, check)

          Possible values:
          - i18nize:   Turn the copy of templates/images into catalog keys (+ pixel budgets)
          - translate: Translate the asset keys (validator, glossary, budgets, retries)
          - preview:   Render every locale: `.glot/emails/`, `public/img/{locale}/`, `public/og/{locale}/`
          - check:     Asset checks: links, subject/preheader length, RTL, rendered width. Exit 1 on errors

Options:
      --emails
          Emails: React Email (`.tsx`/`.jsx`), HTML and MJML templates

      --svg
          SVG illustrations with `<text>`

      --og
          OG images written in JSX (@vercel/og / satori)

      --emails-dir <EMAILS_DIR>
          [default: emails]

      --svg-dir <SVG_DIR>
          [default: assets]

      --og-dir <OG_DIR>
          [default: og]

  -y, --yes
          Do not ask for confirmation

  -h, --help
          Print help (see a summary with '-h')

glot dev

Local server for the in-app editing overlay (@glot-i18n/overlay)

Local server for the in-app editing overlay (@glot-i18n/overlay)

Usage: glot dev [OPTIONS]

Options:
      --port <PORT>      [default: 4317]
      --origin <ORIGIN>  Allowed app origin(s), e.g. http://localhost:3000. Default: any http://localhost:* / 127.0.0.1:*
      --token <TOKEN>    Fixed token (else GLOT_DEV_TOKEN, else random)
  -h, --help             Print help

glot parity

Task parity: an agent runs the same tasks in every locale (glot.tasks.yaml) and compares success

Task parity: an agent runs the same tasks in every locale (glot.tasks.yaml) and compares success

Usage: glot parity [OPTIONS]

Options:
      --tasks <TASKS>                  Task file: [{id, goal, start, success: {url_matches|text_visible_key|selector}, script?}] [default: glot.tasks.yaml]
      --locales <LOCALES>              Locales to test (comma separated). Default: source + all targets
      --base-url <BASE_URL>            [default: http://localhost:3000]
      --url-pattern <URL_PATTERN>      URL layout; the source locale gets no prefix. E.g. "{route}?lang={locale}" [default: /{locale}{route}]
      --locale-cookie <LOCALE_COOKIE>  Cookies (comma separated) set to the locale before each run, so in-app links keep the language. Default: NEXT_LOCALE,glot-locale (what `glot i18nize` generates); "" sets none
      --provider <PROVIDER>            anthropic (Claude vision agent) | mock (follows each task's `script`, no tokens). Default: anthropic if glot.toml uses it, else mock
      --model <MODEL>                  [default: claude-sonnet-5-5]
      --max-steps <MAX_STEPS>          [default: 15]
      --viewport <VIEWPORT>            [default: 1280x800]
      --out <OUT>                      [default: .glot/parity]
      --min-parity <MIN_PARITY>        Exit 1 if a locale's parity (success rate vs source, %) is below this [default: 0]
  -h, --help                           Print help

glot seo

Multilingual SEO: audit hreflang/canonical/metadata per locale, fix Next.js, localize keywords

Multilingual SEO: audit hreflang/canonical/metadata per locale, fix Next.js, localize keywords

Usage: glot seo <COMMAND>

Commands:
  audit     Crawl every locale: hreflang (reciprocal, x-default), canonical, <html lang>, translated title/description and their SERP length, sitemap, untranslated indexable pages. Exit 1 on errors
  fix       Next.js App Router: canonical + hreflang in generateMetadata, app/sitemap.ts, app/robots.ts
  keywords  Localize page titles/descriptions for search (what natives type) instead of literally
  help      Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

glot seo audit

Crawl every locale: hreflang (reciprocal, x-default), canonical, , translated title/description and their SERP length, sitemap, untranslated indexable pages. Exit 1 on errors

Crawl every locale: hreflang (reciprocal, x-default), canonical, <html lang>, translated title/description and their SERP length, sitemap, untranslated indexable pages. Exit 1 on errors

Usage: glot seo audit [OPTIONS] --base-url <BASE_URL>

Options:
      --base-url <BASE_URL>        Site origin, e.g. http://localhost:3000
      --routes <ROUTES>            Routes in the source locale (comma separated). Default: `/`, or the sitemap with `--sitemap`
      --sitemap                    Take the routes from /sitemap.xml
      --url-pattern <URL_PATTERN>  URL of a route in another locale [default: /{locale}{route}]
      --prefix-default             The source locale is prefixed too (default: unprefixed, `/pricing`)
      --locales <LOCALES>          Locales, source first (default: glot.toml)
      --json                       JSON report instead of markdown
  -h, --help                       Print help

glot seo fix

Next.js App Router: canonical + hreflang in generateMetadata, app/sitemap.ts, app/robots.ts

Next.js App Router: canonical + hreflang in generateMetadata, app/sitemap.ts, app/robots.ts

Usage: glot seo fix [OPTIONS]

Options:
      --dry-run  Show the diff; write nothing
  -y, --yes      
  -h, --help     Print help

glot seo keywords

Localize page titles/descriptions for search (what natives type) instead of literally

Localize page titles/descriptions for search (what natives type) instead of literally

Usage: glot seo keywords [OPTIONS]

Options:
      --locale <LOCALE>  Locales (comma separated). Default: all targets
      --keys <KEYS>      Only these keys. Default: the keys used in generateMetadata (title/description)
      --apply            Write the best variant that passes validation (glossary, placeholders, length)
      --json             
  -h, --help             Print help

glot db

Translate database content (catalog, help articles…) into glot_translations (Postgres)

Translate database content (catalog, help articles…) into glot_translations (Postgres)

Usage: glot db <COMMAND>

Commands:
  install  Create glot_translations and the change triggers on every [db] table (idempotent)
  sync     Translate missing and stale database content into glot_translations
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

glot db install

Create glot_translations and the change triggers on every [db] table (idempotent)

Create glot_translations and the change triggers on every [db] table (idempotent)

Usage: glot db install [OPTIONS]

Options:
      --database-url <DATABASE_URL>  Postgres URL (default: $DATABASE_URL)
  -h, --help                         Print help

glot db sync

Translate missing and stale database content into glot_translations

Translate missing and stale database content into glot_translations

Usage: glot db sync [OPTIONS]

Options:
      --database-url <DATABASE_URL>  Postgres URL (default: $DATABASE_URL)
      --locales <LOCALES>            Locales to translate (comma separated). Default: all targets
      --dry-run                      Show what would be translated and the estimated cost only
      --watch                        Keep running: resync on each change notified by the trigger (`glot db install`)
  -h, --help                         Print help
تعديل هذه الصفحة على GitHub