Tmux comes with the ability to script it, intentionally and by design, and it’s very straightforward and simple to open several windows that launch commands in them. Tmuxinator doesn’t reinvent that, and it does add another dependency, and another layer of options and flags and project syntax to learn.
The suggestion to check it out is great, but saying that people who don’t use it are reinventing it is a tad heavy handed. There are good reasons and legitimate scenarios to keep it simple with tmux scripting alone.
Single binary, too, so no Ruby dependency. I really should get it into Homebrew one of these days...
It's amazing how well tmux works as a project setup tool.
[1]: https://gavinhoward.com/2020/12/my-development-environment-a...
I don't know if you've heard of charmbracelet [1] but they are a company that makes a lot of cool go libraries to assist creating CLTs and TUIs. One of which was on HN recently, VHS [2].
#!/usr/bin/env bash
tmux new-session -d -s sessionname
tmux rename-window todo
tmux send-keys -t todo "vim todo" Enter
tmux new-window -d -n dot
tmux send-keys -t dot "cd " Enter
tmux new-window -d -n windowname
tmux send-keys -t windowname "cd ~/reponame" Enter
tmux send-keys -t windowname "commands to run" Enter
tmux attach-session -d -t sessionname
One of my favorite scripts to run is a tmux script that creates a new session with about 7 windows of running my company's project (one window for notes, 3 windows for the backend (runner, code, tests), and 3 windows for the client (runner, code, tests). It's even tweaked further to open up the code in vim, and when used in conjunction with something like harpoon.nvim I have access to my most used files with a few keystrokes. I now create similar scripts for all projects I work on for lengthy periods.
One script builds and runs the environment in the way I prefer to work. Tailored to my taste, for me.
Probably the best advice that I always took to heart was a co worker telling me to "just learn the command line." He really took the phrase "learn your tools" seriously. Now, after some decent experience, I finally feel like I have a decent box of specialty tools when heading to any job site.