Edit on GitHub

Extensions

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.

Published extensions

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:

load('ext://hello_world', 'hi')

Now when you call hi() in your Tiltfile, Tilt will print “Hello world!”.

Behind the scenes

Tilt resolves 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 ext://hello_world into tilt_modules/hello_world.

Commit to source control

Commit the 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. If you are interested in versioning, let us know.

Avoid changing extensions

Avoid changing extensions directly in tilt_modules. If you’re interested in modifying an extension, consider contributing a new one instead,

Next steps

Request new extensions or contribute a new one.

 
 
 

Was this doc helpful?