Skip to content

haya-inc/create-knowledge-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-knowledge-kit

CLI to scaffold a knowledge-kit project.

Quick Start

npx create-knowledge-kit my-kb
cd my-kb

This clones the knowledge-kit template and leaves a ready-to-use project.

Prerequisites

  • Node.js 20+
  • git
  • Python 3.10+ and PyYAML (required to run tools/knowledgekit.py in the scaffolded project)

Usage

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 . --force

If 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.

Options

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.

What It Does

  1. Fetches the template from knowledge-kit-template
  2. Removes git history and .gitkeep files from the generated project

Local Development

Test with a local clone of knowledge-kit-template before pushing:

node index.js my-kb --template-path ../knowledge-kit-template

Override the fetch ref if needed:

node index.js my-kb --template-ref <commit-sha>

Template

Release

  • GitHub Release tags must match the version in package.json. A v prefix is allowed.
  • Prereleases are published under the next dist-tag on npm; only stable releases go to latest.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors