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

translation-management-cli

v0.1.1

Published

CLI for pulling translations from Translation Management into a repository.

Readme

translation-management-cli

Sync translations between Translation Management and your repository.

  • tm pull — download all translations of your project as one <lang>.json file per language
  • tm push — upload local <lang>.json files into your project

The CLI talks to the production Translation Management API out of the box — no URL configuration needed. The only thing you must provide is an API token via the TM_TOKEN environment variable.

Quick start

1. Install

pnpm add -D translation-management-cli

2. Get an API token

In the Translation Management web app, open your project → API TokensNový token. Copy the plaintext token shown — it is displayed only once.

The token is bound to one project, so the CLI always knows which project to sync — no project ID needed.

3. Provide the token as TM_TOKEN

The CLI reads the token from the TM_TOKEN environment variable. It does not load .env files by itself, so pick one of these:

  • One-off / local:

    TM_TOKEN=tm_pat_xxx pnpm pull-locales
  • Shell profile (local dev): add export TM_TOKEN=tm_pat_xxx to ~/.zshrc.

  • .env file: store TM_TOKEN=tm_pat_xxx in .env.local and run through a loader, e.g. dotenv -e .env.local -- tm pull (dotenv-cli), or node --env-file=.env.local node_modules/.bin/tm pull (Node 22+).

  • CI: set TM_TOKEN as a secret in your pipeline.

Never commit the token.

4. Add a script and run it

Set --out to the folder your frontend reads translations from. The path is relative to where you run the script (typically the repo root):

{
  "scripts": {
    "pull-locales": "tm pull --out src/locales"
  }
}

Examples per framework:

  • Next.js (App Router with next-intl): --out src/locales
  • Vite / CRA: --out src/locales
  • React Native: --out src/i18n/locales
  • Monorepo from root: --out apps/web/src/locales

Then:

TM_TOKEN=tm_pat_xxx pnpm pull-locales
✓ locales/cs.json
✓ locales/en.json

Pulled 2 language(s) into locales/

Each file contains nested JSON (compatible with next-intl, react-i18next, formatjs, etc.):

{
  "home": {
    "hero": {
      "title": "Vítejte"
    }
  },
  "common": {
    "save": "Uložit"
  }
}

Commands

tm pull

Downloads all translations for the project bound to TM_TOKEN and writes one <lang>.json file per language defined in the project.

| Flag | Default | Description | |---|---|---| | --out <dir> | ./locales | Output directory (created if missing) |

tm push

Reads every <lang>.json file in a directory and uploads its keys into the project. The language is taken from the filename (cs.jsoncs); files for languages not defined in the project are skipped and reported.

| Flag | Default | Description | |---|---|---| | --dir <dir> | ./locales | Directory containing <lang>.json files |

TM_TOKEN=tm_pat_xxx tm push --dir src/locales
✓ cs: 42 key(s)
✓ en: 42 key(s)

Imported 84 key(s) across 2 language(s).

Environment variables

| Variable | Required | Description | |---|---|---| | TM_TOKEN | yes | API token created in the web app (project-scoped) |

Exit codes

| Code | Meaning | |---|---| | 0 | Success | | 1 | Configuration error (missing TM_TOKEN, unreadable directory, invalid JSON) | | 2 | Token invalid or revoked (HTTP 401) | | 3 | Other HTTP error | | 4 | Unexpected error (non-JSON response, etc.) |

Troubleshooting

  • TM_TOKEN env var is required — the variable isn't visible to the process; see step 3 above (.env files are not loaded automatically).
  • Unauthorized: token is invalid or has been deleted — the token was revoked in the web app or copied incorrectly; create a new one.
  • HTTP 429 — the API rate-limits import/export; wait a moment and retry.
  • Skipped (not in project) after push — add the missing language to the project in the web app first, then push again.