Skip to content

Make the templ command configurable - #23

Open
bgurmendi wants to merge 1 commit into
romshark:mainfrom
bgurmendi:feat/configurable-templ-cmd
Open

Make the templ command configurable#23
bgurmendi wants to merge 1 commit into
romshark:mainfrom
bgurmendi:feat/configurable-templ-cmd

Conversation

@bgurmendi

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new templ-cmd config option (defaults to templ) that defines the command used to run templ for generate --watch and fmt.
  • This allows using go tool templ instead of relying on a system-wide templ binary, e.g. when templ is managed as a Go tool dependency.

Changes

  • internal/config/config.go: new Config.TemplCmd field (SpaceSeparatedList, default ["templ"]).
  • internal/cmdrun/cmdrun.go: RunTemplFmt and RunTemplWatch now accept the configured command/args instead of hardcoding "templ".
  • main.go: pass conf.TemplCmd at both call sites.
  • example-config.yml and README.md: document the new option.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./...

Allows specifying the command used to run templ (generate --watch and
fmt) via the new templ-cmd config option, defaulting to "templ". This
enables using "go tool templ" instead of a system-wide templ binary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bgurmendi
bgurmendi force-pushed the feat/configurable-templ-cmd branch from 0f53c20 to 440dd19 Compare June 15, 2026 12:33
@romshark romshark self-assigned this Jul 10, 2026
@romshark
romshark self-requested a review July 10, 2026 22:37
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