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

@lefine/cli

v0.1.0

Published

Lefine from the terminal: sign in, then pull, push, check and publish your app strings

Readme

@lefine/cli

Lefine from the terminal. Sign in, then pull, push, check and publish your app strings.

Install

Needs Node 20 or newer.

npm install --global @lefine/cli     # or: pnpm add -g @lefine/cli
yarn global add @lefine/cli          # or: bun add -g @lefine/cli
npx @lefine/cli --help               # no install

This gives you the lefine command.

Sign in

lefine login

The CLI prints a short code and a link, and tries to open your browser. Open the link, check the code, and pick the workspace and the access you want to give. It works over SSH and in containers, because nothing listens on your machine.

  • lefine login --no-browser prints the link and does not try to open it.
  • lefine login --token lfn_... saves an access key you created in Settings, API keys.
  • lefine login --api-url <url> signs in to another server.
  • lefine whoami shows who you are, the workspace, and what the key may do.
  • lefine logout removes the saved key from this machine.

The key is saved in ~/.lefine/credentials.json. The folder is private to you (mode 0700) and so is the file (mode 0600). A saved key is only ever sent to the server it was saved for. If --api-url or LEFINE_API_URL points somewhere else, the CLI stops and tells you to log in again for that server.

Strings

Every strings command finds the app from i18n.config.ts in the current folder, or from -p <workspace>/<app>. Add -d <path> to use another folder. All except pull take --json for machine-readable output.

The workspace in your project must be the workspace of your key. If they differ, the CLI stops before it changes anything.

lefine strings status -p acme/web

Shows the live version, how many changes are waiting to be published, and the last CDN check.

lefine strings pull -p acme/web -o ./locales

Downloads the published translations to JSON files. Each file is checked against the sha256 in the manifest, and an empty file is never written. A second pull only downloads the locales that changed since the last one (--force downloads all). -l en,de picks locales, --since 12 lists what changed since revision 12, --cdn-url reads from another CDN.

lefine strings push -p acme/web

Reads your source file (<output>/<default locale>.json, shaped { "namespace": { "key": "text" } }), shows what would change, and asks before it applies. --file <path> and --locale <code> pick another file or locale. Add --yes to apply without asking.

lefine strings check -p acme/web

Runs the server checks (placeholders, ICU plurals, markup) and scans your code for keys that are missing from the source file. Problems are grouped by key.

lefine strings publish -p acme/web

Shows what will go live, asks, publishes, and then waits until every locale is read back from the CDN. Add --yes to publish without asking.

CI

Do not run lefine login in CI. Create an access key in Settings, API keys, store it as a secret, and pass it as LEFINE_TOKEN. Anything that changes data needs --yes there, because nobody can answer a question.

- run: npx @lefine/cli strings push --yes
  env:
    LEFINE_TOKEN: ${{ secrets.LEFINE_TOKEN }}
- run: npx @lefine/cli strings publish --yes
  env:
    LEFINE_TOKEN: ${{ secrets.LEFINE_TOKEN }}

LEFINE_TOKEN wins over a saved key. Give the key only the access the job needs: read to check and pull, write to push, publish to publish.

Exit codes

| Code | Meaning | | --- | --- | | 0 | It worked. For publish: every locale is verified on the CDN. Nothing to push or publish is also 0. | | 1 | It did not work: not signed in, wrong workspace, missing access, a failed request, a check that found problems, a publish that is not verified on the CDN, or push/publish without --yes where nobody can answer. |

Settings

| Setting | Default | | --- | --- | | --api-url, LEFINE_API_URL | https://dash.lefine.ai | | --cdn-url, LEFINE_CDN_URL (pull) | https://cdn.lefine.ai | | LEFINE_TOKEN | the key saved by lefine login | | LEFINE_HOME | ~/.lefine |

The CLI does not read these from .env files in your project, so a cloned repository cannot point your key at another server.

License

MIT