1CARGO-LOGIN(1) General Commands Manual CARGO-LOGIN(1)
2
3
4
6 cargo-login - Save an API token from the registry locally
7
9 cargo login [options] [token]
10
12 This command will save the API token to disk so that commands that
13 require authentication, such as cargo-publish(1), will be automatically
14 authenticated. The token is saved in $CARGO_HOME/credentials.toml.
15 CARGO_HOME defaults to .cargo in your home directory.
16
17 If the token argument is not specified, it will be read from stdin.
18
19 The API token for crates.io may be retrieved from
20 <https://crates.io/me>.
21
22 Take care to keep the token secret, it should not be shared with anyone
23 else.
24
26 Login Options
27 --registry registry
28 Name of the registry to use. Registry names are defined in Cargo
29 config files
30 <https://doc.rust-lang.org/cargo/reference/config.html>. If not
31 specified, the default registry is used, which is defined by the
32 registry.default config key which defaults to crates-io.
33
34 Display Options
35 -v, --verbose
36 Use verbose output. May be specified twice for "very verbose"
37 output which includes extra output such as dependency warnings and
38 build script output. May also be specified with the term.verbose
39 config value
40 <https://doc.rust-lang.org/cargo/reference/config.html>.
41
42 -q, --quiet
43 Do not print cargo log messages. May also be specified with the
44 term.quiet config value
45 <https://doc.rust-lang.org/cargo/reference/config.html>.
46
47 --color when
48 Control when colored output is used. Valid values:
49
50 • auto (default): Automatically detect if color support is
51 available on the terminal.
52
53 • always: Always display colors.
54
55 • never: Never display colors.
56
57 May also be specified with the term.color config value
58 <https://doc.rust-lang.org/cargo/reference/config.html>.
59
60 Common Options
61 +toolchain
62 If Cargo has been installed with rustup, and the first argument to
63 cargo begins with +, it will be interpreted as a rustup toolchain
64 name (such as +stable or +nightly). See the rustup documentation
65 <https://rust-lang.github.io/rustup/overrides.html> for more
66 information about how toolchain overrides work.
67
68 -h, --help
69 Prints help information.
70
71 -Z flag
72 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
73 details.
74
76 See the reference
77 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
78 for details on environment variables that Cargo reads.
79
81 • 0: Cargo succeeded.
82
83 • 101: Cargo failed to complete.
84
86 1. Save the API token to disk:
87
88 cargo login
89
91 cargo(1), cargo-publish(1)
92
93
94
95 CARGO-LOGIN(1)