Skip to content
Docs menuMCP and API reference / CLI reference
On this page
  1. lefine login
  2. lefine init
  3. lefine logout
  4. lefine whoami
  5. lefine strings pull
  6. lefine strings push
  7. lefine strings check
  8. lefine strings unused
  9. lefine strings missing
  10. lefine strings publish
  11. lefine strings status
  12. lefine strings types
  13. lefine strings snapshot
  14. lefine strings keys list
  15. lefine strings keys create
  16. lefine strings keys delete
  17. lefine strings runs
  18. lefine strings languages add
  19. lefine doctor
  20. lefine apps
  21. lefine content types
  22. lefine migrate
  23. lefine mcp

CLI reference

Every npx lefine command and option, read from the CLI itself.

Generated from the CLI's own help (packages/cli/src/lefine.ts) by bun scripts/build-docs-reference.ts. Run any command with --help to see the same text.

Terminal
npx lefine --help

Lefine from the terminal: sign in, then push, check, publish and pull your strings

CommandWhat it does
lefine loginSign in through the browser (device code, works over SSH)
lefine initSign in, pick the app, install lefine, and write lefine.ts plus a first translated page for Next or TanStack Start
lefine logoutRemove the saved key from this machine
lefine whoamiShow who you are signed in as
lefine strings pullDownload translations from the CDN to local JSON files
lefine strings pushShow what would change, then push the source file to Lefine
lefine strings checkServer checks (ICU, placeholders, markup) plus a scan of your code
lefine strings unusedKeys in Lefine your code never uses (a scan of the code, compared on the server)
lefine strings missingNames in your code with no key in Lefine (users would see the raw name)
lefine strings publishPublish to the CDN after a person approves it in Lefine, and wait until every locale is verified
lefine strings statusLive revision, pending changes and the last CDN check
lefine strings typesWrite a .d.ts with every key of the app, so the editor knows keys added in Lefine
lefine strings snapshotWrite the published texts to a file for createLefine({ snapshot }): the first request after a deploy is served from it
lefine strings keys listKeys with their source text (or --locale), page by page
lefine strings keys createAdd a key (live with the next publish)
lefine strings keys deleteDelete keys by namespace.key or id (a person approves it in Lefine)
lefine strings runsRecent syncs, imports and publishes, or one with its steps
lefine strings languages addAdd a language (a person approves it in Lefine)
lefine doctorOne report and a 0-100 score: hard-coded text in the code, texts that break, missing and unused keys
lefine appsYour workspace's apps, with their ids
lefine content typesWrite a TypeScript file with one type per content type of a Content project
lefine migrateMove next-intl / @better-i18n code to lefine: rewrites what maps one to one, lists the rest (dry run unless --write)
lefine mcpLefine as a local MCP server (stdio) for Claude Desktop and IDEs; remote clients can use https://dash.lefine.ai/v1/mcp

lefine login

Sign in through the browser (device code, works over SSH)

