{"id":18403,"library":"gtx-cli","title":"gtx-cli","description":"CLI tool for AI-powered i18n (wrapper for gt). Current stable version: 2.14.19. Active development. Key differentiators: leverages General Translation's AI for automated localization workflows. Alternative to manual i18n tooling, integrates with gt ecosystem.","status":"active","version":"2.14.19","language":"javascript","source_language":"en","source_url":"https://github.com/generaltranslation/gt","tags":["javascript","i18n","l10n","translation","internationalization","localization","cli","typescript"],"install":[{"cmd":"npm install gtx-cli","lang":"bash","label":"npm"},{"cmd":"yarn add gtx-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add gtx-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core translation engine dependency","package":"gt","optional":false}],"imports":[{"note":"ESM-only package; CJS require not supported.","wrong":"const gtx = require('gtx-cli')","symbol":"gtx","correct":"import { gtx } from 'gtx-cli'"},{"note":"Default export is deprecated; use named export.","wrong":"","symbol":"cli","correct":"import { cli } from 'gtx-cli'"},{"note":"Named export, not default. Available from v2.0.0.","wrong":"import runGtx from 'gtx-cli'","symbol":"runGtx","correct":"import { runGtx } from 'gtx-cli'"}],"quickstart":{"code":"import { gtx } from 'gtx-cli';\n\nconst result = await gtx({\n  source: './src/locales',\n  target: './dist/locales',\n  apiKey: process.env.GT_API_KEY ?? '',\n});\n\nconsole.log('Translation completed:', result);","lang":"typescript","description":"Example of using gtx-cli to run translation on locale files with API key."},"warnings":[{"fix":"Update import to named export: import { gtx } from 'gtx-cli'","message":"In v2.x, the API changed from default export to named export. Use `import { gtx } from 'gtx-cli'` instead of `import gtx from 'gtx-cli'`.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace `cli` with `runGtx`","message":"The `cli` function is deprecated in favor of `runGtx`.","severity":"deprecated","affected_versions":">=2.14.0"},{"fix":"Use `import` syntax and ensure your project supports ESM.","message":"The package is ESM-only and does not support CommonJS `require()`.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Switch to `import { gtx } from 'gtx-cli'` and set `\"type\": \"module\"` in your package.json, or use dynamic import().","cause":"Using CommonJS `require()` on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/gtx-cli/index.mjs not supported."},{"fix":"Use `import { gtx } from 'gtx-cli'` instead of `import gtx from 'gtx-cli'`.","cause":"Default import of package that only exports named exports.","error":"TypeError: gtx is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}