Skip to content

Make possible to set a custom template for a new project#1689

Closed
ofabianomartins wants to merge 14 commits intoloco-rs:masterfrom
ofabianomartins:feature_make_loco_new_template_customizable
Closed

Make possible to set a custom template for a new project#1689
ofabianomartins wants to merge 14 commits intoloco-rs:masterfrom
ofabianomartins:feature_make_loco_new_template_customizable

Conversation

@ofabianomartins
Copy link
Contributor

This pull request enable loco new command use a custom start template by setting a new option --template-dir the direct to especif folder

@ofabianomartins ofabianomartins force-pushed the feature_make_loco_new_template_customizable branch 2 times, most recently from a0f6443 to 17e02e3 Compare November 12, 2025 21:15
@ofabianomartins ofabianomartins force-pushed the feature_make_loco_new_template_customizable branch from f4aab77 to fb4b530 Compare January 12, 2026 22:16
@kaplanelad
Copy link
Contributor

Thanks for the contribution! A few things:

  1. Naming: --template-dir doesn't clearly convey what happens, the user is providing a custom starter project to scaffold from. Something like --from or --starter-path might be clearer: loco new --from ./my-custom-starter.
  2. Tests: Please add tests, at minimum, test with a valid template directory and with a missing/invalid one.
  3. Validation: Validate that the directory exists and contains the required structure (e.g., setup.rhai) before processing, with a clear error message if something is missing.

@ofabianomartins
Copy link
Contributor Author

Thanks for feedback, i will work on it.

@ofabianomartins
Copy link
Contributor Author

@kaplanelad i made update you asked. Could review please.

@kaplanelad
Copy link
Contributor

Hey @ofabianomartins, thanks for the effort on this! Unfortunately I'm going to pass on merging this PR. The feature introduces git cloning, zip downloading, and HTTP fetching into loco new, which significantly increases the attack surface of a CLI tool that runs with full user privileges.

@kaplanelad kaplanelad closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants