Currently, templates in cjules (~/.config/cjules/templates/) are static text. It would be incredibly powerful to support dynamic prompt rendering with variables and local context, such as current git diffs or file contents.
Example Usage:
A template refactor.md:
Please refactor the following code:
[Code]
{{.File "src/parser.cr"}}
[Notes]
{{.Var "note"}}
Command:
cjules new --template refactor --var note="Improve error handling"
Proposed variables/helpers to support:
{{.File "relative/path"}} : Inserts the content of the specified file.
{{.GitDiff}} : Inserts the current git diff of the repository.
{{.Var "name"}} : Inserts a user-defined variable passed via --var name=value.
Currently, templates in
cjules(~/.config/cjules/templates/) are static text. It would be incredibly powerful to support dynamic prompt rendering with variables and local context, such as current git diffs or file contents.Example Usage:
A template
refactor.md:Command:
cjules new --template refactor --var note="Improve error handling"Proposed variables/helpers to support:
{{.File "relative/path"}}: Inserts the content of the specified file.{{.GitDiff}}: Inserts the current git diff of the repository.{{.Var "name"}}: Inserts a user-defined variable passed via--var name=value.