Extensions (available starting in v0.12.11, see releases) are open-source packaged functions that extend the capability Tilt, right inside your Tiltfile.
We’ve seen the Tilt community actively share code snippets of Tiltfile functionality in Slack #tilt, including ideas such as forcing resources into different namespaces, injecting sidecars, and even running tests. We’ve created the Extensions platform to streamline this effort, especially helping Tilt newcomers leverage ideas from existing users. Consider contributing an extension.
The tilt-extensions repo lists all published extensions.
Use an extension
Suppose we want to use the
hello_world extension, which prints “Hello world!”. First,
load() the extension with a special
ext:// syntax, referring to both the extension name
hello_world, and function name
hi, in your Tiltfile:
Now when you call
hi() in your Tiltfile, Tilt will print “Hello world!”.
Behind the scenes
ext://hello_world to tilt-extensions/blob/master/hello_world/Tiltfile. So when the extension is first loaded into your project, Tilt copies the remote Tiltfile into the
tilt_modules directory of your local project. I.e. Tilt writes the contents of
Commit to source control
tilt_modules directory to your project repo (do not
gitignore it), so that your teammates don’t have to download it, and to ensure that your entire team uses the same copy of the extension. Once Tilt has downloaded an extension, it will not be updated, avoiding suprise breakages.
Tilt doesn’t support versioning of extensions at the moment.
(To get notified about versioning, please subscribe to this issue and thumbs-up it so we know you care about it.)
Avoid changing extensions
Avoid changing extensions directly in
tilt_modules. If you’re interested in modifying an extension, consider contributing a new one instead,