1CARGO-LOGIN(1)              General Commands Manual             CARGO-LOGIN(1)
2
3
4

NAME

6       cargo-login - Save an API token from the registry locally
7

SYNOPSIS

9       cargo login [options] [token]
10

DESCRIPTION

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

OPTIONS

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           No output printed to stdout.
44
45       --color when
46           Control when colored output is used. Valid values:
47
48           ·  auto (default): Automatically detect if color support is
49               available on the terminal.
50
51           ·  always: Always display colors.
52
53           ·  never: Never display colors.
54
55           May also be specified with the term.color config value
56           <https://doc.rust-lang.org/cargo/reference/config.html>.
57
58   Common Options
59       +toolchain
60           If Cargo has been installed with rustup, and the first argument to
61           cargo begins with +, it will be interpreted as a rustup toolchain
62           name (such as +stable or +nightly). See the rustup documentation
63           <https://rust-lang.github.io/rustup/overrides.html> for more
64           information about how toolchain overrides work.
65
66       -h, --help
67           Prints help information.
68
69       -Z flag
70           Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
71           details.
72

ENVIRONMENT

74       See the reference
75       <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
76       for details on environment variables that Cargo reads.
77

EXIT STATUS

79       ·  0: Cargo succeeded.
80
81       ·  101: Cargo failed to complete.
82

EXAMPLES

84        1. Save the API token to disk:
85
86               cargo login
87

SEE ALSO

89       cargo(1), cargo-publish(1)
90
91
92
93                                                                CARGO-LOGIN(1)
Impressum