JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 211
  • Score
    100M100P100Q105995F
  • License MIT

Knowledge base CLI for querying and curating agent knowledge.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nzpr/kb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @nzpr/kb

    @nzpr/kb is a CLI for using and curating a knowledge base.

    A knowledge entry is just:

    • title
    • text

    Most Common Use

    export KB_DATABASE_URL=postgresql://USER:PASSWORD@HOST:5432/DB
    
    kb search "deployment rule"
    kb ask "How do we approve a knowledge proposal?"
    kb list
    kb catalog --json
    kb doctor

    API

    kb search "..."
    kb ask "..."
    kb list
    kb catalog --json
    kb doctor
    kb publish --docs-root ./docs
    kb create --title "..." --text "..."
    kb edit --title "..." --text "..."
    kb init-repo

    Install

    npm install -g @nzpr/kb

    Node.js 20+ is required.

    Publish

    export KB_DATABASE_URL=postgresql://USER:PASSWORD@HOST:5432/DB
    
    kb publish --docs-root ./docs

    Optional embeddings:

    export KB_EMBEDDING_MODE=bge-m3-openai
    export KB_EMBEDDING_API_URL=https://embeddings.example.com/v1/embeddings
    export KB_EMBEDDING_MODEL=BAAI/bge-m3
    export KB_EMBEDDING_API_KEY=...

    Workflow

    1. kb init-repo
    2. kb create
    3. review the issue
    4. add kb-approved
    5. the generated PR auto-merges
    6. CI runs kb publish

    Create

    export KB_GITHUB_REPO=owner/repo
    export GITHUB_TOKEN=...
    
    kb create \
      --title "Example Rule" \
      --text "Write the exact knowledge text here."

    kb create works against the remote GitHub knowledge repo. It looks for similar existing knowledge first, then lets you choose whether to create a new entry, edit one of the close matches instead, or cancel.

    Edit

    export KB_GITHUB_REPO=owner/repo
    export GITHUB_TOKEN=...
    
    kb edit \
      --title "Updated CI/CD rule" \
      --text "Write the revised knowledge text here."

    kb edit works against the remote GitHub knowledge repo. It looks for the best matching existing knowledge entry, lets you confirm the target, reopens that proposal issue, removes kb-approved, and updates the issue body with the new title and text. You can pass --path when you already know the exact document to edit.

    After reopening an edit issue, you must manually add kb-approved again. That fresh label is the approval step that generates the PR and republishes the database.

    Notes

    • Most usage should be kb search and kb ask.
    • kb publish does not need GitHub credentials.
    • kb init-repo --interactive is the easiest setup path.
    • For repo bootstrap, kb init-repo --repo ... needs a GitHub token with repository admin access.