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

pi-zk

v0.1.1

Published

Pi extension exposing the zk note-taking CLI as agent-native tools.

Readme

pi-zk

A Pi extension that exposes the zk note-taking CLI as agent-native tools. Talk to your Zettelkasten from Pi.

What you get

Twelve LLM-callable tools wrapped around zk, plus wikilink autocomplete in the Pi editor and an automatic system-prompt nudge that routes note operations through the right tools.

[user]> What did I write last week tagged #work but not yet linked to my OKR note?

zk_search_notes  "tag:work modified-after:1 week ago"
zk_linked_by     "okrs/2026-Q2.md"
…

Install

pi install git:github.com/raphapr/pi-zk

Requirements:

  • zk 0.15 or newer on PATH
  • An initialised zk notebook (zk init in your notes directory)

Tools

| Tool | Purpose | | ------------------ | ----------------------------------------------------------------------------- | | zk_search_notes | Filter notes by FTS query, tags (AND/OR/NOT), paths, and date ranges | | zk_read_note | Read a note's full content by notebook-relative path | | zk_create_note | zk new wrapper; auto-creates nested directories and can prepopulate content | | zk_edit_note | Exact-match text replacement with uniqueness enforcement | | zk_append_note | Append a markdown block with blank-line normalisation | | zk_list_tags | List every tag with note counts | | zk_link_to | Backlinks for a note (supports recursive traversal + max-distance) | | zk_linked_by | Notes a given note points to (supports recursive traversal) | | zk_related | Notes that share neighbours but are not yet linked | | zk_last_modified | Most recently edited note, optionally tag-filtered | | zk_tagless_notes | Notes with no tags (useful for triage) | | zk_random_note | One random note, optionally tag-filtered |

All tools accept an optional notebook parameter that overrides env-based resolution for a single call.

Wikilink autocomplete

Typing [[ in the Pi editor surfaces a fuzzy-ranked menu of notes from the active notebook:

see [[zett▎       zettelkasten   — Zettelkasten  #theory
                  2026-05-09     — Weekly review #work #deep
                  …
  • Match runs across filename stem, title, and tags
  • Suggestions are capped at 20
  • The cache indexes the 500 most recently modified notes by default
  • Set ZK_AUTOCOMPLETE_LIMIT to raise or lower the indexed-note cap (maximum 5000)
  • Notes are cached per notebook with a 60-second TTL
  • Cache is invalidated automatically after zk_create_note, zk_edit_note, and zk_append_note

System prompt guidance

When a notebook is detected at session start, pi-zk appends a short routing block to the system prompt so the LLM knows to prefer zk_* tools over generic read / edit / bash on note files. When no notebook is in scope the block is omitted.

Configuration

Notebook resolution checks in order:

  1. ZK_NOTEBOOK_DIR environment variable
  2. ZK_DIR environment variable
  3. The current working directory if it contains .zk/
  4. The nearest ancestor of the cwd that contains .zk/

Other env vars:

  • ZK_BIN — explicit path to the zk binary (defaults to ~/.local/bin/zk, then zk on PATH)
  • ZK_AUTOCOMPLETE_LIMIT — number of recent notes indexed for wikilink autocomplete (default 500, maximum 5000)
  • ZK_EDITOR, EDITOR, VISUAL — forced to true during zk_create_note so non-interactive notes are created without launching your editor

Development

npm install
npm run typecheck
npm test

The test suite includes integration tests that exercise the real zk binary. They auto-skip when zk is not installed; install zk locally to run the full suite.

Load the extension without publishing:

pi -e /path/to/pi-zk/src/index.ts

License

MIT — see LICENSE.