feat: npx support — no global install required#9
Merged
willynikes2 merged 6 commits intomasterfrom Mar 23, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace PROJECT_ROOT with KB_DIR/ENV_PATH from paths.js for .env, setup-config.json, and docker-compose.yml writes - Update generateDockerCompose to use npx image and KB_DIR output path - Add isNpx() helper and warn users when persistent services are chosen under npx (ephemeral cache) - Remove unused fileURLToPath import and PROJECT_ROOT constant Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ain entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.knowledge-base/alongside the DBnpx knowledge-base-server startworks out of the box from any directorykbbinary path viawhich kbimage: node:22-slim+ npx instead ofbuild: .filesfield (bin/, src/, openapi.json only)What changed
src/paths.js— canonical .env loading from~/.knowledge-base/.env, exportsENV_PATHbin/kb.js,bin/weekly-synthesis.js— use paths.js instead ofdotenv/configsrc/cli/setup.js— removedPROJECT_ROOT, writes to KB_DIR, npx detection, docker fixkb-server-install.sh,kb-server.service.example— use resolved kb pathbin/cron-capture.sh— uses~/.knowledge-base/.envandkbCLIEXTENDING.md— updated .env documentationpackage.json— fixed main entry, added files fieldTest plan
tests/paths.test.js— verifies ENV_PATH exporttests/setup.test.js— verifies no PROJECT_ROOT references remaintests/npx-compat.test.js— 5 integration tests (run from /tmp, .env loading, openapi.json)Review history
Plan reviewed by Claude, OpenAI Codex (GPT-5.4), and Google Gemini across 3 rounds. Issues found and fixed:
build: .breaks in ~/.knowledge-base/, cron-capture.sh stale paths, EXTENDING.md docsCloses #5
🤖 Generated with Claude Code