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:
titletext
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 doctorAPI
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-repoInstall
npm install -g @nzpr/kbNode.js 20+ is required.
Publish
export KB_DATABASE_URL=postgresql://USER:PASSWORD@HOST:5432/DB
kb publish --docs-root ./docsOptional 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
kb init-repokb create- review the issue
- add
kb-approved - the generated PR auto-merges
- 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 searchandkb ask. kb publishdoes not need GitHub credentials.kb init-repo --interactiveis the easiest setup path.- For repo bootstrap,
kb init-repo --repo ...needs a GitHub token with repository admin access.