Skip to content

Commit 8905929

Browse files
committed
Describe multiple tmux sessions within a single config file and have
dependencies between them.
1 parent 4a06096 commit 8905929

File tree

4 files changed

+246
-158
lines changed

4 files changed

+246
-158
lines changed

README.md

Lines changed: 69 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,24 @@ You create YAML config files that detail what windows and panes should be create
1515

1616
### example.yml
1717
```yaml
18-
name: example
1918
dir: ~/project
20-
windows:
21-
22-
# Start a database
23-
- name: database
24-
panes:
25-
- cmd: service postgresql start
26-
readycheck:
27-
test: pg_isready -h localhost -p 5432 -U postgres
28-
interval: 3s
29-
retries: 3
30-
31-
# Run a program that must start after the database is ready
32-
- panes:
33-
- cmd: ./myprogram
34-
depends_on: ["database"]
19+
sessions:
20+
- name: example
21+
windows:
22+
23+
# Start a database
24+
- name: database
25+
panes:
26+
- cmd: service postgresql start
27+
readycheck:
28+
test: pg_isready -h localhost -p 5432 -U postgres
29+
interval: 3s
30+
retries: 3
31+
32+
# Run a program that must start after the database is ready
33+
- panes:
34+
- cmd: ./myprogram
35+
depends_on: ["database"]
3536
```
3637
3738
Bring up a tmux session:
@@ -46,7 +47,7 @@ tmux-compose -f example.yml down
4647

4748
### Installation
4849

49-
tmux-compose was built with Go. If you already have Go setup, you can just:
50+
tmux-compose was built with Go. If you already have Go setup, you `go get` the utility:
5051

5152
```bash
5253
go get github.com/kevinms/tmux-compose.git
@@ -60,55 +61,77 @@ cd tmux-compose
6061
go install
6162
```
6263

63-
Go code can easily compile for other OSes, but I have only tested running it in Linux.
64+
Go code can easily compile for other OSes, but this has only been tested on Linux.
6465

6566
### Project
6667
Example showing all options for the root node of the config file
6768
```yaml
68-
name: example
6969
dir: /path/to/project
7070
up_pre_cmd: (date; echo start) > run.log
7171
up_post_cmd: (date; echo done) >> run.log
7272
down_pre_cmd: touch example.tmp
7373
down_post_cmd: rm example.tmp
74-
windows:
75-
- name: code
76-
panes:
77-
- cmd: vim
78-
- panes:
79-
- cmd: top
74+
sessions:
75+
- name: example
76+
windows:
77+
- name: code
78+
panes:
79+
- cmd: vim
80+
- panes:
81+
- cmd: top
8082
```
8183
82-
### Windows
84+
### Sessions
8385
Example showing all options being used for a window:
8486
```yaml
85-
name: example
86-
windows:
87-
- name: My Window
87+
sessions:
88+
- name: example
8889
dir: ~/project
89-
focus: true
90-
layout: main-vertical
90+
readycheck:
91+
test: ping -c1 domain.net
92+
interval: 3s
93+
retries: 10
9194
depends_on: ["thing1", "thing2"]
92-
panes:
93-
- cmd: vim
94-
- cmd: sleep 5
95+
windows:
96+
- name: code
97+
panes:
98+
- cmd: vim
99+
- panes:
100+
- cmd: top
101+
```
102+
103+
### Windows
104+
Example showing all options being used for a window:
105+
```yaml
106+
sessions:
107+
- name: example
108+
windows:
109+
- name: My Window
110+
dir: ~/project
111+
focus: true
112+
layout: main-vertical
113+
depends_on: ["thing1", "thing2"]
114+
panes:
115+
- cmd: vim
116+
- cmd: sleep 5
95117
```
96118
97119
### Panes
98120
Example showing all options being used for a pane:
99121
```yaml
100-
name: example
101-
windows:
102-
- panes:
103-
- name: My Pane
104-
dir: ~/project
105-
cmd: python -m SimpleHTTPServer 8000
106-
focus: true
107-
readycheck:
108-
test: ping -c1 domain.net
109-
interval: 3s
110-
retries: 10
111-
depends_on: ["thing1", "thing2"]
122+
sessions:
123+
- name: example
124+
windows:
125+
- panes:
126+
- name: My Pane
127+
dir: ~/project
128+
cmd: python -m SimpleHTTPServer 8000
129+
focus: true
130+
readycheck:
131+
test: ping -c1 domain.net
132+
interval: 3s
133+
retries: 10
134+
depends_on: ["thing1", "thing2"]
112135
```
113136
114137
#### Directly Inspired By:

0 commit comments

Comments
 (0)