create-dokio
v0.1.28
Published
CLI scaffold for Dokio templates
Readme
create-dokio
CLI scaffold for Dokio hub repos and templates. Generates correct file structure, data.yaml, HTML boilerplate, SCSS partials, and auto-wires changelog tooling.
Getting started
Run from your repos workspace folder — the folder where all your hub repos live (e.g. ~/Projects/dokio/).
No install needed. Just run:
npx --yes create-dokio@latestThe --yes flag skips the "Ok to proceed?" prompt. The @latest tag ensures you always run the newest version — no separate update step needed.
Running the CLI
Interactive (recommended)
npx --yes create-dokio@latestPrompts you to choose between creating a Template or a Hub.
Direct commands
# Go straight to template creation
npx --yes create-dokio@latest template
# Go straight to hub creation
npx --yes create-dokio@latest hubCheck version
npx --yes create-dokio@latest --versionUsing pnpm instead of npx
pnpm dlx create-dokioCommands
create-dokio hub
Creates a new hub repository locally with full structure, ready to push to GitHub.
Prompts:
- Hub ID (kebab-case, e.g.
bupa-sam) - Hub display name (e.g.
Bupa Sales And Marketing Hub)
Generates:
bupa-sam-templates/
├── .husky/
│ ├── commit-msg # Enforces conventional commits
│ └── post-commit # Auto-updates template CHANGELOGs on commit
├── .vscode/
│ └── settings.json # scss.validate: false, css.validate: false
├── templates/ # All templates live here
├── docs/
│ └── authoring.md # Template authoring cheat-sheet
├── .gitignore
├── package.json # pnpm project with husky prepare script
└── README.mdNext steps after hub creation:
cd bupa-sam-templates
pnpm install # installs husky and activates hooks automatically
# Create the GitHub repo at github.com/dokioco/bupa-sam-templates, then:
git remote add origin https://github.com/dokioco/bupa-sam-templates
git push -u origin maincreate-dokio template
Scaffolds a new template inside an existing hub repo. Automatically clones the hub if not found locally, or pulls latest if it is.
Prompts:
- Template ID (e.g.
HW485) - Template name (e.g.
My Cool Template) - Template type — PDF, General, Email, or Video
- Hub selection
What it does:
- Clones or pulls the hub repo
- Scaffolds the template folder inside
<hub-id>-templates/templates/ - Auto-repairs any missing hub tooling (hooks,
.vscode,.gitignore,README.md)
create-dokio validate [--staged | <path>]
Validates templates against the upload contract (required fields, file structure, YAML correctness).
--staged— validates only the templates that have staged changes (useful in a pre-commit hook)<path>— validates a specific template folder
create-dokio changelog
Runs the post-commit changelog step manually. Normally invoked automatically by the post-commit hook after every commit — only run this directly if you need to regenerate a changelog entry outside of a commit.
create-dokio ai-key [key]
Stores an Anthropic API key so the changelog generator writes AI descriptions instead of falling back to the commit subject. Run from inside a hub repo.
# pass the key directly
npx --yes create-dokio@latest ai-key sk-ant-...
# or omit it to be prompted (input is hidden)
npx --yes create-dokio@latest ai-keyWrites ANTHROPIC_API_KEY to a local .env (updating the line in place if it already exists) and ensures .env is gitignored. There is no built-in default key — bring your own from console.anthropic.com. The key stays on your machine and is never committed.
create-dokio repair
Migrates an existing hub to the current layout (husky + TypeScript tooling) and reinstalls dependencies. Use this on older hub repos that were scaffolded before the husky migration.
# from inside an existing hub repo (e.g. bupa-sam-templates/)
npx --yes create-dokio@latest repairWhat it does:
- Migrates
.githooks/→.husky/and removes legacy Python tooling - Writes a
package.jsonwith the huskypreparescript if absent - Runs
pnpm installso hooks activate immediately
Safe to re-run any time — it never touches your template content.
Hooks work on clone now
Hub git hooks are managed by husky. After cloning a hub, pnpm install activates
them automatically — no git config / no manual repair step required.
git clone https://github.com/dokioco/bupa-sam-templates
cd bupa-sam-templates
pnpm install # hooks are liveTeammates on older hubs: if your hub predates the husky migration, run
npx --yes create-dokio@latest repaironce to upgrade it.
Template types
PrinceXML-rendered print documents. Supports multi-page, resizable layouts, orderable exports, and proof downloads.
Prompts: page dimensions (mm), page count, PrinceXML version (11 or 15), resizable, proof downloads, orderable export.
Generates:
HW485-my-cool-template/
├── CHANGELOG.md
├── data.yaml
├── index.html
├── assets/
├── partials/
│ ├── page1-cover.html
│ └── page2-content.html
└── scss/
├── style.scss.hbs
├── _fonts.scss
├── _mixins.scss
├── _variables.scss
└── pages/
├── _page1.scss
└── _page2.scssGeneral (image)
Chrome-rendered image output — JPG and/or PNG. Single or multi-section layouts.
Prompts: dimensions (px), page/section count, export formats (JPG, PNG, or both).
HTML email scaffold. Includes Outlook conditional comments, {{{___assembled_css}}} injection, {{{subject}}} title, and Gmail-safe table structure.
Prompts: subdomain only — email structure is fixed at 600px.
Video (WIP)
1920×1080 video template scaffold. data.yaml includes duration and highlight point fields.
After scaffolding a template
# Navigate to the template folder
cd bupa-sam-templates/templates/HW485-my-cool-template
# 1. Check data.yaml — name and subdomain are auto-set, verify they're correct
# 2. Add assets to assets/
# 3. Edit partials/
# When ready to commit — go back to the hub root first:
cd ../../
git add templates/HW485-my-cool-template/
git commit -m "feat: add My Cool Template"
git pushChangelog generator
Each template has its own CHANGELOG.md. The post-commit hook runs create-dokio changelog automatically after every commit and:
- Detects which template folders changed
- Logs the commit to each affected template's
CHANGELOG.md(author, date, branch, title, files with Added/Modified/Deleted labels) - Amends the commit silently to include the changelog update
AI descriptions:
- With
ANTHROPIC_API_KEYset in the environment → Claude Haiku generates a summary - Without key → entry is logged without a description
Updating
Always use @latest when running the CLI — you're always on the newest version automatically. No separate update step.
npx --yes create-dokio@latestCheck what version is on npm:
npm show create-dokio versionRemoving
If you ever installed create-dokio globally (via npm install -g), remove it with:
npm uninstall -g create-dokionpx users have nothing to uninstall — npx doesn't permanently install packages.
Development
git clone https://github.com/dokioco/create-dokio
cd create-dokio
pnpm install
pnpm build # compile to dist/
pnpm link --globalCommit format
Enforced by commitlint on every commit:
feat: add resizable PDF option
fix: correct page count in data.yaml
chore: update dependencies
docs: update READMEBreaking changes:
feat!: redesign template APILicense
Proprietary — internal use at Dokio only. See LICENSE.
