Skip to content

feat: Improve task init template options#2811

Closed
B13rg wants to merge 3 commits intogo-task:mainfrom
B13rg:improve-task-init-templating
Closed

feat: Improve task init template options#2811
B13rg wants to merge 3 commits intogo-task:mainfrom
B13rg:improve-task-init-templating

Conversation

@B13rg
Copy link
Copy Markdown

@B13rg B13rg commented Apr 26, 2026

This PR adds an additional flag --init-template that allows specifying a template to create.
It adds an additional template (full.yml) that shows more complex task usage.

User call it with task --init-template=default or task --init-template=full to template the two types.

This is related to issue #2012

Created with assistance from Claude Haiku 4.5.

@B13rg
Copy link
Copy Markdown
Author

B13rg commented Apr 26, 2026

The current full.yml file is a good start, but a little rough on the edges. I want to simplify it a little and integrate examples from the docs more closely. Passing list to view available templates isn't very ergonomic.

Documentation changes still need to be made.

As wished for in the issue, this could be expanded to allow the user to set a custom template file via environment variable. It could be added as an additional option env alongside the new default and full types.
I think this would be useful to be able to set the in a .env project file or a .bashrc.
If specified, it could also override the template used by the plain --init flag.

It big enough to potentially be a separate PR though.

@B13rg
Copy link
Copy Markdown
Author

B13rg commented Apr 26, 2026

On further thought, I think this approach is too heavy handed. I worry about stuffing the full opinionated template in every binary and being very rarely used.

I think configuring a template file via env var is cleaner and doesn't require an additional flag. I will think further and update the issue

@B13rg B13rg closed this Apr 26, 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.

1 participant