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

@bopstack/gstate

v0.1.0

Published

Branch-aware, repository-local state for Git workflows.

Downloads

101

Readme

gstate

Branch-aware, repository-local state for Git workflows.

gstate stores small named values in Git configuration instead of tracked files. Use repository values as shared defaults, then override them for the branch you are working on.

repository: editor=vim, theme=dark
branch:     editor=code
resolved:   editor=code, theme=dark

Features

  • Branch-aware reads — branch values override repository defaults.
  • Shared worktree state — stores data in the Git common directory, so linked worktrees see the same repository and branch state.
  • No tracked files — state stays in Git configuration.
  • Shell-friendly — missing reads and idempotent branch deletes are silent successful no-ops.
  • Bun-native CLI — install locally with bun link.

Prerequisites

Install

Install the published CLI:

bun add --global @bopstack/gstate

Or install and link a repository checkout for development:

bun install
bun link

gstate is now available on your PATH. To run it without installation:

bunx @bopstack/gstate <command>

Quick start

Run these commands inside a Git worktree:

# Set a repository-wide default.
gstate set editor vim --repo

# Override it only on the current branch.
gstate set editor code

# Read the effective value: "code".
gstate get editor

# Show effective state and where each value came from.
gstate list
# editor code (branch)

# Remove the branch override; the repository default is visible again.
gstate unset editor
gstate get editor
# vim

Commands

gstate <command> [args] [--repo]

| Command | Default scope | Description | |---|---|---| | get <key> | Resolved | Prints branch value first, then falls back to repository value. Missing keys print nothing and exit 0. | | set <key> <value> | Branch | Stores a value. Use --repo for a repository default. | | unset <key> | Branch | Removes one value. Missing branch values are silent no-ops. | | list | Resolved | Lists effective values with (branch) or (repo) origin. list --repo lists repository values only. | | list-all | Both | Lists raw repository and current-branch values, including shadowed keys. | | rm | Branch | Removes every value in the selected scope. Use rm --repo for repository values. | | rename <new-branch> | Branch | Moves current branch state to another branch name; does not rename the Git branch. |

--repo is the only scope flag. Branch scope is the default for mutations.

Scopes and storage

All state lives in the repository's shared Git configuration (git rev-parse --git-common-dir):

| Scope | Git configuration namespace | Availability | |---|---|---| | Repository | state.repo.<key> | Every branch and linked worktree | | Branch | state.<branch>.<key> | That branch across linked worktrees |

An unscoped read resolves branch state before repository state. Repository-scoped commands work in detached HEAD. Branch-scoped commands require a checked-out branch unless GIT_STATE_BRANCH supplies one.

# Inspect or update branch state while detached.
GIT_STATE_BRANCH=feature/refactor gstate get editor
GIT_STATE_BRANCH=feature/refactor gstate set editor code

[!WARNING] A branch named repo intentionally shares the state.repo.* namespace with repository scope. Avoid that branch name if the scopes must remain distinct.

Keys and values

Keys follow Git configuration variable-name components. Use letters, digits, and hyphens; separate components with dots:

gstate set editor.theme dark
gstate set build-target arm64 --repo

Values are strings. Quote values containing spaces or shell-special characters:

gstate set review-note "needs API approval"

Development

# Run the integration suite against temporary Git repositories.
bun test

# Type-check.
bunx tsc --noEmit

Tests exercise the CLI through real Git repositories, including scope precedence, detached repository operations, and branch-name regex isolation.