Socket
Book a DemoInstallSign in
Socket

prismy-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prismy-cli

CLI tool to generate translations for new i18n keys in your git branch

1.2.0
latest
npmnpm
Version published
Weekly downloads
289
43.78%
Maintainers
1
Weekly downloads
 
Created
Source

Prismy CLI

A powerful CLI tool that automatically generates translations for new i18n keys in your git branch. Perfect for maintaining multilingual applications without manual translation overhead.

Features

  • 🔍 Smart Detection: Automatically detects new translation keys in your current branch or local changes
  • 🌐 Multi-language Support: Generates translations for all configured languages
  • 🔧 Git Integration: Seamlessly works with your git workflow
  • Fast Processing: Only processes files that have actually changed
  • 🔐 Secure: API key management with local storage

Installation

npm install -g prismy-cli

Quick Start

  • Set up your API key:
prismy auth your-api-key-here
  • Generate translations for your changes:
prismy generate

That's it! The CLI will automatically detect new translation keys in your changed files and generate translations for all configured languages.

Usage

Authentication

# Set API key
prismy auth <your-api-key>

# Show current API key
prismy auth --show

# Reset stored API key
prismy auth --reset

Generate Translations

# Generate translations for changes in current branch
prismy generate

# Use a custom base branch for comparison
prismy generate --base-branch feature/my-feature

# Specify repository name manually (useful when git remote detection fails)
prismy generate --repo-name my-project

# Combine options
prismy generate --base-branch main --repo-name my-project

# Short forms
prismy generate -b main -r my-project

Default Behavior

When you run prismy without any commands, it defaults to prismy generate:

# These are equivalent
prismy
prismy generate

How It Works

  • Repository Analysis: Connects to your repository and fetches translation configuration
  • Change Detection: Compares your current branch with the base branch to find modified files
  • File Processing: Identifies translation files that contain new keys
  • Translation Generation: Sends new keys to the Prismy API for translation
  • File Updates: Automatically updates your translation files with the new translations

Configuration

The CLI automatically fetches configuration from your repository, including:

  • Main branch name
  • Translation files to sync
  • Supported languages
  • File structure

Examples

Basic Workflow

# 1. Make changes to your code that include new translation keys
git checkout -b feature/new-translations

# 2. Generate translations for your changes
prismy generate

# 3. Review and commit the generated translations
git add .
git commit -m "Add translations for new features"

Working with Feature Branches

# Compare against a different base branch
prismy generate --base-branch develop

# This is useful when working on feature branches
# that should be compared against develop instead of main

Debug Mode

Enable debug logging to see detailed information:

DEBUG=1 prismy generate

Error Handling

The CLI provides clear error messages for common issues:

  • No API key: Prompts you to set up authentication
  • No repository config: Ensures your repository is properly configured
  • API errors: Clear messages about API connectivity issues
  • File errors: Warnings about missing or inaccessible files

Repository Detection Issues

If the CLI cannot automatically detect your repository name from the git remote, you have two options:

  • Interactive prompt: The CLI will ask you to enter the repository name manually
  • Command line option: Use --repo-name to specify it directly
# When auto-detection fails, specify manually
prismy generate --repo-name my-project-name

This is particularly useful in environments where:

  • Git remotes are not configured
  • Repository URLs don't follow standard patterns
  • You're working with local-only repositories

Development

Building from Source

# Clone the repository
git clone <repository-url>
cd prismy-cli

# Install dependencies
npm install

# Build the project
npm run build

# Run locally
npm start

Available Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run dev - Watch mode for development
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

Contributing

  • Fork the repository
  • Create a feature branch
  • Make your changes
  • Add tests if applicable
  • Submit a pull request

License

ISC

Support

If you encounter any issues or have questions, please open an issue in the repository.

Keywords

i18n

FAQs

Package last updated on 16 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.