{"id":17882,"library":"prismy-cli","title":"Prismy CLI for i18n Translation Management","description":"The Prismy CLI is a command-line interface tool designed to streamline the management of internationalization (i18n) translations, particularly for new keys within a Git branch. It integrates with Prismy, an AI-powered translation platform, to facilitate localized software development. The current stable version is 1.4.1, with recent updates like v1.3.6 suggesting an active development and release cadence. Key differentiators include its tight integration with Git workflows for automatically detecting new i18n keys and generating translations, as well as features for syncing translation files directly with the Prismy platform. It also provides an agent skill to contextualize AI coding tools with project-specific terminology, tone of voice, and translation workflows, significantly enhancing the developer experience for localized applications. The CLI requires Node.js version 18 or higher for execution.","status":"active","version":"1.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/prismy-io/prismy-cli","tags":["javascript","i18n","translations","cli","git","internationalization","typescript"],"install":[{"cmd":"npm install prismy-cli","lang":"bash","label":"npm"},{"cmd":"yarn add prismy-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add prismy-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime environment requirement for execution.","package":"node","optional":false}],"imports":[],"quickstart":{"code":"import { execSync } from 'child_process';\nimport * as path from 'path';\n\n// Ensure prismy-cli is installed (e.g., as a dev dependency or globally)\n// npm install --save-dev prismy-cli\n// or npm install -g prismy-cli\n\nconst prismyBin = path.resolve(process.cwd(), 'node_modules/.bin/prismy');\n// It's highly recommended to use environment variables for API keys in production\nconst prismyApiKey = process.env.PRISMY_API_KEY ?? 'YOUR_SECRET_PRISMY_API_KEY_HERE'; \n\ntry {\n  if (!prismyApiKey || prismyApiKey === 'YOUR_SECRET_PRISMY_API_KEY_HERE') {\n    console.warn('Warning: PRISMY_API_KEY is not set. Authentication might fail.');\n  }\n\n  console.log('Authenticating with Prismy...');\n  execSync(`${prismyBin} auth --key \"${prismyApiKey}\"`, { stdio: 'inherit' });\n  console.log('Authentication successful.');\n\n  console.log('Generating translations (dry run)...');\n  // This command detects new i18n keys in your Git changes\n  // and sends them to Prismy for AI translation. \n  // Use --dry-run to preview changes without modifying files.\n  execSync(`${prismyBin} generate --dry-run`, { stdio: 'inherit' });\n  console.log('Dry run complete. Review potential changes in your translation files.');\n\n  // To apply the translations, remove --dry-run:\n  // execSync(`${prismyBin} generate`, { stdio: 'inherit' });\n\n} catch (error) {\n  console.error('Error running Prismy CLI commands:', error.message);\n  process.exit(1);\n}","lang":"typescript","description":"This TypeScript script demonstrates how to programmatically invoke Prismy CLI commands, including authentication and initiating a dry run for translation generation, useful for CI/CD or automated workflows."},"warnings":[{"fix":"Upgrade your Node.js environment to version 18 or newer using tools like `nvm` or by installing a recent Node.js distribution.","message":"Prismy CLI explicitly requires Node.js version 18 or higher for proper functionality.","severity":"gotcha","affected_versions":"<18.0.0"},{"fix":"Always manage API keys securely using environment variables (e.g., `process.env.PRISMY_API_KEY`), a `.env` file, or a dedicated secrets management system, especially in production environments.","message":"Hardcoding Prismy API keys directly into scripts or source code poses a significant security risk.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure you are on a feature branch with new i18n key additions staged or committed before running `prismy generate`. Use the `--dry-run` flag initially to preview changes without modifying files.","message":"The `prismy generate` command relies on detecting new i18n keys in uncommitted or recently committed Git changes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Install the CLI globally using `npm install -g prismy-cli` or ensure it's available in your `node_modules/.bin` directory if installed locally, and use `npx prismy-cli` or include it in your `package.json` scripts.","cause":"The Prismy CLI executable is not found in the system's PATH, or it has not been installed.","error":"prismy: command not found"},{"fix":"Verify your API key from your Prismy dashboard and re-authenticate using `prismy auth --key YOUR_VALID_KEY`. Ensure no typos or extra spaces are present.","cause":"The API key provided to the `prismy auth` command is incorrect, expired, or lacks the necessary permissions.","error":"Error: Authentication Failed: Invalid API Key"},{"fix":"Upgrade your Node.js installation to version 18 or newer. Tools like `nvm` (Node Version Manager) can help you manage multiple Node.js versions easily.","cause":"Attempting to run the Prismy CLI with an incompatible or outdated Node.js runtime.","error":"Error: Node.js version XX is not supported. Please upgrade to Node.js 18 or higher."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}