Skip to content

Commit e06fe4e

Browse files
author
Chris Hunt
committed
Update README with new command line syntax
1 parent 5bb2fe7 commit e06fe4e

1 file changed

Lines changed: 51 additions & 34 deletions

File tree

README.md

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,45 @@ After you've [installed](#installation) `gh-auth`, you can give me ssh access
2323
with:
2424

2525
```bash
26-
$ gh-auth --add chrishunt
26+
$ gh-auth add --users=chrishunt
2727
Adding 2 key(s) to '/Users/chris/.ssh/authorized_keys'
2828
```
2929

3030
If you'd like me to automatically connect to your existing tmux session, you
3131
can do that with a custom ssh command:
3232

3333
```bash
34-
$ gh-auth --add chrishunt --command "tmux attach"
34+
$ gh-auth add --users=chrishunt --command="tmux attach"
3535
Adding 2 key(s) to '/Users/chris/.ssh/authorized_keys'
3636
```
3737

3838
That was easy! When we're done working, you can revoke my access with:
3939

4040
```bash
41-
$ gh-auth --remove chrishunt
41+
$ gh-auth remove --users=chrishunt
4242
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
4343
```
4444

4545
You can add and remove any number of users at the same time.
4646

4747
```bash
48-
$ gh-auth --add chrishunt,zachmargolis
48+
$ gh-auth add --users=chrishunt zachmargolis
4949
Adding 4 key(s) to '/Users/chris/.ssh/authorized_keys'
5050

51-
$ gh-auth --list
52-
Added users: chrishunt, zachmargolis
51+
$ gh-auth list
52+
chrishunt, zachmargolis
5353

54-
$ gh-auth --remove chrishunt
54+
$ gh-auth remove --users=chrishunt
5555
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
5656

57-
$ gh-auth --list
58-
Added users: zachmargolis
57+
$ gh-auth list
58+
zachmargolis
5959

60-
$ gh-auth --remove zachmargolis
60+
$ gh-auth remove --users=zachmargolis
6161
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
6262

63-
$ gh-auth --list
64-
Added users:
63+
$ gh-auth list
64+
6565
```
6666

6767
## Sections
@@ -89,14 +89,41 @@ Added users:
8989
`gh-auth` can be used from the command line after the gem has been installed.
9090

9191
```bash
92-
usage: gh-auth [--version] [--list] [--tmux] [--add|--remove] <username>
93-
94-
options:
95-
--add doug,sally Add GitHub users
96-
--remove doug,sally Remove GitHub users
97-
--list List all GitHub users added
98-
--tmux Attach user to tmux session
99-
--version Show version
92+
$ gh-auth
93+
Commands:
94+
gh-auth add --users=one two three # Add GitHub users to authorized keys
95+
gh-auth help [COMMAND] # Describe available commands or one specific command
96+
gh-auth list # List all GitHub users already added to authorized keys
97+
gh-auth remove --users=one two three # Remove GitHub users from authorized keys
98+
gh-auth version # Show gh-auth version
99+
100+
Options:
101+
[--host=HOST]
102+
[--path=PATH]
103+
```
104+
105+
Use the `help` command for help on a specific command.
106+
107+
```bash
108+
$ gh-auth help add
109+
Usage:
110+
gh-auth add --users=one two three
111+
112+
Options:
113+
--users=one two three
114+
[--command=COMMAND]
115+
[--host=HOST]
116+
[--path=PATH]
117+
118+
Description:
119+
`gh-auth add` is used to add one or more GitHub user's public SSH keys to ~/.ssh/authorized_keys. All keys stored on github.com for that user will be added.
120+
121+
> $ gh-auth add --users=chrishunt zachmargolis
122+
> Adding 6 key(s) to '/Users/chris/.ssh/authorized_keys'
123+
124+
By default, users will be granted normal shell access. If you'd like to specify an ssh command that should execute when the user connects, use the `--command` option.
125+
126+
> $ gh-auth add --users=chrishunt --command="tmux attach"
100127
```
101128

102129
### In Your Project
@@ -108,10 +135,10 @@ too.
108135
require 'github/auth'
109136

110137
# Add keys for GitHub user 'chrishunt'
111-
Github::Auth::CLI.new.execute %w(--add chrishunt)
138+
Github::Auth::CLI.start %w(add --users=chrishunt)
112139

113140
# Remove keys for GitHub user 'chrishunt'
114-
Github::Auth::CLI.new.execute %w(--remove chrishunt)
141+
Github::Auth::CLI.start %w(remove --users=chrishunt)
115142
```
116143

117144
## Installation
@@ -120,16 +147,6 @@ Install the `github-auth` gem:
120147

121148
```bash
122149
$ gem install github-auth
123-
124-
$ gh-auth
125-
usage: gh-auth [--version] [--list] [--tmux] [--add|--remove] <username>
126-
127-
options:
128-
--add doug,sally Add GitHub users
129-
--remove doug,sally Remove GitHub users
130-
--list List all GitHub users added
131-
--tmux Attach user to tmux session
132-
--version Show version
133150
```
134151

135152
### SSH Public Key Authentication (Mac OS X)
@@ -157,7 +174,7 @@ First, authorize yourself for ssh. (Make sure to replace 'chrishunt' with
157174
*your* GitHub username)
158175

159176
```bash
160-
$ gh-auth --add chrishunt
177+
$ gh-auth add --users=chrishunt
161178
Adding 2 key(s) to '/Users/chris/.ssh/authorized_keys'
162179
```
163180

@@ -173,7 +190,7 @@ $ ssh -o PreferredAuthentications=publickey localhost
173190
Next, remove your public keys from the keys file:
174191

175192
```bash
176-
$ gh-auth --remove chrishunt
193+
$ gh-auth remove --users=chrishunt
177194
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
178195
```
179196

0 commit comments

Comments
 (0)