Glazierv0.2.4
glaze builds tmux sessions, windows and panes from a .glaze file written in HCL. You describe the workspace once, then run glaze up in the project directory and get the same layout every time. No more rebuilding panes by hand after every reboot.
session {
name = "daemon-run"
window {
name = "ice-breaker"
layout = "main-vertical"
pane {
commands = ["nvim ./payloads"]
}
pane {
commands = ["watch -n1 netwatch --target arasaka-mainframe"]
}
}
}$ brew install wilhelm-murdoch/tap/glazier
$ glaze up
But, why HCL?
If you’ve worked with Terraform in the past you probably know what you’re in for. Unlike other tmux session managers that rely on YAML to define reproducible profiles, you get the following for free with HCL.
It actually has a grammar and not an indentation convention.
Profile blocks have braces, so a misplaced indent can’t silently move a pane into the wrong window. The parser knows what you mean structurally or refuses.
Expressions are part of the format.
"gig-${var.district}", upper(path.base), [for e in local.editors : upper(e)] are all valid HCL. This isn’t a templating layer bolted on in front of a YAML parser. The same parser that reads the file evaluates them, so an error in an expression points exactly at its source using a human-readable diagnostic.
Types are real and comments are valid.
true is a boolean, 1 is a number and a string is… a string. YAML’s weird formatting surprises do not exist. A number variable given “two” is a type error, not a string that tmux rejects later. #, // and /* ... */ are validated completely by using glaze format while most YAML writers drop them.
Coming from Terraform?
If you’ve used Terraform or Packer you already know how to use it. Variables, locals, var., local., for comprehensions and the diagnostic styles all use the same vocabulary. The learning curve is close to zero for the audience most likely to want a tool like this.
How Glazier uses it.
The whole profile is validated before tmux starts.
The schema is an hcldec spec with validation closures on every attribute. This means layout names and raw layout strings (structure and pane count), hook names against the union of tmux 3.2a to 3.7c, directories that must exist, size and adjust ranges, null elements that tmux won’t accept, empty session names, synchronize-panes on a window whose panes run commands. YAML tools typically find these at runtime, one tmux error at a time leaving a half-started session.
Terraform-style diagnostics with the line and a snippet.
Every error is an hcl.Diagnostic with a source range, rendered with the offending line underlined and all of them in one run sorted by file and line. This includes errors inside a --var-file. This is the single most visible payoff. At least for myself.
Typed and declared inputs.
You get variable blocks with type, default and description. An undeclared --var is an error, a missing required one is an error, a wrong type is an error. Precedence is defined (default, --var-file and --var) and the same context serves up and down, so teardown recomputes the same values.
A single profile for many workspaces.
Variables, locals and the go-cty function library (split, join, format, random) turn one file into a template without needing to reach for a second tool.
A canonical formatter for free.
glaze format is hclwrite, the same engine as terraform fmt and --validate makes it a CI gate with meaningful exit codes.
Saving a session runs through the same parser.
Using glaze save creates a profile generated with hclwrite and tested by decoding it again. This means a saved profile is always guaranteed to be valid.
Hostile input is bounded.
Nesting is capped before hclparse recurses, locals have a 1MB budget and the decode path is fuzzed. That is only possible because the format has a parser you can actually put limits in front of.
Getting started
Learn how to install Glazier, write your first profile and bring a workspace up.
Guides
Step by step guides to the common tasks: templates, saving a session, reliable commands, scripting and sockets.
Migrating
Move a workspace from another tmux session manager to a glaze profile.
Profiles
The reference for every block, attribute, variable and function.
Command line
The reference for the glaze command line: every subcommand, every flag, the exit codes and the signals.
Project
The tmux versions and shells Glazier tests, the security model of a profile and how to contribute.