locli

io.github.mariohahn由 GitHub 帳號 mariohahn 發布v0.1.11更新於 Nov 6, 2026

Find, add, push and pull an app's user-facing texts in locli (iOS, Android, web, backend).

已驗證STDIO僅桌面效率與工作流開發者工具

概覽

AI 產生的概覽

locli 管理應用程式的使用者可見文案:助理可以尋找、新增、推送與拉取 iOS、Android、Web 及後端的翻譯文案。

可以做什麼
  • 檢視專案概況:狀態、功能區域、翻譯指南,以及每個鍵在程式碼中的使用位置
  • 搜尋既有鍵、譯者註解與值,在新建前重複使用相同意義的文案
  • 建立缺少的鍵與值,或把來源檔案中的新文案推送到 locli
  • 把最新已核准的發佈拉取到應用程式檔案,或拉取草稿狀態供本機檢查
  • 刪除從未發佈過的鍵,同時清理 locli 與文案檔案
  • 檢視社群翻譯建議,並接受、拒絕或隱藏某一則建議
適用情境
適合已在用 locli 的應用程式中由編碼助理新增或翻譯介面文案的情境,讓新鍵遵循專案的功能區域、術語表與長度限制,並把已核准的翻譯寫回來源檔案。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 18 以上版本。需要 locli 帳號與專案:用 CLI 登入,或在 CI 中設定 LOCLI_TOKEN 環境變數。讀取 locli.json(從工作目錄尋找或由 LOCLI_CONFIG 指定),LOCLI_API_URL 可覆寫預設伺服器。需要連線至 locli 的網路存取。
安裝前請注意
此伺服器會寫入應用程式的文案檔案:push 上傳新文案,pull 取代檔案中已發佈的鍵,delete 會從 locli 與檔案中刪除鍵。它不能核准發佈,也不會覆寫既有文案。接受社群建議會使其成為工作文案,接受前應核對佔位符、術語表與語氣。LOCLI_TOKEN 是機密;本機登入時權杖存放在憑證檔案中。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 locli,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@locli/cli

Put your app's user-facing texts into locli: push new texts, let a project owner approve a release, pull the approved translations. Built for coding agents, works for any stack: iOS String Catalogs, Android strings.xml, and JSON for web and backend. Node 18+, no dependencies.

sh
npx @locli/cli init

init detects your text files and writes:

  • locli.json with the project slug, source language and one target per catalog
  • a locli block in AGENTS.md (and @AGENTS.md in an existing CLAUDE.md)
  • no copy of the agent skill: the Claude Code plugin and https://locli.dev/docs/agents.md carry it; --skill copies it to .agents/skills/locli/ (linked from .claude/skills/locli/)

When you are logged in, init also creates the project with its languages and platforms. It is safe to rerun.

Login

sh
npx @locli/cli login

login opens the browser. You sign in, or create a free account, and approve the CLI. The token is stored per server in ~/.config/locli/credentials.json, readable only by you. In CI, set LOCLI_TOKEN instead. whoami shows the account; logout revokes the token.

Workflow

  1. Add new keys to the source-language file, e.g. receipt_import_title with a comment.
  2. npx @locli/cli push uploads only what locli lacks. It never overwrites existing texts. New keys from a Git feature branch are grouped as a feature.
  3. A project owner approves a release in the locli web app.
  4. npx @locli/cli pull writes the latest approved release into your files.

locli.json

json
{  "project": "example-app",  "sourceLanguage": "en",  "targets": [    { "platform": "ios", "format": "xcstrings", "path": "App/Localizable.xcstrings" },    { "platform": "android", "format": "android-xml", "path": "app/src/main/res" },    { "platform": "web", "format": "json", "path": "messages/{locale}.json" }  ]}

Every target has platform (ios, android, web or backend), format and path. Paths are relative to locli.json.

  • Android targets take an optional file; the default is strings.xml.
  • JSON targets need {locale} in the path and take an optional keyPrefix.
  • apiURL is optional; the default is https://locli.dev.

The JSON schema is shipped as @locli/cli/schema/locli.json.

Commands

CommandEffect
login [--no-browser] / logout / whoami [--json]Approve the CLI in the browser; revoke the token; show the account
init [--name] [--slug] [--source LANG] [--target platform:format:path]… [--icon FILE | --no-icon] [--yes] [--no-agent-files]Detect catalogs, write the config and agent files, create the project and give it the app's icon
push [--dry-run] [--branch B] [--target platform]Upload missing keys and values; never overwrites
pull [--draft] [--release NAME] [--target platform]Write the latest approved (or named) release
status [--json]Show languages, missing translations, open features, unreleased changes and glossary issues
areas [--feature NAME] [--json]List feature areas, or find the area a new feature's texts belong to
context [--key KEY_OR_AREA] [--json]Where each key is used in the code, as what (toolbar item, button, push notification …), and translations too long for it
guide [--json] [--set FILE]Show the translation guide (tone, glossary) and the texts that break it; --set replaces it
keys normalize [--dry-run] [--no-code]Rename dotted iOS/Android keys to lower_snake_case (adminDashboard.location → admin_dashboard_location) in locli, the String Catalog and the Swift code
keys delete KEY… [--dry-run] [--json]Delete keys that were never released, in locli and in every catalog from locli.json; released keys are refused and stay for the web editor
community [--status S] [--locale CODE] [--accept ID | --reject ID | --hide ID]Suggestions from the project's public community catalog, the most voted first; accept, reject or hide one
mcpStart the MCP server on stdio

