11 unstable releases (4 breaking)

new 0.7.0 Dec 3, 2024
0.6.1 Nov 12, 2024
0.6.0 Aug 27, 2024
0.5.0 Apr 2, 2024
0.3.6 Mar 28, 2023

#150 in Command line utilities

Download history 112/week @ 2024-08-22 29/week @ 2024-08-29 12/week @ 2024-09-12 9/week @ 2024-09-19 9/week @ 2024-09-26 6/week @ 2024-10-03 96/week @ 2024-11-07 28/week @ 2024-11-14 6/week @ 2024-11-21 128/week @ 2024-11-28

258 downloads per month

MIT license

76KB
1.5K SLoC

Rusmux - tmux automation

The main purpose of this project is to serve as a substitute for tmuxinator, while still utilizing its yaml files.

tmuxinator, which is written in Ruby, has had instances of breaking due to updates in packages/gems, having me scrambling for a solution.

Furthermore, the process of installing it on different servers that lack a Ruby installation proved to be tedious.

Hence, rusmux was created. It served as a chance for me to:

  • Utilize the existing .yml project files from tmuxinator.
  • Generate a standalone binary that can be easily distributed.
  • Enhance my skills and comprehension of Rust and its associated tools.

Example

cat ~/.config/rusmux/demo.yml
project_name: demo  # can also use name
project_root: ~/src/demo
on_project_start:
  - sudo systemctl start postgresql
  - sudo systemctl start mysqld
# on_project_stop: 
pre_window:
  - workon demo
  - cd demo
windows:
  - editor: vim
  - shells:
      layout: main-vertical
      options:  # per window options
        main-pane-width: 60%
      panes:
        - #
        - grunt serve
        - remote-log: # name is meaningless, for multi commands
          - ssh [email protected]
          - cd /var/logs
          - tail -f project.log 
  - mail: python -m smtpd -n -c DebuggingServer localhost:1025

Install

  • Arch Linux users can install rusmux from AUR, e.g. (using paru):

    paru -S rusmux
    
  • Get a compiled binary from the Releases page and place it in your $PATH.

  • With cargo:

    cargo install rusmux
    
  • With shell script, for the specific version, see the release page, e.g:

    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/MeirKriheli/rusmux/releases/download/v0.x.y/rusmux-installer.sh | sh
    

Commands

  • Run a project

    rusmux run [project]
    rusmux start [project]
    
  • List all existing projects

    rusmux list
    
  • Output shell commands for a project

    rusmux debug [project]
    
  • Edit an existing project ($EDITOR should be set)

    rusmux edit [project]
    
  • Stop project's session

    rusmux stop [project]
    rusmux kill [project]
    
  • Delete an existing project (after confirmation)

    rusmux delete [project]
    
  • Create a new project, and open it in an editor ($EDITOR should be set)

    rusmux new [project]
    

    This creates the project from default template. To create one with just the project name:

    rusmux new [project] --blank
    
  • Copy an existing project to a new one and edit it ($EDITOR should be set)

    rusmux copy [existing] [new]
    
  • Check your environment for potential issues

    rusmux doctor
    

    Checks for tmux in $PATH and $SHELL & $EDITOR are set.

NOTE In the commands above, project, existing and new can be:

  • A simple name, like my_project, awesome_server, which will be created with a yaml extension in the config directory.
  • A path to a file (determined by an extension and/or path separator), e.g. ~/projects/my_project/session.yaml.

Dependencies

~8–19MB
~286K SLoC