]> git.proxmox.com Git - rustc.git/blob - src/tools/cargo/src/doc/man/cargo-login.md
New upstream version 1.70.0+dfsg2
[rustc.git] / src / tools / cargo / src / doc / man / cargo-login.md
1 # cargo-login(1)
2
3 ## NAME
4
5 cargo-login --- Save an API token from the registry locally
6
7 ## SYNOPSIS
8
9 `cargo login` [_options_] [_token_]
10
11 ## DESCRIPTION
12
13 This command will save the API token to disk so that commands that require
14 authentication, such as {{man "cargo-publish" 1}}, will be automatically
15 authenticated. The token is saved in `$CARGO_HOME/credentials.toml`. `CARGO_HOME`
16 defaults to `.cargo` in your home directory.
17
18 If the _token_ argument is not specified, it will be read from stdin.
19
20 The API token for crates.io may be retrieved from <https://crates.io/me>.
21
22 Take care to keep the token secret, it should not be shared with anyone else.
23
24 ## OPTIONS
25
26 ### Login Options
27
28 {{#options}}
29 {{> options-registry }}
30 {{/options}}
31
32 ### Display Options
33
34 {{#options}}
35 {{> options-display }}
36 {{/options}}
37
38 {{> section-options-common }}
39
40 {{> section-environment }}
41
42 {{> section-exit-status }}
43
44 ## EXAMPLES
45
46 1. Save the API token to disk:
47
48 cargo login
49
50 ## SEE ALSO
51 {{man "cargo" 1}}, {{man "cargo-logout" 1}}, {{man "cargo-publish" 1}}