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

@bareium/cli

v0.1.3

Published

Command-line interface for Bareium — short links, deep links and click analytics from the terminal.

Readme

@bareium/cli

The command line for Bareium — shorten links, read click analytics and manage folders, tags and domains without leaving the terminal.

It is a client of the public REST API, not a second door into the database, so plan quotas, workspace scoping, audit logging and rate limits apply exactly as they do to any other caller.

Requirements

  • Node 18 or newer
  • A Bareium API key — Settings → API in the dashboard

There is no separate plan gate. The CLI calls the same REST API your key already reaches; whatever your plan allows there, it allows here.

Install

npm install -g @bareium/cli
bareium login

Or without installing anything:

npx -y @bareium/cli shorten https://example.com

Quick start

bareium login                                   # paste a key, once per machine
bareium shorten https://example.com/launch --slug launch
bareium links
bareium stats launch --range 7d

shorten prints the short URL on stdout and nothing else, so it composes:

LINK=$(bareium shorten "$DEPLOY_URL" --slug "pr-$PR_NUMBER")

Commands

| Command | Does | Writes | |---|---|---| | bareium shorten <url> | Creates a short link. Spends one from the monthly link allowance. | yes | | bareium links | Lists this workspace's links. | no | | bareium stats <link> | Clicks, referrers, countries and devices for one link. | no | | bareium delete <link> | Deletes a link permanently. Confirms first. | yes | | bareium search <term> | Finds links, campaigns and domains. | no | | bareium folders / tags | Lists folders and tags. | no | | bareium domains | Lists custom domains, verification and TLS status. | no | | bareium whoami | Workspace, plan, limits and usage so far. | no | | bareium login / logout | Stores or removes the API key. | no |

<link> is a slug, a short URL or a link id — launch, bareium.in/launch, https://bareium.in/launch and the UUID all work. Only an exact slug match counts; a slug that exists on two domains is reported as ambiguous rather than guessed at.

Run bareium help <command> for a command's own options.

Creating links

bareium shorten https://example.com \
  --slug spring-sale \
  --domain acme.link \
  --expires 30d \
  --folder Marketing --tag campaign --create-missing

--expires takes an ISO date, a full timestamp, or a duration (45m, 12h, 30d, 2w). --folder and --tag take names; --create-missing makes any that do not exist yet, and without it an unknown name is an error listing what the workspace does have.

TRAI-compliant SMS links: --trai, with --trai-header to set the header segment. Deep links: --ios-scheme, --android-scheme, --ios-store-id, --android-package, --deep-link-fallback. Deep linking is a paid feature and the API refuses it below Pro — see the exit codes below.

Configuration

| | | |---|---| | BAREIUM_API_KEY | Overrides the stored key. Set this in CI instead of running login. | | BAREIUM_API_URL | The API host. Defaults to production; set it only to point at a staging host. | | BAREIUM_CONFIG_DIR | Where the config lives. Defaults to ~/.config/bareium. | | NO_COLOR | Turns colour off, as does --no-color and any non-terminal stdout. |

bareium login stores the key in ~/.config/bareium/config.json, mode 0600. The environment always wins over the file, so one command can run against another workspace without disturbing what is stored.

--api-url is worth setting explicitly when you hold a staging key, so a test run cannot write to live data.

Scripting

--json prints machine-readable output on stdout and nothing else — no header, no colour. Everything conversational goes to stderr.

Exit codes are part of the interface:

| Code | Means | |---|---| | 0 | Done. | | 1 | Failed. | | 2 | The command was wrong — bad flag, missing argument. | | 3 | No key, or the key was rejected. | | 4 | The plan does not include this. Retrying will not help. | | 5 | Rate limited or out of allowance. Wait and retry. | | 6 | Bareium could not be reached — network, DNS, or the wrong host. |

The 4-versus-5 split is the one the API itself draws, and it is the reason a CI step can tell "upgrade the plan" from "try again in a minute" without reading English out of stderr.

Safety

  • delete confirms before it acts, and refuses outright when nothing can answer the prompt. Pass --yes to mean it. The blast radius of a wrong deletion is somebody's already-printed QR code.
  • The API key sits in plain text in the config file. Anyone holding it can create and read links in that workspace. logout removes the local copy; if it may have leaked, revoke the key itself in Settings → API.
  • The CLI never prints a key in full, not even in whoami.

Licence

MIT — see LICENSE. This licence covers cli/ only. The rest of Bareium is private and carries no licence.

Bugs

There is no public issue tracker — the repository is private. Report problems through support at bareium.com.