npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@autoglot/cli

v0.1.8

Published

Translate i18n files using autoglot

Readme

@autoglot/cli

Translate i18n files from the command line. Supports JSON, YAML, PO/POT, and Xcode String Catalogs.

Quick start

npx @autoglot/cli en.json --lang es,fr,de

Pass multiple files or a shell glob to translate them together in one job:

npx @autoglot/cli ios/Layers/**/*.xcstrings --lang es,fr,de

Setup

  1. Sign up at autoglot.app
  2. Go to dashboard / API keys and create a key
  3. Export it:
export AUTOGLOT_API_KEY=your_key_here

CLI usage

autoglot <files...> --lang <codes> [options]

Arguments

| Argument | Description | |----------|-------------| | files | Source files to translate in one job (e.g. en.json, en.po, messages.yaml) |

Options

| Option | Alias | Default | Description | |--------|-------|---------|-------------| | --lang | -l | (required) | Comma-separated target languages | | --source | -s | Auto-detect from filename, fallback en | Source language code | | --output | -o | Input root | Output directory for translated files; relative input paths are preserved | | --input-root | | Current directory when possible | Root used for stable source paths in translation context, analytics, and activity | | --project | -p | | Project for glossary/style guide (owner/repo format) | | --branch | | | Source branch recorded with activity; requires --deployment-type and --project | | --deployment-type | | | preview or release; requires --branch | | --api-key | -k | AUTOGLOT_API_KEY env var | API key | | --api-url | | https://api.autoglot.app | API base URL | | --timeout | | | Maximum wait in seconds, then return the latest compatible cached artifact. Requires --project | | --no-cache | | false | Skip translation cache | | --help | -h | | Show help | | --version | -v | | Show version |

Examples

Translate a JSON file into Spanish, French, and German:

npx @autoglot/cli src/locales/en.json --lang es,fr,de

Translate a PO file with explicit source language and output directory:

npx @autoglot/cli messages.po --lang ja,ko --source en --output ./translations

Use a project's glossary and style guide:

npx @autoglot/cli en.json --lang es,fr --project acme/my-app

Keep a build moving with cached translations if fresh translation takes more than two minutes:

npx @autoglot/cli en.json --lang es,fr --project acme/my-app --timeout 120

Skip cache to force re-translation:

npx @autoglot/cli en.yaml --lang pt-BR --no-cache

Translate multiple Xcode String Catalogs in one job with one timeout:

npx @autoglot/cli ios/Layers/**/*.xcstrings --lang de,fr --project acme/ios --input-root . --branch main --deployment-type release --timeout 120

Library usage

@autoglot/cli also exports a translate() function for use in Node.js scripts and other tools (like @autoglot/next).

import { translate } from '@autoglot/cli';
import { readFileSync } from 'fs';

const files = await translate({
  files: [{
    filename: 'frontend/apps/web/locales/en.json',
    content: readFileSync('en.json', 'utf-8'),
  }],
  targetLanguages: ['es', 'fr', 'de'],
  sourceLanguage: 'en',
  apiKey: process.env.AUTOGLOT_API_KEY!,
  project: 'myorg/my-app',
  branch: 'main',
  deploymentType: 'release',
  timeoutSeconds: 120,
  onProgress: (status) => {
    console.log(`${status.completed_strings}/${status.total_strings}`);
  },
});

for (const file of files) {
  console.log(file.filename, file.content.length);
}

translate(options)

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | files | { filename: string; content: string }[] | Yes | | Files to translate. Use stable project-relative filenames for analytics and activity. | | targetLanguages | string[] | Yes | | Target language codes | | sourceLanguage | string | Yes | | Source language code | | apiKey | string | Yes | | API key | | apiUrl | string | No | https://api.autoglot.app | API base URL | | project | string | No | | Project for glossary/style guide (owner/repo) | | branch | string | No | | Source branch recorded with activity; requires deploymentType and project | | deploymentType | 'preview' \| 'release' | No | | Build type recorded with activity; requires branch | | timeoutSeconds | number | No | | Maximum wait before returning the latest compatible cached artifact. Requires project | | skipCache | boolean | No | false | Skip translation cache | | onProgress | (status: JobStatus) => void | No | | Progress callback |

Returns Promise<{ filename: string; content: string }[]> — the translated files.

JobStatus

The object passed to onProgress:

| Field | Type | Description | |-------|------|-------------| | job_id | string | Job identifier | | status | string | processing, completed, or failed | | progress | number | Percentage (0–100) | | total_strings | number | Total strings to translate | | completed_strings | number | Strings translated so far | | error_message | string? | Error details if failed |

Supported file formats

| Format | Extension | |--------|-----------| | JSON | .json | | YAML | .yml, .yaml | | PO/POT | .po, .pot | | Xcode String Catalog | .xcstrings |

Supported languages

| Code | Language | Code | Language | |------|----------|------|----------| | de | German | ja | Japanese | | fr | French | ko | Korean | | es | Spanish | zh-Hans | Simplified Chinese | | it | Italian | zh-Hant | Traditional Chinese | | pt | Portuguese | ar | Arabic | | pt-BR | Brazilian Portuguese | he | Hebrew | | nl | Dutch | hi | Hindi | | pl | Polish | th | Thai | | ru | Russian | vi | Vietnamese | | uk | Ukrainian | id | Indonesian | | tr | Turkish | ms | Malay | | sv | Swedish | cs | Czech | | da | Danish | hu | Hungarian | | fi | Finnish | ro | Romanian | | nb | Norwegian | sk | Slovak | | el | Greek | bg | Bulgarian |

Links