Skip to main content

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_project
  • NAME_PASCAL: MyAwesomeProject
  • NAME_KEBAB: my-awesome-project
  • NAME_CAMEL: myAwesomeProject
  • NAME_PRETTY: My Awesome Project

For file contents (lowercase, used with Jinja2 delimiters):

  • name_snake: my_awesome_project
  • name_pascal: MyAwesomeProject
  • name_kebab: my-awesome-project
  • name_camel: myAwesomeProject
  • name_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

  1. Finds your project root: Locates the nearest .boilersync file (created during init)
  2. Reads project info: Gets the original template name and project names from .boilersync
  3. Creates fresh template: Initializes the template in a temporary directory using saved names
  4. Sets up git: Creates a git repo and commits the fresh template
  5. Overlays your changes: Copies your current project files over the fresh template
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boilersync-1.2.4.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boilersync-1.2.4-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file boilersync-1.2.4.tar.gz.

File metadata

  • Download URL: boilersync-1.2.4.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for boilersync-1.2.4.tar.gz
Algorithm Hash digest
SHA256 78d18361f19f36ae4bfcafad5d483dcf77ae663b281292defbb8d6664a9e6764
MD5 b9888350c12f1429ced763d11ffad977
BLAKE2b-256 53979e6593691f765caba5ddde5358a4b1cde003455a0676a2a794c47b7bbf27

See more details on using hashes here.

File details

Details for the file boilersync-1.2.4-py3-none-any.whl.

File metadata

  • Download URL: boilersync-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for boilersync-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d02416243f746518b5d3caddac480eb68e085051eb80a47bb95aaff05c3cfc7c
MD5 481a159a0a4ec3877837c56b2c2464fa
BLAKE2b-256 4a61053bdcee5a7678acec5982ef3dd0475089761b0a6ff2eb353195fea763cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page