|
2 | 2 |
|
3 | 3 | A Cargo [credential provider] for [1password].
|
4 | 4 |
|
5 |
| -`cargo-credential-1password` uses the 1password `op` CLI to store the token. You must |
6 |
| -install the `op` CLI from the [1password |
7 |
| -website](https://1password.com/downloads/command-line/). You must run `op signin` |
8 |
| -at least once with the appropriate arguments (such as `op signin my.1password.com [email protected]`), |
9 |
| -unless you provide the sign-in-address and email arguments. The master password will be required on each request |
10 |
| -unless the appropriate `OP_SESSION` environment variable is set. It supports |
11 |
| -the following command-line arguments: |
12 |
| -* `--account`: The account shorthand name to use. |
13 |
| -* `--vault`: The vault name to use. |
14 |
| -* `--sign-in-address`: The sign-in-address, which is a web address such as `my.1password.com`. |
15 |
| -* `--email`: The email address to sign in with. |
| 5 | +## Usage |
| 6 | + |
| 7 | +`cargo-credential-1password` uses the 1password `op` CLI to store the token. You |
| 8 | +must install the `op` CLI from the [1password |
| 9 | +website](https://1password.com/downloads/command-line/). |
| 10 | + |
| 11 | +Afterward you need to configure `cargo` to use `cargo-credential-1password` as |
| 12 | +the credential provider. You can do this by adding something like the following |
| 13 | +to your [cargo config file][credential provider]: |
| 14 | + |
| 15 | +```toml |
| 16 | +[registry] |
| 17 | +global-credential-providers = ["cargo-credential-1password --account my.1password.com"] |
| 18 | +``` |
| 19 | + |
| 20 | +Finally, run `cargo login` to save your registry token in 1password. |
| 21 | + |
| 22 | +## CLI Arguments |
| 23 | + |
| 24 | +`cargo-credential-1password` supports the following command-line arguments: |
| 25 | + |
| 26 | +* `--account`: The account name to use. For a list of available accounts, |
| 27 | + run `op account list`. |
| 28 | +* `--vault`: The vault name to use. For a list of available vaults, |
| 29 | + run `op vault list`. |
16 | 30 |
|
17 | 31 | [1password]: https://1password.com/
|
18 |
| -[credential provider]: https://doc.rust-lang.org/nightly/cargo/reference/registry-authentication.html |
| 32 | +[credential provider]: https://doc.rust-lang.org/stable/cargo/reference/registry-authentication.html |
0 commit comments