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

@hasna/knowledge

v0.2.0

Published

Agent-friendly local knowledge CLI with JSON output, pagination, and safe destructive actions

Downloads

44

Readme

open-knowledge

Agent-friendly local knowledge CLI with JSON output, pagination, and safe destructive actions.

npm version license build

A flat key-value knowledge store designed for AI agents. Stores notes with titles, content, source URLs, and tags. Works with Bun and Node.js.

Install

# Bun
bun add -g @hasna/knowledge

# npm
npm install -g @hasna/knowledge

Or run directly:

bun x @hasna/knowledge add "My Note" "Some content"

Quick Start

# Add a note
open-knowledge add "Rust ownership" "Every value has exactly one owner"

# List all notes
open-knowledge list

# List with search
open-knowledge list --search ownership

# List notes tagged "rust"
open-knowledge list --tag rust

# Get a note
open-knowledge get --id <id>

# Update a note
open-knowledge update --id <id> --title "Rust ownership model"

# Delete a note (requires --yes)
open-knowledge delete --id <id> --yes

# Export all notes as JSONL
open-knowledge export --format jsonl

Commands

add

open-knowledge add <title> <content> [--url <url>] [-t <tag>]

Add a new knowledge item.

list

open-knowledge list|ls [options]

List items with pagination, search, and tag filtering.

| Flag | Description | |------|-------------| | -p, --page <n> | Page number (default: 1) | | -l, --limit <n> | Items per page (default: 20) | | -s, --search <text> | Filter by title or content | | -t, --tag <tag> | Filter by tag | | --sort created\|title | Sort field (default: created) | | --desc | Sort descending |

get

open-knowledge get --id <id>

Retrieve a single item by ID.

update

open-knowledge update|edit --id <id> [options]

Update an existing item.

| Flag | Description | |------|-------------| | --title <title> | New title | | --content <content> | New content | | --url <url> | New source URL | | -t, --tag <tag> | Add a tag |

delete

open-knowledge delete|rm --id <id> --yes

Delete an item. Requires --yes to confirm.

export

open-knowledge export [--format jsonl]

Export all items. Use --format jsonl for newline-delimited JSON.

help

open-knowledge help [command]

Global Options

| Flag | Description | |------|-------------| | --json | Output raw JSON | | --store <path> | Override store path | | --version, -v | Show version | | --help, -h | Show help |

Store Location

Default store: ~/.open-knowledge/db.json

Override with --store <path> or set OPEN_KNOWLEDGE_STORE env var.

JSON Output

Every command returns structured JSON when --json is passed:

{
  "ok": true,
  "item": { "id": "...", "title": "...", "content": "...", "url": null, "tags": [], "created_at": "...", "updated_at": "..." }
}

Agent-Friendly Design

  • JSON-only mode: --json flag for easy parsing by LLMs
  • Idempotent IDs: each item gets a stable unique ID
  • Safe deletes: --yes flag required; no accidental deletions
  • Concurrent-safe: file locking prevents corruption from parallel agents
  • Scriptable: works in pipelines, CI, and any automation tool