#2668·chezmoi

Replace github.com/masterminds/sprig template functions

Author: twpayneCreated Jan 2, 2023Updated Aug 28, 2026
Labelsenhancement

Is your feature request related to a problem? Please describe.

github.com/masterminds/sprig, used by chezmoi, has unfortunately become a popular library of template functions despite several critical issues:

  • It is unmaintained.
  • The argument order of its functions is incompatible with Go template's pipelining (see #2215).
  • Its naming convention does not match Go's (e.g. toJson should be toJSON).

Describe the solution you'd like

chezmoi's template functions should be up-to-date, compatible with Go template pipelining, and match Go's naming conventions.

Describe alternatives you've considered

Keeping minorminds/sprig template functions as-is.

Additional context

A smooth transition should be provided, with both old and replacement template functions being available to users for some time. Users can use .chezmoiversion to help the transition.