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

locinai

v1.0.0

Published

LocIn CLI — scan your codebase for translatable strings, set up i18next, and sync translations with the LocIn localization platform.

Downloads

140

Readme

locin

The LocIn CLI scans your codebase for translatable strings, sets up i18next, and syncs translations with the LocIn platform.

locin detects untranslated strings, scaffolds i18next, extracts keys into locale resource files, and uploads, translates, exports, and validates translations against the LocIn backend at https://api.locin.dev.

Requirements

  • Node.js >= 20

Installation

Install globally from npm:

npm install -g locinai

This installs two equivalent commands on your PATH — use whichever you prefer:

locin     # short form
locinai   # same command

Run with no arguments to open the interactive command picker:

locin

Authentication

Interactive (local development)

locin auth login runs an OAuth-style device flow: it opens a browser to a verification URL and polls until you approve access. Tokens are cached at ~/.locin/auth.json and refreshed automatically.

locin auth login
locin auth status
locin auth logout

Headless / CI

Provide an API key (starting with lk_) via environment variable, or pass a token directly:

export LOCIN_API_KEY=lk_xxx
# or
locin <command> --token <jwt-or-lk_key>

Commands

| Command | Description | | --- | --- | | help | Show help. | | flow | Run the i18n pipeline (detect/setup/extract, optional upload/translate/export/validate). | | init | Create or update .locin-cli.json in the repo root. | | scan | List files in the repo. | | analyze | Detect i18next and scan for untranslated strings. | | extract | Generate a locale resource file from discovered i18n keys. | | auth | Authenticate the CLI (login/logout/status). | | project | Manage projects (list/create/delete/switch/info). | | upload | Upload files to the API. | | translate | Start a translation batch for a project. | | export | Export files from the API and sync locale files. | | validate | Validate translations: coverage, placeholders, HTML, length. | | completion | Generate shell completion. |

flow

Runs the i18n pipeline. Individual step failures do not stop the pipeline.

  • --full, --all — run the entire pipeline: scan → setup → extract → upload → translate → export → validate.

init

Creates or updates .locin-cli.json in the repo root.

  • --reset — reset configuration to defaults.

analyze

Detects i18next and scans for untranslated strings.

  • --fix — autofix safe findings.
  • --deep, --deep-scan — run a server-classified Pass 2 (requires Pro plan + projectId + auth).
  • --accept-cloud-classifier — grant and persist cloud-classifier consent.

extract

Generates a locale resource file from discovered i18n keys.

  • --out <path> — output path.
  • --map — force key-map usage.

project

Manage projects (list/create/delete/switch/info).

  • --name <name> — name for create.
  • --project <ref> — project reference for switch/info/delete.

upload

Uploads files to the API.

  • --source <lang> — source language (default en).

translate

Starts a translation batch for a project.

  • --languages <codes> — target language codes.
  • --files <names> — files to translate.
  • --wait, -w — poll until the job completes.
  • --timeout <seconds> — poll timeout (0 = unlimited).

export

Exports files from the API and syncs locale files.

  • --languages <codes> — language codes.
  • --locale <code> — single-language alias.
  • --files <names> — files to export.

validate

Validates translations for coverage, placeholders, HTML, and length.

  • --min-coverage <n> — minimum coverage percent (default 100).
  • --languages <codes> — language codes.

completion

Generate shell completion:

locin completion --shell <bash|zsh|fish> [--name <name>]

Global flags

| Flag | Description | | --- | --- | | --version, -V | Print the CLI version. | | --interactive, -i | Force interactive mode. | | --json | Emit structured JSON to stdout; human-readable text to stderr. | | --ci | Implies --json, disables prompts, fails on missing args. | | --token <token> | Auth token (JWT or lk_ key). | | --api-base-url <url> | Override the API base URL. | | --scope <path> | Limit file operations to a subfolder. | | --debug | Write eligibility/auth/entitlement debug logs to stderr (also LOCIN_DEBUG=1). |

Project selection

The active project is resolved in this order:

  1. --project-id <id> flag
  2. .locin-cli.json config
  3. LOCIN_PROJECT_ID environment variable
  4. Interactive prompt

Environment variables

| Variable | Description | | --- | --- | | LOCIN_API_BASE_URL | Override the API base URL (default https://api.locin.dev). | | LOCIN_API_KEY | API key (lk_...) for headless/CI auth. | | LOCIN_PROJECT_ID | Default project ID. | | LOCIN_LANGUAGES | Default target languages. | | LOCIN_SOURCE_LANGUAGE | Default source language. | | LOCIN_DEBUG=1 | Enable debug logs. | | LOCIN_HTTP_TIMEOUT_MS | HTTP timeout in milliseconds (default 20000). |

Example workflow

# 1. Authenticate
locin auth login

# 2. Scaffold config and detect i18next
locin init
locin analyze --fix

# 3. Extract keys into a locale resource file
locin extract --out ./locales/en.json

# 4. Upload, translate, and sync back
locin upload --source en
locin translate --languages fr,de --wait
locin export --languages fr,de

# 5. Validate coverage
locin validate --languages fr,de --min-coverage 95

CI/CD examples

# Run a translation batch and wait for completion
LOCIN_API_KEY=lk_xxx locin translate --project-id 42 --languages en,fr --ci --wait

# Run the full pipeline end to end
LOCIN_API_KEY=lk_xxx locin flow --full --project-id 42 --languages en,fr --yes --ci

# Validate translation coverage as a build gate
locin validate --languages tr,de,fr --min-coverage 95 --ci

Exit codes

| Code | Meaning | | --- | --- | | 0 | Success. | | 1 | General error. | | 2 | Authentication failure. | | 3 | Validation error or missing required argument. |

Notes

  • Commands run against the nearest parent folder containing a package.json.
  • In non-TTY environments, interactive prompts are skipped.

License

Proprietary — UNLICENSED. All rights reserved.