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

layerbase

v0.4.2

Published

Layerbase cloud CLI: connect to your managed databases without leaking the connection string into shell history.

Readme

layerbase

npm version license

The Layerbase cloud CLI: connect to your managed cloud databases with their native clients, drop into local spindb, and never paste a connection string into your shell history.

layerbase is the bridge between spindb (the open-source local database manager) and your Layerbase cloud account. Think flyctl / heroku / neonctl, but it also wraps spindb for local work.

Install

npm i -g layerbase
# or
pnpm add -g layerbase
# or
bun add -g layerbase

This installs two commands, layerbase and a shorter lbase. For a two-letter lb, run layerbase alias (it only claims lb if nothing else owns it).

Quick start

layerbase              # open the interactive menu
layerbase login        # sign in through your browser
layerbase ls           # list your cloud databases
layerbase psql my-db   # connect with the right client, no password typed

Commands

| Command | Description | | --- | --- | | layerbase | Interactive menu: a hub to sign in, list, connect, and run spindb. | | layerbase login | Sign in via the browser; stores a token in ~/.layerbase-cli. | | layerbase logout | Remove the stored credentials. | | layerbase whoami | Show the signed-in account and token expiry (--json). | | layerbase ls | List your cloud databases (--json for scripting). | | layerbase connect <db> | Connect with the engine's native client. | | layerbase psql <db> | Connect to a Postgres-family database. | | layerbase redis-cli <db> | Connect to a Redis / Valkey database. | | layerbase mysql <db> | Connect to a MySQL / MariaDB database. | | layerbase connection-string <db> | Print the connection string (reveals the password). | | layerbase spindb [args...] | Run the local spindb CLI (passes args through). | | layerbase alias | Set up the short lb command (only if it is free). |

<db> accepts a cloud database id or its name. Add --print to connect to show the connection details instead of launching a client.

Interactive menu

Run layerbase with no command for an arrow-key menu. It is a small hub: each action runs, then the menu returns, so you can sign in, list databases, drop into spindb, and keep going.

 ◆ Layerbase  cloud + local databases

 Signed in as [email protected]

 ❯ List cloud databases
   Connect to a database
   Run spindb               local databases
   Log out
   Quit

 Up/Down to move · Enter to select · q to quit

The menu is sugar over the commands above, so everything stays scriptable.

The spindb bridge

spindb manages local database containers; layerbase adds the cloud account layer around it.

layerbase spindb                  # open spindb's own menu
layerbase spindb create postgres  # run any spindb command locally

spindb is found on your PATH, or run through npx / pnpx / bunx if it is not installed. Local spindb commands need no login.

Connecting without a connection string

Passing psql "postgresql://user:SECRET@host/db" leaks the password into your shell history, into ps while the client runs, and into terminal scrollback. layerbase resolves the database over TLS and hands the credential to the client through an environment variable or a transient 0600 file that is deleted on exit. The password is never an argv value.

| Engine | How the password is passed | | --- | --- | | Postgres family | PGPASSFILE (temp 0600 file), deleted on exit | | MySQL / MariaDB | --defaults-extra-file (temp 0600 file), deleted on exit | | Redis / Valkey | REDISCLI_AUTH environment variable | | Other engines | layerbase connection-string / --print |

Connecting requires the engine's native client (psql, mysql, redis-cli) on your PATH.

Authentication

layerbase login opens your browser, you sign in with GitHub or Google, and a 30-day token is returned to a loopback server the CLI runs on 127.0.0.1. A state nonce ties the response to your login, and the token is only ever delivered to a loopback address. It is stored at ~/.layerbase-cli/credentials.json (mode 0600). This mirrors how the Layerbase desktop app signs in. Run layerbase logout to remove it.

The lb shortcut

The CLI installs as layerbase and lbase. For a two-letter lb, run layerbase alias (or pick it from the menu). It creates lb next to the layerbase binary, but only when lb is not already taken on your system (for example, Debian's live-build ships an lb). If it is taken, the CLI leaves it alone and suggests a shell alias instead.

Configuration

| Variable | Purpose | | --- | --- | | LAYERBASE_API_URL | Override the Layerbase API base (default https://layerbase.com). |

Requirements

  • Node.js 20 or newer.
  • For connect / psql / redis-cli / mysql: the matching native client on your PATH.

License

ISC, Layerbase, LLC.