├── LICENSE ├── README.adoc ├── even-vertical.png ├── tiled.png └── toreman /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Phil Pirozhkov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = Toreman 2 | 3 | Toreman is a one'ish-line shell script https://github.com/ddollar/foreman[foreman] clone that is running processes in separate https://github.com/tmux/tmux[tmux] panes. 4 | 5 | With tmux, interleaved output, and interactive debugging are not a problem anymore. 6 | 7 | It's also possible to selectively stop/restart processes. 8 | 9 | image::tiled.png[] 10 | 11 | == Usage 12 | 13 | In a running tmux session, from a directory containing `Procfile`, run `toreman`. 14 | It will parse your `Procfile` and run each entry in a separate split. 15 | 16 | Use C-b h/j to navigate between panes, and C-b z to toggle full-screen zoom. 17 | 18 | It's possible to specify a layout as a first argument to `toreman`, e.g. 19 | 20 | [source,shell] 21 | ---- 22 | toreman even-vertical 23 | ---- 24 | 25 | image::even-vertical.png[] 26 | 27 | Available layouts are: `even-horizontal`, `even-vertical`, `main-horizontal`, `main-vertical`, `tiled` (default). 28 | 29 | == Installation 30 | 31 | If you're on macOS and are using https://brew.sh/[Homebrew], it's as easy as: 32 | 33 | [source,shell] 34 | ---- 35 | brew install pirj/homebrew-toreman/toreman 36 | ---- 37 | 38 | Otherwise, drop the `toreman` binary somewhere on your `$PATH`, or add an alias in your `rc` file: 39 | 40 | [source,shell] 41 | ---- 42 | alias toreman="grep --invert-match '#' < Procfile | sed -e 's/^[^:]*: //' | xargs -I {} tmux split-window -v \; send-keys '[ -s .env ] && source .env; {}' 'C-m' && tmux select-pane -t 1 \; send-keys 'C-d' \; select-layout ${1:-tiled}" 43 | ---- 44 | 45 | == Alternatives 46 | 47 | Check out https://github.com/DarthSim/overmind[overmind] if you prefer 1600 lines of Go over one line of shell script, or other https://github.com/ddollar/foreman#ports[Foreman ports]. 48 | 49 | == Resources 50 | 51 | https://fili.pp.ru/oneline-procfile-manager.html[Blog post]. 52 | 53 | https://www.reddit.com/r/ruby/comments/bpka4m/toreman_a_oneline_foreman_port_for_use_with_tmux/[Reddit thread]. 54 | 55 | == Author 56 | 57 | https://fili.pp.ru[Phil Pirozhkov], software developer in law. 58 | 59 | == License 60 | 61 | Toreman is licensed under MIT License. 62 | -------------------------------------------------------------------------------- /even-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pirj/toreman/1a201a3f2fb325c172279f481fd3e5cc103c239d/even-vertical.png -------------------------------------------------------------------------------- /tiled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pirj/toreman/1a201a3f2fb325c172279f481fd3e5cc103c239d/tiled.png -------------------------------------------------------------------------------- /toreman: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | grep --invert-match '^#' < Procfile | 4 | sed -e 's/^[^:]*: //' | 5 | xargs -I {} \ 6 | tmux \ 7 | split-window -v \; \ 8 | send-keys '[ -s .env ] && source .env; {}' 'C-m' && 9 | tmux \ 10 | select-pane -t 1 \; \ 11 | send-keys 'C-d' \; \ 12 | select-layout ${1:-tiled} 13 | --------------------------------------------------------------------------------