Big News!  Tilt is joining Docker

Buttons. Icons. APIs.

Recently I showed you how to add a custom button to a resource and cloyingly teased there was more to come.

Well, dear reader, more has come! The latest version of Tilt not only comes with a shiny new resource overview layout but also adds support for navbar buttons. Navbar buttons appear in the fixed header, so you can always access them regardless of which resource you have selected.

navbar button demo

Adding navbar buttons to your Tiltfile is very similar to adding resource-specific buttons: the uibutton extension can take care of it with a couple argument tweaks. The hardest part of adding a navbar button is picking the icon! Tilt includes the Material Icons set or you can provide your own SVG (ideal for brand icons or honking).

As the Tilt champion at your company, you might be used to helping debug configuration issues with your coworkers. Let’s build a button to gather some useful information about their Tilt setup and pre-compose a report to save ourselves some time!

report issue button

We’ll use a Python script that runs tilt doctor and tilt get session to pre-populate an email:
#!/usr/bin/env python3

import subprocess
import sys
import webbrowser

from urllib.parse import quote

if __name__ == "__main__":
    tilt_bin = sys.argv[1]
    doctor =
        args=[tilt_bin, "doctor"],

    session =
        args=[tilt_bin, "get", "session", "Tiltfile", "-o=yaml"],

    mailto = "{subject}&body={body}".format(
        subject=quote("Tilt Issue"),
            "DESCRIBE YOUR ISSUE HERE\n\n--------------------\n{doctor}\n{session}".format(
                doctor=doctor, session=session

We add a new button to invoke the script by using the uibutton extension in our Tiltfile:

load('ext://uibutton', 'cmd_button', 'location')

# create a button to run the linter for the 'frontend' resource
           argv=['python3', '', sys.executable],
           text='Report Issue',

ℹ️ sys.executable contains the path to the Tilt binary, which our Python script uses to invoke Tilt to gather diagnostics

This is pretty similar to creating a resource-specific button, but instead of specifying a resource, we passed location=location.NAV. Additionally, since navbar buttons in Tilt are icons with text-on-hover, we provided an icon name from the Material Icons font.

Let’s tilt up and check it out!

navbar button demo

You’re now ready to go on your way to bedazzle your Tilt, but if you’re curious about the APIs used by this extension under the hood, read on…

Deep Dive

More and more parts of Tilt are being exposed as APIs to allow building upon and extending built-in Tilt functionality. You might have seen our post a while back introducing the Tilt apiserver.

One of the newer types is UIButton - we can view the tilt-feedback button we created above using the Tilt CLI:

tilt get -o=yaml uibuttons tilt-feedback
kind: UIButton
  creationTimestamp: "2021-07-07T21:17:24Z"
  name: tilt-feedback
  resourceVersion: "2"
  uid: ef00ec53-c949-4ab4-8174-b98b653072f3
  iconName: support_agent
    componentID: nav
    componentType: Global
  text: Report Issue
  lastClickedAt: "2021-07-07T21:17:42.827000Z"

If you’ve edited Kubernetes YAML files, this hopefully looks familiar! The spec is our configuration including the icon and placement while the status is the current state, which in the case of a button just includes the last time that it was clicked.

What is not part of the UIButton resource is anything related to the Python command, but we know a command runs when we click the button because I included a GIF above and everything on the internet is true, right?

For the skeptics, one of the core Tilt types in the apiserver is Cmd, which handles execution commands on the local machine running Tilt. The extension created a Cmd resource along with the UIButton resource, so let’s take a look at it:

tilt get -o=yaml cmd btn-tilt-feedback
kind: Cmd
  annotations: cmd:tilt-feedback
  creationTimestamp: "2021-07-07T21:17:24Z"
  name: btn-tilt-feedback
  resourceVersion: "11"
  uid: f84a9e14-f42d-453b-b0db-1e8a115d904e
  - python3
  - /usr/local/bin/tilt
  dir: /Users/milas/demo/navbar-btn
    startAfter: "2021-07-07T21:17:28Z"
    - tilt-feedback
  ready: true
    exitCode: 0
    finishedAt: "2021-07-07T21:17:43.621569Z"
    pid: 29295
    startedAt: "2021-07-07T21:17:42.834889Z"

Here, the extension populated spec with the argv we specified as well as startOn. Tilt uses the startOn field to watch other resources and invoke the command when any of those resources change appropriately. In this case, whenever the UIButton named tilt-feedback has its lastClickedAt field in the status updated, the command will execute.

There’s a lot of power here: Tilt’s local_resource uses a similar pattern with the restartOn field and FileWatch objects, for example.

As Tilt’s API grows, there will be more and more possibilities to connect these foundational types in new and inventive ways!

If you’re using the Tilt API, be sure to let us know!


Already have a Dockerfile and a Kubernetes config?

You’ll be able to setup Tilt in no time and start getting things done. Check out the docs! 

Having trouble developing your servers in Kubernetes?