boilit
v0.1.3
Published
A CLI tool to apply module refs from Git repositories into your project
Maintainers
Readme
BoilIt 🔥
Decentralized boilerplate and module manager built on Git. BoilIt lets you bring code from a source repository into your project by applying module references (branches/tags/commits) in sequence, resolving dependencies, and guiding you through conflict resolution.
Installation
Global (via npm):
npm install -g boilitDevelopment (local):
npm install npm run build npm link
Usage
Main command
boilit use <repo> [modules...] [--path <target>]<repo>: source Git repository URL (HTTPS/SSH) containingboilit.toml.[modules...]: list of modules to apply. If empty, applies all modules from the repository.--path <target>: target directory (default:.).
Examples
Apply all modules:
boilit use https://github.com/guibais/boil-test-repo.gitApply only
authanduserinto a specific directory:boilit use https://github.com/guibais/boil-test-repo.git auth user --path ./my-project
Simple examples
Apply everything into the current directory
boilit use https://github.com/guibais/boil-test-repo.gitApply a single module
boilit use https://github.com/guibais/boil-test-repo.git authApply multiple modules into a destination folder
boilit use https://github.com/guibais/boil-test-repo.git user payment --path ./destUse mixed refs (branch, commit, tag) defined in
boilit.toml[modules.api] refs = ["feature/api", "d34db33f", "v1.2.3"]boilit use https://github.com/guibais/boil-test-repo.git apiHonor file globs (e.g.,
[default].filesandignoreinboilit.toml)[default] files = ["**/*.md"] ignore = ["**/drafts/**"]boilit use https://github.com/guibais/boil-test-repo.git
Configuration (boilit.toml)
In the source repository, create a boilit.toml file at the root defining available modules and defaults. Real example (from the example repo below):
name = "example-repo"
description = "Example repository with modules"
[default]
origin = "https://github.com/your-org/your-repo.git" # global default Git remote URL; modules can override with their own 'origin'
# Optional: restrict what gets copied globally
# Without 'files', BoilIt copies everything
files = ["**/*.md"]
# Optional: exclude patterns (only applied when explicitly set)
ignore = ["**/drafts/**", "**/skip.md"]
[modules.auth]
description = "Authentication module"
refs = ["auth-branch"]
[modules.user]
description = "User module"
refs = ["user-branch", "a1b2c3", "hotfix-tag", "another-branch"]
# dependecies (optional) means "apply this module only after the dependencies are applied"
dependencies = ["auth"]
[modules.payment]
description = "Payment module"
refs = ["payment-branch"]
dependencies = ["user"]
path = "custom-folder/payment"
files = ["modules/*.md"]
# Exclude some files from this module only
ignore = ["modules/secret.md"]
[modules.user2]
description = "User2 module with conflict"
refs = ["user2-branch"]
[modules.external]
description = "Module coming from an alternate remote"
origin = "[email protected]:another/repo.git" # per-module Git remote URL override
refs = ["external-feature"]Module options
description: module description (optional)refs: array of Git references applied em sequência; você pode misturar múltiplas branches, tags e commits (SHAs)dependencies: other modules that must be applied firstpath: optional destination path where the module will be placedfiles: file glob(s) to include (e.g.,modules/*.md)ignore: file glob(s) to exclude for this moduleorigin: optional Git remote URL for this module (overrides[default].origin). If omitted, BoilIt uses[default].originwhen present, otherwise the source repo URL passed to the CLI.
Additionally, in [default] you can define:
files: global include globs applied as a baseline to all modulesignore: global exclude globs applied to all copied files
File selection semantics
- If
[default].filesis provided, those files are included globally (subject to[default].ignoreif set). - If a module defines
files, they are included into its destination (subject to[default].ignoreand the module'signoreif set). Ifpathis set, copies land under that subfolder. - Both default-level and module-level
ignoreaccept one or more glob patterns (*,**, etc.). - If neither default-level nor any module defines
files, BoilIt copies everything from the source repo.[default].ignoreis only applied if explicitly set. - The
.gitdirectory is always skipped.
How it works
- Clone the provided repository and read
boilit.toml. - Resolve module dependencies automatically and determine the apply order.
- For each module, run a pipeline based on a
refsarray (branches, tags, or commits):- Fetch and resolve the chosen remote URL for each module (
[default].originor the module'sorigin; falls back to the CLI source repo URL). - Expand each
refinto one or more underlying revisions to apply, then apply them in order. - If needed, fall back to
<remote>/<ref>when appropriate.
- Fetch and resolve the chosen remote URL for each module (
- If a conflict occurs while applying a ref, BoilIt guides you to resolve it manually and choose to continue or cancel.
- Finally, it reports success or failure and cleans up the temporary directory.
Conflict resolution
If a conflict occurs while applying a ref, BoilIt pauses and shows interactive options:
- Resolve conflicts in the indicated files (git status/merge markers).
- In the prompt:
- "Continue (conflicts resolved)" → continue the application of the remaining refs.
- "Cancel (abort)" → abort the current application and stop the execution.
Tip: the example repository has the user2-branch which typically causes a conflict so you can test the flow.
Cancellation
- You can cancel at any time (e.g., via
Ctrl+Cor by choosing "Cancel" in the conflict prompt). - BoilIt handles cancellations globally, aborts ongoing operations (like
cherry-pick --abortwhen applicable), and performs proper cleanup.
Example repository
- https://github.com/guibais/boil-test-repo
Try it:
boilit use https://github.com/guibais/boil-test-repo.git auth user
boilit use https://github.com/guibais/boil-test-repo.git payment --path ./dest
boilit use https://github.com/guibais/boil-test-repo.git user user2 # conflict flowKey characteristics:
- Decentralized: any Git repository with
boilit.tomlcan serve as a module source. - Git-based: leverages Git to fetch and apply module refs while preserving history where possible.
- Refs pipeline:
refsdefine the order of commits/branches to compose a module. - Dependencies: modules can depend on other modules; the order is automatically respected.
Development
- Clone the repository
- Install dependencies:
npm install - Build the project:
npm run build - Link the package globally:
npm link
Tests
npm testLicense
MIT
- Instalação via GitHub Packages (opcional):
npm config set @guibais:registry https://npm.pkg.github.com npm install -g @guibais/boilit
