Tmuxcraft is a Go-based alternative to tmuxifier, using YAML configuration files for defining tmux sessions and layouts.
- Overview
- Features
- Installation
- Usage
- Sample Configuration
- Releases
- Builds
- Commands
- Contributing
- Running Tests
- Running Linter
- Code Formatting
- License
- Author
Tmuxcraft allows you to easily manage your tmux sessions and layouts through simple YAML configuration files. It's designed to be lightweight and user-friendly, offering a range of commands to streamline your tmux workflow.
- Define tmux sessions and layouts in YAML.
- Load and list session layouts.
- Create new session layouts with your preferred editor.
- Generate shell scripts from session layouts for easy execution.
- Cross-platform support: Linux, macOS, and Windows builds are available.
-
Clone the repository:
git clone https://github.com/sugan0tech/tmuxcraft.git
-
Navigate to the project directory:
cd tmuxcraft
-
Build the project:
go build -o tmuxcraft ./cmd/tmuxcraft
-
Ensure the binary is in your
PATH
:export PATH=$PATH:$(pwd)
-
Go to the Releases page.
-
Download the appropriate binary for your operating system:
tmuxcraft-linux-amd64
(Linux, 64-bit)tmuxcraft-darwin-amd64
(macOS, Intel)tmuxcraft-darwin-arm64
(macOS, M1/M2)tmuxcraft-windows-amd64.exe
(Windows, 64-bit)
-
Move the binary to a directory in your
PATH
(e.g.,/usr/local/bin
or~/.local/bin
). -
Make the binary executable (if necessary):
chmod +x tmuxcraft
To use Tmuxcraft, you can run the following commands:
tmuxcraft <command> [<args>]
Here’s an example YAML configuration for a session:
session_name: test
path: ~/Documents/GitHub/tmuxcraft
windows:
- name: nvim
path: ~/Documents
command: nvim
panes:
- command: tty-clock -t
split: h
size: 20
- command: bash
size: 50
split: v
- name: resource
command: htop
panes: []
- name: test
panes: []
Generated shell scripts can be configured using the -O {path}
flag. Example usage:
tmuxcraft -ls test -gs -O {path}
Generated Script Example:
#!/bin/bash
tmux new-session -d -s test -c ~/Documents/GitHub/tmuxcraft
tmux rename-window -t test: nvim
sleep 0.1
tmux send-keys -t test:nvim.1 "nvim" C-m
tmux split-window -t test:nvim.1 -c ~/Documents/GitHub/tmuxcraft -h -l 40
sleep 0.1
tmux send-keys -t test:nvim.2 "tty-clock -t" C-m
tmux split-window -t test:nvim.2 -c ~/Documents/GitHub/tmuxcraft -v -l 20
sleep 0.1
tmux send-keys -t test:nvim.3 "bash" C-m
tmux new-window -t test -c ~/Documents/GitHub/tmuxcraft -n resource
sleep 0.1
tmux send-keys -t test:resource.1 "htop" C-m
tmux new-window -t test -c ~/Documents/GitHub/tmuxcraft -n test
Tmuxcraft binaries are available for download in the Releases section. Each release includes:
- Binaries for Linux, macOS (Intel and ARM), and Windows.
- Change logs for each version.
Example tag: v1.0.0-alpha.1
Releases are automatically created using GitHub Actions whenever a new tag is pushed. The build workflow ensures cross-platform binaries are generated for each release.
Tmuxcraft is built for the following platforms:
Platform | Architecture | File Name |
---|---|---|
Linux | amd64 | tmuxcraft-linux-amd64 |
macOS (Intel) | amd64 | tmuxcraft-darwin-amd64 |
macOS (M1/M2) | arm64 | tmuxcraft-darwin-arm64 |
Windows | amd64 | tmuxcraft-windows-amd64.exe |
Builds are created using Go’s cross-compilation capabilities.
List available commands:
tmuxcraft --help
We welcome contributions to Tmuxcraft! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Make your changes.
- Commit your changes:
git commit -m "Add some feature"
- Push to the branch:
git push origin feature-branch
- Open a pull request.
Please ensure that your code adheres to the existing coding standards and includes appropriate tests.
To run tests, use the following command:
go test ./...
We use golangci-lint for linting. Ensure you have it installed, then run:
golangci-lint run ./...
Ensure your code is properly formatted by running:
gofmt -d .
Tmuxcraft is released under the MIT License. See LICENSE for more information.