Sessionizer is a powerful command-line interface (CLI) tool designed to manage tmux sessions dynamically based on filesystem rules. It leverages a configuration file to define directories and session rules, and integrates with fzf for interactive selection, enhancing your workflow with tmux.
- Dynamic Session Management: Create and manage
tmuxsessions based on predefined directory rules. - Interactive Selection: Utilize
fzffor interactive session and directory selection. - Configuration Flexibility: Define your session rules and directories through a YAML configuration file.
Before you can use Sessionizer, ensure you have tmux and fzf, and Rust installed on your system as prerequisites.
- Install Tmux: Follow the installation instructions for your operating system.
- Install Fzf: Refer to the official Fzf repository for installation guidelines.
- Install Rust: Install Rust and Cargo using rustup.
After setting up the prerequisites, clone the Sessionizer repository and build it using Cargo:
git clone https://example.com/sessionizer.git
cd sessionizer
cargo build --releaseSessionizer relies on a YAML configuration file to define its behavior. Here's a sample configuration:
directories:
- id: "unique-id-1"
path: "/path/to/directory"
mindepth: 1
maxdepth: 1
grep: ".*"
sessions:
- "session-name-1"
env:
- "VAR=value"- directories: Defines the directories to be included or excluded from session management.
- sessions: Lists previously managed sessions.
- env: Specifies environment variables to be set in sessions.
After configuring Sessionizer, you can manage your tmux sessions using the following commands:
To create a new configuration file or overwrite an existing one:
sessionizer config init [--force]To open the configuration file in your default editor:
sessionizer config editTo display the current configuration:
sessionizer config printTo add a new directory for session management:
sessionizer directories add --path "/path/to/directory" [--mindepth 1] [--maxdepth 1] [--grep ".*"]To remove a directory from session management:
sessionizer directories remove --id "unique-id"To list all configured directories:
sessionizer directories listTo evaluate and list directories based on the current configuration:
sessionizer directories evaluateSessionizer allows you to create, manage, and switch between tmux sessions based on your configured directories:
- Create a New Session:
sessionizer sessions new [--session "session-name"] - Switch to a Session:
sessionizer sessions go [--session "session-name"] - List Session History:
sessionizer sessions history - Add a Session to History:
sessionizer sessions add --session "session-name" [--set] - Remove a Session:
sessionizer sessions remove --session "session-name" - Sync Sessions:
sessionizer sessions sync [--reverse]
For more advanced use cases, such as scripting or integration with other tools, refer to the --help option for each command to explore all available flags and parameters.
Contributions to Sessionizer are welcome! Whether it's feature requests, bug reports, or pull requests, your input is valuable in making Sessionizer better for everyone.
Sessionizer is released under the MIT License. See the LICENSE file for more details.
For more information, visit the Sessionizer GitHub repository.