Skip to content

Commit 61eb942

Browse files
committed
a bit more documentation
1 parent 9612b18 commit 61eb942

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

README.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ brew install sshfs
6969
## Getting started
7070
After installing, create a configuration file by running
7171
```bash
72-
bridgy init
72+
$ bridgy init
7373
```
7474
This will create a default `~/.bridgy/config.yml` file for you. From there you need to configure inventory sources and other options:
7575

7676
```yaml
7777
config-schema: 2
7878
inventory:
79-
8079
source:
8180

8281
- type: csv
8382
name: on-site servers
83+
# CSV files are placed in ~/.bridgy/inventory/csv
8484
file: somefile.csv
8585
# requires at least name and address
8686
fields: name, address
@@ -101,7 +101,11 @@ ssh:
101101
```
102102
Now you can ssh into a system referenced from the given inventory sources:
103103
```bash
104-
bridgy ssh someserver
104+
# without tmux
105+
$ bridgy ssh someserver
106+
107+
# with tmux (or set the ssh.tmux=true config option to always use tmux)
108+
$ bridgy ssh -t someserver
105109
```
106110
That's just to get you started, there is plenty more you can do though!
107111

@@ -239,6 +243,7 @@ inventory:
239243
# Example with a CSV
240244
- type: csv
241245
name: On-site
246+
# CSV files are placed in ~/.bridgy/inventory/csv
242247
file: primary-site.csv
243248
delimiter: '|'
244249
# requires at least name and address
@@ -278,21 +283,35 @@ inventory:
278283
# define ssh behavior and preferences
279284
ssh:
280285
user: awesome-user
286+
# Any valid ssh cli options you would specify to SSH (optional)
281287
options: -C -o ServerAliveInterval=255
288+
# Run a command upon logging into any host (optional)
282289
command: sudo -i su - another_user -s /bin/bash
283-
tmux: false
290+
# Use Tmux to wrap all ssh sessions (optional)
291+
tmux: true
284292
293+
294+
# This specifies any SSHFS options for mounting remote directories
285295
sshfs:
296+
# Any sshfs option that you would specify to sshfs (optional)
297+
# Tip: if you need to be another user on the remote system you can do so via sudo:
298+
# options: -o sftp_server="/usr/bin/sudo /usr/lib/openssh/sftp-server"
286299
options: -o auto_cache,reconnect,no_readahead -C -o TCPKeepAlive=yes -o ServerAliveInterval=255 -o StrictHostKeyChecking=no
287300
288301
# configure your bastion here if it applies to all of your inventory sources
289302
bastion:
290-
user: jump-username
291-
address: kiwibox
303+
# User to use when SSHing into the bastion host (optional)
304+
user: johnybgoode
305+
# Address of the bastion host
306+
address: zest
307+
# Any valid cli options you would specify to SSH (optional)
292308
options: -C -o ServerAliveInterval=255
293309
294-
# define tmux layouts and (optional) canned commands
310+
295311
tmux:
312+
# You can make multiple panes to a single host by specifying a layout definition. Simply
313+
# define each tmux command to run and an optional command to run in that pane.
314+
# Use these layouts by name with the -l cli option (bridgy ssh -l somename host...)
296315
layout:
297316
# bridgy ssh -l example host...
298317
example:
@@ -332,6 +351,7 @@ run:
332351

333352
## Usage
334353
```
354+
bridgy init
335355
bridgy ssh (-t | --tmux) [-adsuvw] [-l LAYOUT] <host>...
336356
bridgy ssh [-duv] <host>
337357
bridgy list-inventory
@@ -344,6 +364,7 @@ run:
344364
bridgy --version
345365

346366
Sub-commands:
367+
init create the ~/.bridgy/config.yml
347368
ssh ssh into the selected host(s)
348369
mount use sshfs to mount a remote directory to an empty local directory
349370
unmount unmount one or more host sshfs mounts

bridgy/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
bridgy --version
2020
2121
Sub-commands:
22+
init create the ~/.bridgy/config.yml
2223
ssh ssh into the selected host(s)
2324
mount use sshfs to mount a remote directory to an empty local directory
2425
unmount unmount one or more host sshfs mounts

0 commit comments

Comments
 (0)