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

open-trees

v1.0.1

Published

OpenCode plugin for safe git worktree workflows.

Downloads

205

Readme

Open Trees

OpenCode plugin for fast, safe git worktree workflows.

Install

Single command (recommended):

bunx open-trees add

This updates your OpenCode config (default: ~/.config/opencode/opencode.json). OpenCode installs npm plugins automatically at startup (cached in ~/.cache/opencode/node_modules).

Manual config:

{
  "plugin": ["open-trees"]
}

For local development, build the plugin and point OpenCode at the local package:

bun install
bun run build
{
  "plugin": ["/absolute/path/to/open-trees"]
}

Worktree mode

Worktree tools are gated behind worktree mode so they do not clutter the default tool list. Enable it when you want to work with worktrees, then disable it when you are done.

worktree_mode { "action": "on" }
worktree_mode { "action": "off" }

worktree_mode also prints a help sheet (tools + examples) so the model has the usage context.

Slash-native toggle (see .opencode/command/worktree.md):

/worktree on
/worktree off

/worktree on enables the tools and emits the help sheet into the session. /worktree off disables them and keeps them off for the next session.

Tools

  • worktree_mode — enable/disable worktree mode and show help.
  • worktree_overview — list, status, or dashboard worktrees.
  • worktree_make — create/open/fork worktrees and sessions.
  • worktree_cleanup — remove or prune worktrees safely.

Examples

Enable worktree mode:

worktree_mode { "action": "on" }

List worktrees:

worktree_overview

Status for all worktrees:

worktree_overview { "view": "status" }

Show the worktree/session dashboard:

worktree_overview { "view": "dashboard" }

Create a worktree (branch derived from name):

worktree_make { "action": "create", "name": "feature audit" }

Start a new session (creates or reuses a worktree):

worktree_make { "action": "start", "name": "feature audit", "openSessions": true }

Open a session in an existing worktree:

worktree_make { "action": "open", "pathOrBranch": "feature/audit", "openSessions": true }

Fork the current session into a worktree:

worktree_make { "action": "fork", "name": "feature audit", "openSessions": true }

Create a swarm of worktrees/sessions:

worktree_make { "action": "swarm", "tasks": ["refactor-auth", "docs-refresh"], "openSessions": true }

Remove a worktree:

worktree_cleanup { "action": "remove", "pathOrBranch": "feature/audit" }

Prune stale worktree entries:

worktree_cleanup { "action": "prune", "dryRun": true }

Defaults and safety

  • Default worktree path (when path is omitted):
    • <repo>/.worktrees/<branch>
  • Relative path inputs are resolved under .worktrees/ to prevent traversal.
  • Branch name is derived from name when branch is omitted (lowercased, spaces to -).
  • worktree_cleanup refuses to delete dirty worktrees unless force: true.
  • All tools return readable output with explicit paths and git commands.

Session workflow

worktree_make actions (start, open, fork) create or reuse a worktree, then create a session in that directory. Each action records a mapping entry at:

  • ~/.config/opencode/open-trees/state.json (or ${XDG_CONFIG_HOME}/opencode/open-trees/state.json)

The session title defaults to wt:<branch>, and the output includes the session ID plus next steps.

Swarm safety notes:

  • worktree_make with action: "swarm" refuses to reuse existing branches or paths unless force: true.
  • It never deletes existing worktrees; it only creates new ones.

Optional command file examples:

# .opencode/command/worktree.md
worktree_mode { "action": "$1" }
# .opencode/command/worktree-start.md
worktree_make { "action": "start", "name": "$1", "openSessions": true }
# .opencode/command/worktree-open.md
worktree_make { "action": "open", "pathOrBranch": "$1", "openSessions": true }

Slash commands (drop these files into .opencode/command):

/worktree on
/worktree off
/worktree-overview
/worktree-make <name>
/worktree-clean <pathOrBranch>

Development

E2E tests exercise the CLI against a temporary OpenCode config file.

bun run lint
bun run typecheck
bun run build
bun run test
bun run test:e2e
bun pm scan
npm audit --omit=dev

Versioning

Open Trees follows Semantic Versioning and tracks notable changes in CHANGELOG.md.

Brand

Brand visuals, SVG assets, and usage guidelines live in docs/brand.md.

Contributing

See CONTRIBUTING.md for setup, testing, and release guidelines.