Getting started
Introduction
What Glazier does, why it exists and how it compares with tmuxinator, tmuxp and smug.
glaze ( Glazier ) is a command-line tool for declaratively managing your tmux workspaces. You describe your sessions, windows and panes once in an HCL .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.
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.
$ glaze up
That is the whole pitch. The rest of this page is the honest version of it.
Why I built it
Honestly, only you can answer whether you should use this. I originally built it for myself because I was interested in learning how Terraform parses and validates its HCL specs. I’m also a heavy tmux user, so these two things lined up perfectly. 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 ( the mostly is doing some load-bearing work in that sentence, see below ). It has been an incredibly fun journey in over-engineering a solution to an already solved problem.
How it compares
There are plenty of other 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.
If you are still reading, this table is where Glazier spends its effort. It says what Glazier does, not what the others lack. I have not audited them against this list and I’m not going to pretend otherwise.
Where Glazier differs
| Area | What Glazier does |
|---|---|
| Validation | Glazier validates the whole profile before it starts tmux. A diagnostic shows the file, the line and a snippet in the Terraform style. See Diagnostics. |
| Variables | A 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 sequencing | Glazier 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. There are no fixed sleeps. Glazier tests this on bash, zsh, dash, busybox ash and fish. See Commands. |
glaze save | save captures the structure of a live session: the names, the starting directories, the focus and the layout. By design it does not export commands, environment variables, hooks or options. See save. |
| Compatibility | An end-to-end matrix runs each release on tmux 3.2a, 3.3a, 3.4, 3.5a and 3.7c, plus a weekly canary on tmux master. See Compatibility. |
The save row deserves a word, because it reads like a gap and it is not 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 on replay, so save refuses to export them. You 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
*.glazefiles. It resolves them from a flag, the current directory or$GLAZE_PATH. - Profiles declare typed
variableblocks in the Terraform style. You read them throughvar.. Built-inGLAZE_ENV_*variables are also available. - 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-forsequences the commands. There are no fixed sleeps.- The
glaze formatcommand formats and validates a profile. - The
glaze savecommand captures a live session into a profile. - The
glaze downcommand kills a profile’s session. Theglaze lscommand lists the sessions.
Glazier supports only Linux and macOS. tmux has no native Windows build, so there is nothing for Glazier to drive there.
A note on AI
The architecture, the functionality and the base structure of this project are my own. I use AI as a tool for time-consuming work: documentation, tests and bug hunting. I also use it as a sounding board for structural decisions that keep the project easy to adopt and maintain. For a solo developer it is a force multiplier for high-quality code. There is always a human as a final verification step. It is a tool for drudgery and toil, not a crutch.
Ready to try it? Start with Installation.