Terminal
npx lefine login [options]
OptionWhat it does
--token <key>Use an access key (lfn_...) instead of the browser
--no-browserDo not try to open the browser
--api-url <url>API origin (default: LEFINE_API_URL or https://dash.lefine.ai)
--jsonMachine-readable output

lefine init

Sign in, pick the app, install lefine, and write lefine.ts plus a first translated page for Next or TanStack Start

Terminal
npx lefine init [options]
OptionWhat it does
--app <id|slug>The app, without the question (CI)
-d, --dir <path>The app's directory
-o, --output <path>Where lefine.ts goes (default: the framework's place)
--forceReplace an existing lefine.ts (never your pages)
--no-installDo not add lefine to package.json
--api-url <url>API origin
--jsonMachine-readable output

lefine logout

Remove the saved key from this machine

Terminal
npx lefine logout [options]
OptionWhat it does
--jsonMachine-readable output

lefine whoami

Show who you are signed in as

Terminal
npx lefine whoami [options]
OptionWhat it does
--api-url <url>API origin
--jsonMachine-readable output

lefine strings pull

Download translations from the CDN to local JSON files

Terminal
npx lefine strings pull [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from i18n.config.ts). workspace/app also works, as an alias
-o, --output <path>Output directory (default: ./locales)
-l, --locales <codes>Comma-separated locale codes (default: all)
-d, --dir <path>Directory with the config
--cdn-url <url>CDN origin (default: LEFINE_CDN_URL or https://cdn.lefine.ai)
--since <revision>List what changed since this revision first
--forceDownload every locale even when it is unchanged since the last pull
--verboseShow detail per locale
--jsonMachine-readable output

lefine strings push

Show what would change, then push the source file to Lefine

Terminal
npx lefine strings push [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--file <path>Source locale file: JSON, YAML, XLIFF, Android XML or .properties (default: /.json)
--namespace <name>For a YAML, XLIFF, XML or .properties file: its namespace (default: the file's name)
--locale <code>Source locale (default: from i18n.config.ts)
-y, --yesApply without asking (required in CI)

lefine strings check

Server checks (ICU, placeholders, markup) plus a scan of your code

Terminal
npx lefine strings check [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--file <path>Source locale file
--locale <code>Source locale

lefine strings unused

Keys in Lefine your code never uses (a scan of the code, compared on the server)

Terminal
npx lefine strings unused [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--namespace <name>Only this namespace
--ciExit 1 when a key is unused
--deleteDelete them (a person approves it in Lefine; the CLI opens the page and waits)
--approval <id>Run a delete a person already approved
-y, --yesSkip the question here; the person still approves in Lefine

lefine strings missing

Names in your code with no key in Lefine (users would see the raw name)

Terminal
npx lefine strings missing [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--namespace <name>Only this namespace

lefine strings publish

Publish to the CDN after a person approves it in Lefine, and wait until every locale is verified

Terminal
npx lefine strings publish [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
-y, --yesSkip the question here; a person still approves the publish in Lefine (the CLI opens the page and waits)

lefine strings status

Live revision, pending changes and the last CDN check

Terminal
npx lefine strings status [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output

lefine strings types

Write a .d.ts with every key of the app, so the editor knows keys added in Lefine

Terminal
npx lefine strings types [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
-o, --output <path>File to write (default: lefine-strings.d.ts)
--binding <name>Register the types with next-intl, use-intl, lefine/strings or none (default: from package.json)

lefine strings snapshot

Write the published texts to a file for createLefine({ snapshot }): the first request after a deploy is served from it

Terminal
npx lefine strings snapshot [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
-o, --output <path>File to write (default: lefine-snapshot.json)
--cdn-url <url>CDN origin (default: LEFINE_CDN_URL or https://cdn.lefine.ai)

lefine strings keys list

Keys with their source text (or --locale), page by page

Terminal
npx lefine strings keys list [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--namespace <name>Only this namespace
--search <text>Part of the key or of any of its texts
--locale <code>Which text to show (default: the source locale)
--limit <n>Keys per page, 1-200 (default 50)
--allEvery page

lefine strings keys create

Add a key (live with the next publish)

Terminal
npx lefine strings keys create [options] <namespace.key>
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--text <source>Its source text
--description <text>A note for translators

lefine strings keys delete

Delete keys by namespace.key or id (a person approves it in Lefine)

Terminal
npx lefine strings keys delete [options] <keys...>
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--approval <id>Run a delete a person already approved
-y, --yesSkip the question here; the person still approves in Lefine

lefine strings runs

Recent syncs, imports and publishes, or one with its steps

Terminal
npx lefine strings runs [options] [id]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--kind <kind>Only this kind of run
--limit <n>How many, 1-50 (default 10)

lefine strings languages add

Add a language (a person approves it in Lefine)

Terminal
npx lefine strings languages add [options] <locale>
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--approval <id>Run an add a person already approved

lefine doctor

One report and a 0-100 score: hard-coded text in the code, texts that break, missing and unused keys

Terminal
npx lefine doctor [options]
OptionWhat it does
-p, --project <app-id>The app's id, app_... (default: from lefine.ts or i18n.config.ts). workspace/app also works, as an alias
-d, --dir <path>Directory with the config and code
--api-url <url>API origin
--jsonMachine-readable output
--threshold <score>Fail under this score (default 70)
--verboseShow every finding

lefine apps

Your workspace's apps, with their ids

Terminal
npx lefine apps [options]
OptionWhat it does
--api-url <url>API origin
--jsonMachine-readable output

lefine content types

Write a TypeScript file with one type per content type of a Content project

Terminal
npx lefine content types [options]
OptionWhat it does
-p, --project <id|slug>Content project (default: the only one in the workspace)
-o, --output <path>File to write (default: lefine-content.ts)
-d, --dir <path>Directory to write in
--api-url <url>API origin
--jsonMachine-readable output

lefine migrate

Move next-intl / @better-i18n code to lefine: rewrites what maps one to one, lists the rest (dry run unless --write)

Terminal
npx lefine migrate [options] [dir]
OptionWhat it does
--writeChange the files
--lefine-import <path>Where your lefine.ts is imported from (default: @/lefine)

lefine mcp

Lefine as a local MCP server (stdio) for Claude Desktop and IDEs; remote clients can use https://dash.lefine.ai/v1/mcp

Terminal
npx lefine mcp [options]
Next step · MCP and API referenceAPI reference