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

@narumitw/otter-cli

v0.5.1

Published

Non-interactive CLI for managing Otter travel and shared expenses

Readme

@narumitw/otter-cli

Non-interactive CLI for managing trips, participants, expenses, balances, and settlement records in Otter.

Install

After the package is published:

npm install --global @narumitw/otter-cli
otter --help

For local development from the repository root:

npm run build:cli
npm link --workspace @narumitw/otter-cli
otter --help

The package requires Node.js 20 or newer.

Authorization

The CLI connects to https://otter.narumi.dev/ by default. Override the server with OTTER_URL.

otter auth login
otter auth status

Device login stores the token in ~/.config/otter/credentials.json. For ephemeral automation, create a named 90-day token under Account settings → API tokens in the Otter web app, copy it when shown, and provide it through a secret manager instead:

OTTER_TOKEN='otter_api_…' otter trips list

The plaintext token is shown only once. Revoke active personal and device tokens from the same account settings page.

Commands

otter trips list
otter trips get --trip <trip-id>
otter participants list --trip <trip-id>
otter expenses list --trip <trip-id>
otter balances get --trip <trip-id>
otter settlements list --trip <trip-id>
otter trips get --trip <trip-id> > trip.json
otter settlements preview --input trip.json

Run otter --help for all commands and options. Successful data commands print JSON to stdout; errors print JSON to stderr and exit non-zero. settlements preview validates a saved trip payload and calculates balances locally without credentials or network access; use --input - to read JSON from stdin.

Dated exchange rates

The API uses Visa as its only automatic rate source. Pass the actual expense date with --date YYYY-MM-DD; late entries retain that date. Automatic conversions use 0% bank fees. The selected settlement currency can differ from the group base currency.

Saved base rates, selected-currency rates, payment rates, and conversion bridges are preserved in trip payloads. settlements preview uses those saved values without network access. Missing required rates produce an input error, not a fixed estimate. Update the CLI with the API to read new Visa snapshot formats. Existing bank snapshots remain valid historical data.

See the repository rate rules and cutover procedure. Visa estimates are not actual card-posted amounts.

Expense concurrency (breaking change)

expenses list and trips get include each expense's version. Updates and deletions require the version you reviewed:

otter expenses update --trip trip-id --expense expense-id --version 3 --amount 1500
otter expenses upload-receipt --trip trip-id --expense expense-id --version 4 --file ./receipt.png
otter expenses delete --trip trip-id --expense expense-id --version 5 --yes

Use the actual returned version, not a guessed increment. The CLI sends If-Match without fetching a newer version or retrying. A stale write fails with HTTP 412 and JSON code EXPENSE_VERSION_CONFLICT; reread and review the changed expense before submitting again. Missing or invalid --version fails locally. Deletion still requires --yes.

Receipt upload accepts a local JPEG, PNG, or WebP image up to 5 MiB, detects MIME from its bytes, and replaces any existing receipt on that expense. Obtain approval before replacing one. The response includes the updated trip with the new receiptId and version; uploading does not change balances.

Older clients without the header receive HTTP 428 from the new API. Coordinate the CLI/API upgrade and reload existing browser tabs. Legacy versionless JSON remains supported for offline settlements preview, never for a conditional write. View change history in the Web app; history and restore commands are not provided by the CLI.

Development

npm run otter -- --help
npm run typecheck --workspace @narumitw/otter-cli
npm run build:cli
npm pack --dry-run --workspace @narumitw/otter-cli