{"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.","language":"javascript","status":"active","last_verified":"Thu Apr 23","install":{"commands":["npm install prismy-cli"],"cli":{"name":"prismy","version":null}},"imports":[],"auth":{"required":false,"env_vars":[]},"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}