
Languine
CLIAI 本地化工具:先把服务端一键部署到自己的 Vercel 账号(自动配好 Postgres 与 AI Gateway,部署后需开启部署保护),再在项目里运行 npx languine@selfhosted translate,用大模型把应用的语言文件翻译成多个语种,也提供自动提 PR 的 GitHub Action。需要 Vercel 账号与 Node.js。
Languine
Self-hosted, Vercel-native AI localization. Click Deploy. Run npx languine. That's it.
One-click deploy
What the button does:
- Forks this repo to your GitHub account.
- Creates a Vercel project with
apps/webas the root. - Provisions serverless Postgres via the Vercel Marketplace —
DATABASE_URLis auto-injected. - Prompts you for
LANGUINE_API_KEY(any random string) and an optionalAI_MODELslug. - Builds and deploys. The build automatically runs
drizzle-kit migrateagainst your fresh database.
After the first deploy, do these two things:
- Enable Deployment Protection. In your Vercel project: Settings → Deployment Protection → turn on Vercel Authentication (or Password Protection). This gates the dashboard and
/cli/token. Without this, your API key is publicly visible. - Open the dashboard (
https://<your-deployment>.vercel.app). It shows a status checklist and ready-to-paste CLI commands.
That's it. No additional integrations to configure — Vercel AI Gateway authenticates automatically via the project's OIDC token.
Use the CLI
The self-hosted CLI ships under the
selfhostednpm dist-tag so it doesn't disturb users still pointed at the legacy hosted backend. Install it withnpx languine@selfhosted ...(or pin"languine": "^4"in yourpackage.json).npx languine@latestcontinues to resolve to the legacy 3.x CLI for the old hosted service.
In any project that needs translations:
npx languine@selfhosted login --url https://languine.your-team.vercel.app
npx languine@selfhosted init
npx languine@selfhosted translate
languine login opens /cli/token in your browser. Because Deployment Protection is on, only authorized owners can see the page — copy the API key, paste it into the CLI prompt.
languine init creates a project on your deployment via tRPC (project.create) and writes the returned projectId into languine.json. You don't need to provision anything from the dashboard.
For non-interactive use (CI, scripts):
export LANGUINE_BASE_URL=https://languine.your-team.vercel.app
export LANGUINE_API_KEY=<the-key-you-set-on-vercel>
npx languine@selfhosted translate
GitHub Action
name: Languine
on:
push:
branches: [main]
jobs:
translate:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: languine-ai/languine@v4
with:
api-key: ${{ secrets.LANGUINE_API_KEY }}
base-url: ${{ vars.LANGUINE_BASE_URL }}
project-id: prj_xxxxxxx
create-pull-request: 'true'
Environment variables
| Variable | Required | Source | Description |
|---|---|---|---|
LANGUINE_API_KEY | Yes | Set at deploy | Single API key shared between the dashboard, CLI and Action. Generate with openssl rand -hex 32. |
DATABASE_URL | Yes | Auto-injected | Postgres connection string from the Vercel Marketplace integration you picked at deploy. |
AI_MODEL | No | Set at deploy | Vercel AI Gateway model slug. Defaults to openai/gpt-4.1. Examples: anthropic/claude-sonnet-4, openai/gpt-4.1-mini. |
AI_GATEWAY_API_KEY | No | Local dev only | Only needed when running locally outside Vercel. In production the Gateway uses the project's OIDC token. |
Architecture
- Hosting: Vercel (Next.js 16, App Router, Node.js runtime).
- Database: Serverless Postgres from the Vercel Marketplace + Drizzle ORM.
- Background jobs: Vercel Workflows (
workflowSDK) — durable, resumable, observable. - AI: Vercel AI Gateway (
@ai-sdk/gateway+ AI SDK v6) — single configurable model. - Auth: Single
LANGUINE_API_KEYfor the CLI/Action; the dashboard is gated by Vercel Deployment Protection.
flowchart LR
Dev[Developer] -->|languine| CLI
GHA[GitHub Action] -->|x-api-key| Web
CLI -->|x-api-key| Web[apps/web on Vercel]
Web --> Workflows[Vercel Workflows]
Workflows --> Gateway[Vercel AI Gateway]
Gateway --> Models[OpenAI / Anthropic / ...]
Web --> DB[(Postgres)]
Workflows --> DB
Owner[Owner browser] -->|Deployment Protection| Web
Local development
git clone https://github.com/languine-ai/languine
cd languine
bun install
cp apps/web/.env.example apps/web/.env # fill in DATABASE_URL etc.
bun dev
Set AI_GATEWAY_API_KEY in apps/web/.env so the Gateway can authenticate when not running on Vercel.
Tests
bun test # everything
bun test --filter @languine/web # just the web app
bun test --filter languine # just the CLI
License
MIT © Midday Labs AB
相关资源

Lingo.dev CLI
CLILingo.dev 官方命令行:lingo push 把仓库里的 JSON、YAML、Markdown、PO、XLIFF、Android/Xcode 字符串等文件发给平台上的大模型本地化引擎翻译,lingo pull 取回译文,可接入 CI。需 Lingo.dev 账号,按量计费,有免费沙箱。
lingodotdev/lingo.dev5.4k
attranslate
CLI面向编码 agent 的离线翻译同步工具:只把 JSON、YAML、PO、CSV 等多语言文件里新增的文案交给 agent 翻译,不覆盖人工改过的译文,省 token。适合译员与开发协作维护软件译文;需要 Node.js,本身不调用翻译 API。
fkirc/attranslate353
Crowdin CLI
CLICrowdin 官方命令行:把待翻译的源文件上传到 Crowdin,再把译文下载回原位置,还能查看翻译进度、管理术语表与翻译记忆、触发机器或 AI 预翻译,支持 JSON 输出便于 agent 解析。需要 Crowdin 账号(可免费试用,开源项目可申请免费授权)与个人访问令牌,crowdin init 会引导生成配置文件。
crowdin/crowdin-cli325
Lokalise CLI v2
CLILokalise 官方命令行(lokalise2),覆盖 Lokalise API v2:上传和下载语言文件,管理词条、译文、截图、翻译任务与贡献者,方便把翻译进度同步到项目里。需要 Lokalise 账号(付费服务,可免费试用 14 天),在个人资料页生成 API Token 后用 --token 传入。
lokalise/lokalise-cli-2-go125
SimpleLocalize CLI
CLISimpleLocalize 官方命令行:上传、下载多语言翻译文件,一键发起机器翻译与 AI 自动翻译,把译文发布到 CDN 托管,还能从源码中抽取待翻译的文案键,适合放进 CI 自动跑本地化流程。需要 SimpleLocalize 账号与项目 API Key,平台为付费服务,可免费试用 14 天。
simplelocalize/simplelocalize-cli81
locize-cli
CLILocize 官方命令行:在本地多语言文件与 Locize 翻译平台之间同步,增删查翻译条目、下载已发布译文、管理版本与分支,可导出 JSON、XLIFF、PO、CSV、Excel 等格式交给译员处理。需要 Locize 账号、项目 ID 与 API Key,有免费套餐。
locize/locize-cli71