CLI scaffolder that generates new
@study-lensespackages from the standard template, replacing all placeholders with user-provided values.
Neutral infrastructure: This package generates the boilerplate for new @study-lenses
packages. It makes no pedagogical decisions — those belong in the packages it creates.
Primary — Educational tool developers: Creating new @study-lenses packages. Instead
of forking sl-starter and manually finding/replacing ~15 placeholders across 8+ files,
run one command and get a correct package on first try.
Not installed as a dependency. Run directly:
npm create @study-lenses
# or
npx @study-lenses/createnpm create @study-lenses
# Package name (e.g., utils-normalize): utils-normalize
# Description: Config normalization utilities
# Author (@codeschoolinabox):
#
# Creating @study-lenses/utils-normalize in /path/to/sl-utils-normalize...
# Done!The CLI asks three questions, then generates sl-{name}/ with all files from the
standard template, all placeholders replaced, git initialized, and dependencies installed.
- Generates a complete
@study-lensespackage directory from the standard template - Replaces all placeholder tokens (CHANGEME, @study-lenses/CHANGEME, OWNER/REPO, OWNER, REPO, PACKAGE_DESCRIPTION, [YEAR], [NAME])
- Initializes git and runs
npm install - Validates package name against npm naming rules
- No
--updatemode (re-generating templates in existing packages is deferred) - No interactive file selection (all template files are always generated)
- No custom template support (uses the single standard template)
Generated from TSDoc comments in source. Run npm run docs locally, or see the
hosted API docs.
The CLI is a three-step pipeline:
- Collect Input (
collect-input.ts) — collects package name, description, author via readline - Derive (
derive-variables.ts) — computes all template variables from the three answers - Generate (
generate.ts) — walkstemplates/directory, replaces tokens, writes files
Templates are shipped as real files in the templates/ directory (not embedded strings).
Token replacement uses String.prototype.replaceAll() in a specific order to avoid
substring collisions (e.g., @study-lenses/CHANGEME before bare CHANGEME).
See DEV.md for full architecture, conventions, and the TDD workflow.
See CONTRIBUTING.md and DEV.md.
MIT © 2026 @codeschoolinabox