Muxify
Sets up consistent tmux development environment for projects.
Why?
- Saves time and effort switching projects.
- Ensures consistent layout which is faster to navigate via muscle memory.
- Avoids visual and mental overhead of maintaining numerous tabs.
Dependencies
- MacOS (may work on Linux)
- Ruby
- Tmux (
which tmux || brew install tmux)
Installation
$ gem install muxify
Usage
$ muxify -h
Commands:
muxify add # Adds tmuxinator config for current (or supplied) path
muxify debug # Prints tmuxinator config of current (or supplied) path to stdout
muxify help [COMMAND] # Describe available commands or one specific command
muxify stop # Kills tmux session
For example, add a project like so:
$ muxify add /path/to/my_app
$ mux my_app
Depending on its type, this will create the following tmux windows for a project:
- Standard (applies to all projects)
- shell (performs
git fetchwhen.gitis present) - editor (invokes terminal editor, defaulting to
vimwhen$EDITORis unset) - logs (when present, truncates then tails
log/*.log)
- shell (performs
- Rails (identified by presence of
bin/rails)- db (
rails db) - console (
rails console) - server (configures puma-dev then
rails server; see code)
- db (
- NodeJS (identified by presence of
package.jsonwhen non-Rails)- console (
node)
- console (
- Elixir (identified by presence of
mix.exswhen non-Phoenix)- console (
iex -S mix) - server (
mix)
- console (
- Elixir/Phoenix (identified by presence of
deps/phoenix)- console (
iex -S mix phoenix.server) - server (
mix phoenix.server)
- console (
- Django (identified by
requirements.txtcontainingdjango)- db (
python manage.py dbshell) - console (
python manage.py shell) - server (
python manage.py runserver)
- db (
Customising projects
To add a custom tmux window for a project:
- Create a file called
~/.muxifyrc. - Edit it in YAML format; eg to add a tmux window to
my_appproject which is namedserverand invokesyarn dev:
my_app:
windows:
server: yarn dev
Thanks
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/zubin/muxify.