tmux-dev-helper is a Bash script that automates the creation and management of tmux sessions for development projects. It can automatically open windows for editors, shells, Git tools, Docker/Sail environments, and Makefile builds, streamlining your workflow.
- Automatically creates a new tmux session for a given project directory.
- Opens windows for:
nvim(or your preferred editor)- Shell
- lazygit if the directory is a Git repository
- lazydocker if Docker or Sail is detected
- Makefile build window if a Makefile is present
- Supports running Docker Compose or Laravel Sail in the background or interactively.
- Verbose mode for running commands interactively in a dedicated window.
- tmux
- nvim (or change to your preferred editor in the script)
- lazygit (optional, for Git integration)
- lazydocker (optional, for Docker integration)
- docker and docker-compose (optional)
- Laravel Sail (optional)
- make (optional)
You can install directly from GitHub using curl or wget (no sudo required):
# Make sure ~/.local/bin exists and is in your $PATH
mkdir -p ~/.local/bin
# Using curl
curl -o ~/.local/bin/tdh "https://raw.githubusercontent.com/clys-man/tdh/main/tdh.sh" && chmod +x ~/.local/bin/tdh
# Or using wget
wget -O ~/.local/bin/tdh "https://raw.githubusercontent.com/clys-man/tdh/main/tdh.sh" && chmod +x ~/.local/bin/tdhMake sure ~/.local/bin is in your $PATH. You can add this to your ~/.bashrc, ~/.zshrc, or equivalent:
export PATH="$HOME/.local/bin:$PATH"Alternatively, you can clone or download this repository and move the script manually:
-
Clone or download this repository.
-
Make the script executable:
chmod +x tdh.sh
-
Move it to a directory in your
$PATH(e.g.,~/.local/bin):mv tdh.sh ~/.local/bin/tdh
tdh [--docker] [--sail] [--make] [--verbose] [project_path]--docker: Use Docker Compose ifdocker-compose.ymlis present.--sail: Use Laravel Sail ifvendor/bin/sailis executable.--make: Open a window formakeif a Makefile is present.--verbose: Run Docker/Sail/Make commands interactively in a startup window.project_path: Path to your project directory (defaults to current directory).
Note: Do not use --docker and --sail together.
tdh --docker --make --verbose ~/Projects/my-appThis will create a tmux session for my-app with windows for nvim, shell, lazygit, lazydocker, and make, running Docker Compose and Make interactively.
Feel free to customize the script to fit your workflow!