A CLI tool for template-based project initialization and synchronization with intelligent migration tracking
npm install @timoaus/template-cliA powerful CLI tool for template-based project initialization and synchronization with intelligent migration tracking.
Template CLI enables you to:
- Initialize new projects from evolving templates
- Synchronize existing repositories with template updates using historical reconstruction
- Track and apply incremental changes through a sophisticated migration system
- Resolve conflicts intelligently when template updates conflict with local changes
``bash`
npm install -g @timoaus/template-cli
#### Initialize a new project from a template
`bash`
template-cli init my-new-project --template /path/to/template
#### Check for template updates
`bash`
template-cli check
#### Apply pending updates
`bash`
template-cli update
#### Sync an existing repository with a template
`bash`
template-cli sync --template /path/to/template
#### Generate a migration from template changes
`bash`
template-cli dev generate "add-new-feature" --path /path/to/template
| Command | Description |
|---------|-------------|
| init | Initialize new project from template |check
| | Check for pending template updates |update
| | Apply pending template updates |sync
| | Sync existing repo with template history |
| Command | Description |
|---------|-------------|
| dev generate [name] | Generate migration from template changes |
``
node_modules/**
.git/**
*.log
.env*
dist/**
`json`
{
"version": "1.0.0",
"template": "/path/to/template",
"appliedMigrations": [
{
"name": "2025-06-23T10-30-00_initial-setup",
"timestamp": "2025-06-23T10-30-00",
"appliedAt": "2025-06-23T15:45:00.000Z"
}
]
}
bash
You have an existing project that was based on a template
cd my-existing-projectSync with the template to establish tracking
template-cli sync --template ../my-templateResult: Finds best historical match and creates applied-migrations.json
✅ Best match found: "2025-06-20T10-00-00_add-auth-system" (85% similarity)
- 12 exact file matches
- 3 files with minor differences
- 2 files only in your repo
- 5 newer migrations available to apply
Apply newer template updates
template-cli updateResult: Applies 5 pending migrations with conflict resolution
`$3
`bash
Make changes to your template
cd my-template
... edit files ...
Generate migration
template-cli dev generate "add-user-auth"Result: Creates migrations/2025-06-23T14-30-00_add-user-auth/
✅ Migration 'add-user-auth' generated successfully
📁 Created: migrations/2025-06-23T14-30-00_add-user-auth
Projects can now update
cd ../project-using-template
template-cli check
Result: Shows "add-user-auth" as pending migration
template-cli update
Result: Applies the new authentication features
``- SPEC.md - Complete technical specification
- SYNC.md - Historical synchronization methodology
- CONTRIBUTING.md - Development and release guidelines
- CHANGELOG.md - Release history
MIT