Skip to content

Commit

Permalink
add commands to readme. closes #40.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradgarropy committed Jan 4, 2020
1 parent 41fbfc1 commit c3f82af
Showing 1 changed file with 84 additions and 9 deletions.
93 changes: 84 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,100 @@ npm install labman --global
If you have `labman` installed globally you can run it as shown below.

```
labman login <username> <token>
labman <source> <destination>
labman --help
```

Where `token` is a GitHub [personal access token][token] with `repo` scope.
Where `source` and `destination` are GitHub repositories in the form of `owner/repo`.
Alternatively, you can run it with [`npx`][npx].

```
npx labman --help
```

## 👨🏼‍🏫 Commands

### `login`

Validates and stores your GitHub [personal access token][token].

#### Options

| Name | Description | Default |
| --------------- | -------------------------------------------------------- | ------- |
| `username` | GitHub username. | |
| `token` | GitHub [personal access token][token] with `repo` scope. | |
| `--force`, `-f` | Overwrite existing login. | `false` |

#### Examples

Login as `bradgarropy` with a [personal access token][token].

```
labman login bradgarropy 123456
```

Login as `gabygarropy`, overwriting the `bradgarropy` login.

```
labman login gabygarropy 456789
```

### `default`

Copies labels from one repository to another.

The `source` and `destination` can be provided in two ways.

Here is an example.
- `owner/repo`, like `bradgarropy/labman-cli`
- `repo`, like `labman-cli`

If an `owner` is not specified, `labman` will assume the `username` you provided during `login`.

If `labels` is not provided, `labman` will copy all labels from `source` to `destination`.

#### Options

| Name | Description | Default |
| ----------------- | -------------------------------------------------------------------- | ------- |
| `source` | GitHub repository. | |
| `destination` | GitHub repository. | |
| `labels` | Space separated list of label names to copy. | `[]` |
| `--clobber`, `-c` | Remove all labels from `destination` before copying `source` labels. | `false` |

#### Examples

Copy all labels from `bradgarropy/label-source` to `bradgarropy/label-destination`.

```
labman login bradgarropy 1234abcd
labman bradgarropy/label-source bradgarropy/label-destination
```

Alternatively, you can run it with [`npx`][npx].
Delete all labels from `bradgarropy/label-destionation`, then copy all labels from `bradgarropy/label-source` to `bradgarropy/label-destination`.

```
labman bradgarropy/label-source bradgarropy/label-destination --clobber
```

Copy only the `bug` and `todo` labels from `bradgarropy/label-source` to `bradgarropy/label-destination`.

```
labman bradgarropy/label-source bradgarropy/label-destination bug todo
```

Use the shorthand method for providing `source` and `destination` repositories.

```
labman login bradgarropy 123456
labman label-source label-destination
```

### `logout`

Removes your GitHub [personal access token][token].

#### Examples

```
npx labman login <username> <token>
npx labman <source> <destination>
labman logout
```

## ❔ Questions
Expand Down

0 comments on commit c3f82af

Please sign in to comment.