Documentation

glaze ( Glazier ) is a command-line tool for declaratively managing your tmux workspaces. You describe your sessions, windows and panes once in an HCL-based .glaze file, then recreate them on demand. No more rebuilding layouts by hand after every reboot, which is a thing I did for far longer than I would like to admit until I discovered the wonderfully-niche world of tmux session managers.

HCL
session {
  name = "daemon-run"

  window {
    name   = "ice-breaker"
    layout = "main-vertical"

    pane {
      commands = ["nvim ./payloads"]
    }

    pane {
      commands = ["watch -n1 netwatch --target arasaka-mainframe"]
    }
  }
}

Type this command in a directory that contains a .glaze file.

Console
$ glaze up

That’s basically it. The rest of this page is dedicated to explaining what just happened.

Why did you build it?

I originally built it for myself because I was interested in learning how Terraform parses and validates its HCL specs. I’m a platform engineer by trade and a day doesn’t go by where I have to dig through some Terraform or Packer configuration files. I’m also a heavy tmux user, so these two things lined up perfectly and presented a great learning opportunity.. This has been a slow-burning labour of love for the past couple of years and it’s finally in a state where I feel comfortable sharing it with others.

Personally, I like the declarative self-validating HCL spec, variable and string function support for templates and being able to mostly save a session. It has been an incredibly fun journey in over-engineering a solution to an already solved problem.

How does it compare to others?

There are plenty of other excellent options out there ( tmuxinator, tmuxp, smug, teamocil and friends ) that effectively do the same thing and have been around far longer. If you already use and trust any of these, there really isn’t a strong value proposition for moving over to glaze. Keep using them. I’m not here to convince anyone.

Where does Glazier differ?

If you are still reading, this table is where Glazier shines. It covers what Glazier does and not what the others lack. I have not audited them against this list and I’m not going to pretend otherwise.

AreaWhat Glazier does
ValidationGlazier validates the whole profile before it starts tmux. A diagnostic shows the file, offending line and a snippet in the style of Terraform. See Diagnostics.
VariablesA profile declares typed variable blocks, locals and string functions. Glazier rejects a value of the wrong type before the session starts. See Variables, Locals and Functions.
Command sequencingGlazier loads the commands of a pane into a tmux paste buffer and the shell of the pane runs them with eval. tmux wait-for sequences the commands with no fixed sleeps. Glazier tests this on bash, zsh, dash, busybox ash and fish. See Commands.
glaze savesave captures the structure of a live session: names, starting directories, focus and layout. By design it does not export commands, environment variables, hooks or options. See save.
CompatibilityAn end-to-end matrix runs each release on tmux 3.2a, 3.3a, 3.4, 3.5a and 3.7c on multiple OSes and architectures. Plus a weekly canary on the tmux master. See Compatibility.

The glaze save row deserves a few more words, because it reads like a gap and it isn’t one. A captured command runs again on the next glaze up, a hook is a command bound to an event, the session environment holds secrets from your shell and tmux reports options as effective state mixed with your tmux.conf. Each of those is a footgun, so save refuses to export them. The last thing you want is to commit your AWS credentials to your source forge. Anyway, you at the very least get the layout back and you add the rest by hand. The save guide has the full reasoning.

Features

  • The syntax is HCL with Terraform-style diagnostics.
  • Glazier supports multiple *.glaze files. It resolves them from a flag, the current directory or $GLAZE_PATH.
  • Profiles declare typed variable blocks just as with Terraform. You read them through var. and built-in GLAZE_ENV_* variables are also made available though env..
  • Template functions give string manipulation.
  • Profiles set environment variables, hooks and tmux options.
  • Glazier runs pane commands exactly as you write them, in a POSIX shell or in fish.
  • tmux wait-for sequences the commands without fixed sleeps.
  • The glaze format command formats and validates a profile.
  • The glaze save command captures a live session into a profile.
  • The glaze down command kills a profile’s session. The glaze ls command lists the sessions.

Glazier supports only Linux and macOS. Though it’d probably work on WSL, tmux has no native Windows build, so there is nothing for Glazier to drive there officially. Go nuts, though, it’s your machine.