CLI to scaffold a knowledge-kit project.
npx create-knowledge-kit my-kb
cd my-kbThis clones the knowledge-kit template and leaves a ready-to-use project.
- Node.js 20+
- git
- Python 3.10+ and PyYAML (required to run
tools/knowledgekit.pyin the scaffolded project)
npx create-knowledge-kit [project-name] [options]project-name defaults to knowledge-kit if omitted. Use . to scaffold into the current directory.
# New directory
npx create-knowledge-kit my-kb
# Current directory
mkdir my-kb && cd my-kb
npx create-knowledge-kit .
# Existing directory (fails only on conflicting template paths)
cd my-repo
npx create-knowledge-kit .
# Overwrite template-managed files in the current directory
npx create-knowledge-kit . --forceIf the target directory already exists, unrelated files are left untouched. The command exits with an error only when a template path would overwrite an existing file such as README.md, LICENSE, .gitignore, or tools/knowledgekit.py. Use --force only when you want to overwrite those conflicts.
| Option | Description |
|---|---|
--template-path <path> |
Copy from a local template directory instead of fetching from GitHub |
--template-ref <ref> |
Git ref to fetch from the remote template repository (default: main) |
--force |
Overwrite files that already exist at template paths |
-h, --help |
Show help |
-v, --version |
Show version |
You can also override the default template ref with the KNOWLEDGE_KIT_TEMPLATE_REF environment variable.
- Fetches the template from knowledge-kit-template
- Removes git history and
.gitkeepfiles from the generated project
Test with a local clone of knowledge-kit-template before pushing:
node index.js my-kb --template-path ../knowledge-kit-templateOverride the fetch ref if needed:
node index.js my-kb --template-ref <commit-sha>- Repository: https://github.com/haya-inc/knowledge-kit-template
- Default ref:
main(override with--template-reforKNOWLEDGE_KIT_TEMPLATE_REFto pin a tag or commit SHA)
- GitHub Release tags must match the version in
package.json. Avprefix is allowed. - Prereleases are published under the
nextdist-tag on npm; only stable releases go tolatest.