BoilerSync
Project description
boilersync
boilersync is a boilerplate CLI tool that can not only generate projects from boilerplate templates, but keep the boilerplate "alive" and updated as you continue to develop the derivative projects.
Quick Start
# Initialize a new project from a template
boilersync init my-template-name
# Show pusherences between your project and the original template
boilersync push
When you run the init command, you'll be prompted for project details:
$ boilersync init my-web-app
๐ Initializing project from template 'my-web-app'
==================================================
Project name (snake_case) [my_awesome_project]: my_cool_app
Pretty name for display [My Cool App]: My Cool Application
==================================================
Template System
Project Name Variables
When initializing a project, boilersync prompts you for a snake_case project name and a pretty display name, then generates variables in pusherent naming conventions:
For file/folder names (uppercase, no special symbols):
NAME_SNAKE:my_awesome_projectNAME_PASCAL:MyAwesomeProjectNAME_KEBAB:my-awesome-projectNAME_CAMEL:myAwesomeProjectNAME_PRETTY:My Awesome Project
For file contents (lowercase, used with Jinja2 delimiters):
name_snake:my_awesome_projectname_pascal:MyAwesomeProjectname_kebab:my-awesome-projectname_camel:myAwesomeProjectname_pretty:My Awesome Project
File and Folder Name Interpolation
Use the naming variables directly in file and folder names:
src/NAME_SNAKE_service.py โ src/my_awesome_project_service.py
docs/NAME_KEBAB-guide.md โ docs/my-awesome-project-guide.md
NAME_PASCAL/ โ MyAwesomeProject/
Template Content Processing
Template files use custom Jinja2 delimiters to avoid conflicts:
- Variables:
$${variable_name} - Blocks:
$${% if condition %}...$${% endif %} - Comments:
$${# This is a comment #}
Example template file:
class $${name_pascal}Service:
def __init__(self):
self.name = "$${name_snake}"
self.kebab_name = "$${name_kebab}"
$${# This comment will be removed #}
$${% if include_logging %}
import logging
$${% endif %}
Interactive Variable Collection
When initializing a template, boilersync automatically scans template files (.boilersync files) for variables used in Jinja2 syntax. If it finds variables that aren't predefined (like the project name variables), it will prompt you to provide values:
$ boilersync init my-web-app
๐ง Additional variables needed for this template:
==================================================
Enter value for 'author_email' (email address): user@example.com
Enter value 'author_name' (name): John Doe
Enter value for 'api_version' (version number): v1.0
Enter value for 'database_url' (URL): postgresql://localhost:5432/mydb
==================================================
โ
All variables collected!
The system provides helpful prompts based on variable name patterns:
- Variables ending in
_emailโ prompts for "email address" - Variables ending in
_nameโ prompts for "name" - Variables ending in
_urlโ prompts for "URL" - Variables ending in
_versionโ prompts for "version number" - Variables ending in
_descriptionโ prompts for "description"
Once collected, these values are remembered and reused if the same variable appears in multiple files.
Project Tracking
After initialization, boilersync creates a .boilersync file in your project root to track the template and project information:
{
"template": "web-app",
"name_snake": "my_awesome_project",
"name_pretty": "My Awesome Project"
}
This file uses the same variable names that templates reference, making it easy to understand and potentially use in other tools.
Push Command
The push command helps you see how your project has diverged from its original template. This is useful for:
- Understanding what changes you've made
- Deciding what to sync when templates are updated
- Reviewing project evolution
How It Works
- Finds your project root: Locates the nearest
.boilersyncfile (created duringinit) - Reads project info: Gets the original template name and project names from
.boilersync - Creates fresh template: Initializes the template in a temporary directory using saved names
- Sets up git: Creates a git repo and commits the fresh template
- Overlays your changes: Copies your current project files over the fresh template
- Opens push viewer: Launches GitHub Desktop to show the pusherences
Usage
$ cd my-project
$ boilersync push
๐ Creating push for template 'web-app'...
๐ฆ Initializing fresh template in temporary directory...
๐ Initializing project from template 'web-app'
๐ Using saved project name: my_project
๐ Using saved pretty name: My Project
๐ง Setting up git repository...
๐ Copying current project files...
๐ Opening in GitHub Desktop...
๐ Temporary directory created and opened in GitHub Desktop.
โณ Press Enter when you're done reviewing the push...
The push will show:
- Green (additions): Your custom changes and new files
- Red (deletions): Template parts you've removed or modified
- Modified files: Side-by-side comparison of your changes vs template
Special File Extensions
.boilersync Extension
Files ending with .boilersync are processed as templates and have the extension removed:
package.json.boilersyncโpackage.json(processed)README.md.boilersyncโREADME.md(processed)config.yamlโconfig.yaml(copied as-is)
.starter Extension
Files with .starter as the first extension are "starter files" - they're used only during initialization and won't be synced in future updates:
example.starter.pyโexample.py(init only, no future sync)sample.starter.config.jsonโsample.config.json(init only)tutorial.starter.md.boilersyncโtutorial.md(processed + init only)
Template Directory Structure
boilerplate/
โโโ my-template/
โ โโโ src/
โ โ โโโ NAME_SNAKE_service.py.boilersync
โ โ โโโ utils.py
โ โโโ docs/
โ โ โโโ README.md.boilersync
โ โ โโโ getting-started.starter.md.boilersync
โ โโโ package.json.boilersync
After boilersync init my-template in directory MyAwesomeProject:
MyAwesomeProject/
โโโ src/
โ โโโ my_awesome_project_service.py
โ โโโ utils.py
โโโ docs/
โ โโโ README.md
โ โโโ getting-started.md
โโโ package.json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boilersync-0.1.1.tar.gz.
File metadata
- Download URL: boilersync-0.1.1.tar.gz
- Upload date:
- Size: 29.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb00f4f1a144191ab379630faea3c008642da7527a404959344468b68fa2cf91
|
|
| MD5 |
27ff26043701bc8d67b81287e0577046
|
|
| BLAKE2b-256 |
2f0a4c0bb0eac04cba1361341a9d3101a5eb1b89a10814b75618830e44f384b0
|
File details
Details for the file boilersync-0.1.1-py3-none-any.whl.
File metadata
- Download URL: boilersync-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99f3e203bb20d47eccac4d907ba323f57c8d0dca15c8ba1551211d1d24d6cec6
|
|
| MD5 |
fb5c1bce7f4c53ecb0cd180556021128
|
|
| BLAKE2b-256 |
8141f4ad30d2b9502605e9ebc447785c3946c4d43af772ec25ef197b9741ef07
|