Every command takes --api-url, --config and --help. Exit codes: 0 ok, 1 error, 2 usage error.

Environment variables:

  • LOCLI_TOKEN: the API token in CI.
  • LOCLI_API_URL: the server.
  • LOCLI_CONFIG: the path to locli.json.
  • LOCLI_BRANCH: overrides the detected branch.

MCP server

The MCP server provides eleven tools:

  • locli_status
  • locli_areas
  • locli_guide
  • locli_context
  • locli_find_texts
  • locli_add_texts
  • locli_push
  • locli_pull
  • locli_delete_keys (only keys that were never released)
  • locli_community_suggestions
  • locli_community_review

Claude Code: install the plugin (skill and MCP server in one), or add only the MCP server:

sh
/plugin marketplace add mariohahn/locli/plugin install locli@locliclaude mcp add --scope project locli -- npx -y @locli/cli mcp

Cursor (.cursor/mcp.json) and other clients that use mcpServers:

json
{ "mcpServers": { "locli": { "command": "npx", "args": ["-y", "@locli/cli", "mcp"] } } }

Codex (~/.codex/config.toml):

toml
[mcp_servers.locli]command = "npx"args = ["-y", "@locli/cli", "mcp"]

Known limits

  • Android strings with markup (<b>, <a> …) are skipped on push and left alone on pull.
  • JSON: only a top-level ICU plural on count or argN becomes a plural key. Other ICU messages are pushed as plain text.
  • JSON: non-string values are skipped with a warning.

Agent guide: https://locli.dev/docs/agents.md · License: MIT

來源:cli/README.md,提交 abd72dd

工具

11

locli_status

locli status

Project overview from locli.json: languages, missing texts per language, open Git features and whether unreleased changes wait for release approval. Read-only.

無需輸入參數。

locli_areas

Feature areas

The project's feature areas (a key's first segment, e.g. login in login_username_label) with key counts and examples. With feature="login" it returns the existing area to use (by name or synonym such as auth/signin) or proposes a new one, which the first push of keys with that prefix creates. Call it when you start building a feature. Read-only.

輸入參數feature

locli_guide

Translation guide

The project's translation guide: tone and form of address per language, glossary terms with their required translation, terms that stay as written (keep), and every current translation that breaks the glossary. Read it before translating. Read-only.

無需輸入參數。

locli_context

Where texts are used

Scans the app's code for every key in locli.json's files: where it is used (file:line), as what (toolbar item, tab, button, menu item, screen title, form field, push notification, email, alert, error message, accessibility label, text) and its length budget in characters. Lists translations in the files that exceed their budget and keys not found in the code. Call it before translating and fix every too-long text (shorter wording, or a layout that wraps). Local, read-only.

輸入參數keytarget

locli_find_texts

Find existing texts

Search existing keys, translator comments and values (case-insensitive, all words must match). Call this before creating a key so a text with the same meaning is reused. Read-only.

輸入參數query必填locale

locli_add_texts

Add texts

Create missing keys and values in locli. Never overwrites: values that already exist are reported as skipped (change them in locli instead). Use lower_snake_case keys whose first segment is the feature area and always give a comment saying where the text appears and what each placeholder holds. Placeholders are printf style (%@, %lld, %1$@) for iOS/Android, ICU names ({used}, {n, number}) for keys used only on web/backend; give plural texts as forms with "other". New keys join the current Git branch's feature. Prefer adding the text to the app's source file and calling locli_push when the app has one.

輸入參數texts必填branchdryRun

locli_push

Push new texts

Upload texts from the app files in locli.json that locli lacks (new keys, missing languages). Never overwrites existing texts. Reports how many texts wait for a release.

輸入參數dryRuntarget

locli_pull

Pull approved texts

Write the latest approved release into the app files from locli.json. Replaces the released keys' texts in those files; local-only keys stay. draft=true writes the unapproved working state for local checks only.

輸入參數drafttarget

locli_delete_keys

Delete unreleased keys

Delete keys that no release ever contained: in locli (texts, translations, history) and in the app files from locli.json, so the next push does not add them back. Keys locli does not know are removed from the files only. If any key was already released, nothing is deleted: apps may still show it, so a project owner deletes it in the web editor. Warns about code that still uses a deleted key. Use for duplicates, typos and texts of a feature that was dropped; run with dryRun first and show the user the list.

輸入參數keys必填dryRun

locli_community_suggestions

Community suggestions

Suggestions from the project's public community catalog (anyone can suggest translations of released texts, vote and discuss, without an account), the most voted first. Each has an id, key, language, source text, today's text in locli, the suggestion, score, votes and the public discussion. Read-only.

輸入參數localestatus

locli_community_review

Review a community suggestion

Decide one community suggestion: accept makes it the working text (it ships with the next approved release; you never approve releases), reject declines it, hide removes spam or abuse from the public page. Before accepting, check that placeholders, the glossary (locli_guide) and the tone fit; when several suggestions compete, prefer the clearly better wording, not only the score.

輸入參數id必填notedecision必填

版本歷史

7
  1. v0.1.11最新Nov 5, 2026
  2. v0.1.10Nov 4, 2026
  3. v0.1.9Nov 3, 2026
  4. v0.1.7Nov 3, 2026
  5. v0.1.6Oct 31, 2026
  6. v0.1.5Oct 30, 2026
  7. v0.1.3Oct 29, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分