]> git.proxmox.com Git - rustc.git/blob - src/tools/cargo/src/etc/man/cargo-login.1
New upstream version 1.74.1+dfsg1
[rustc.git] / src / tools / cargo / src / etc / man / cargo-login.1
1 '\" t
2 .TH "CARGO\-LOGIN" "1"
3 .nh
4 .ad l
5 .ss \n[.ss] 0
6 .SH "NAME"
7 cargo\-login \[em] Log in to a registry
8 .SH "SYNOPSIS"
9 \fBcargo login\fR [\fIoptions\fR] [\fItoken\fR] \[en] [\fIargs\fR]
10 .SH "DESCRIPTION"
11 This command will run a credential provider to save a token so that commands
12 that require authentication, such as \fBcargo\-publish\fR(1), will be
13 automatically authenticated.
14 .sp
15 For the default \fBcargo:token\fR credential provider, the token is saved
16 in \fB$CARGO_HOME/credentials.toml\fR\&. \fBCARGO_HOME\fR defaults to \fB\&.cargo\fR
17 in your home directory.
18 .sp
19 If a registry has a credential\-provider specified, it will be used. Otherwise,
20 the providers from the config value \fBregistry.global\-credential\-providers\fR will
21 be attempted, starting from the end of the list.
22 .sp
23 If the \fItoken\fR argument is not specified, it will be read from stdin.
24 .sp
25 The API token for crates.io may be retrieved from <https://crates.io/me>\&.
26 .sp
27 Take care to keep the token secret, it should not be shared with anyone else.
28 .SH "OPTIONS"
29 .SS "Login Options"
30 .sp
31 \fB\-\-registry\fR \fIregistry\fR
32 .RS 4
33 Name of the registry to use. Registry names are defined in \fICargo config
34 files\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&. If not specified, the default registry is used,
35 which is defined by the \fBregistry.default\fR config key which defaults to
36 \fBcrates\-io\fR\&.
37 .RE
38 .SS "Display Options"
39 .sp
40 \fB\-v\fR,
41 \fB\-\-verbose\fR
42 .RS 4
43 Use verbose output. May be specified twice for \[lq]very verbose\[rq] output which
44 includes extra output such as dependency warnings and build script output.
45 May also be specified with the \fBterm.verbose\fR
46 \fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
47 .RE
48 .sp
49 \fB\-q\fR,
50 \fB\-\-quiet\fR
51 .RS 4
52 Do not print cargo log messages.
53 May also be specified with the \fBterm.quiet\fR
54 \fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
55 .RE
56 .sp
57 \fB\-\-color\fR \fIwhen\fR
58 .RS 4
59 Control when colored output is used. Valid values:
60 .sp
61 .RS 4
62 \h'-04'\(bu\h'+02'\fBauto\fR (default): Automatically detect if color support is available on the
63 terminal.
64 .RE
65 .sp
66 .RS 4
67 \h'-04'\(bu\h'+02'\fBalways\fR: Always display colors.
68 .RE
69 .sp
70 .RS 4
71 \h'-04'\(bu\h'+02'\fBnever\fR: Never display colors.
72 .RE
73 .sp
74 May also be specified with the \fBterm.color\fR
75 \fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
76 .RE
77 .SS "Common Options"
78 .sp
79 \fB+\fR\fItoolchain\fR
80 .RS 4
81 If Cargo has been installed with rustup, and the first argument to \fBcargo\fR
82 begins with \fB+\fR, it will be interpreted as a rustup toolchain name (such
83 as \fB+stable\fR or \fB+nightly\fR).
84 See the \fIrustup documentation\fR <https://rust\-lang.github.io/rustup/overrides.html>
85 for more information about how toolchain overrides work.
86 .RE
87 .sp
88 \fB\-\-config\fR \fIKEY=VALUE\fR or \fIPATH\fR
89 .RS 4
90 Overrides a Cargo configuration value. The argument should be in TOML syntax of \fBKEY=VALUE\fR,
91 or provided as a path to an extra configuration file. This flag may be specified multiple times.
92 See the \fIcommand\-line overrides section\fR <https://doc.rust\-lang.org/cargo/reference/config.html#command\-line\-overrides> for more information.
93 .RE
94 .sp
95 \fB\-C\fR \fIPATH\fR
96 .RS 4
97 Changes the current working directory before executing any specified operations. This affects
98 things like where cargo looks by default for the project manifest (\fBCargo.toml\fR), as well as
99 the directories searched for discovering \fB\&.cargo/config.toml\fR, for example. This option must
100 appear before the command name, for example \fBcargo \-C path/to/my\-project build\fR\&.
101 .sp
102 This option is only available on the \fInightly
103 channel\fR <https://doc.rust\-lang.org/book/appendix\-07\-nightly\-rust.html> and
104 requires the \fB\-Z unstable\-options\fR flag to enable (see
105 \fI#10098\fR <https://github.com/rust\-lang/cargo/issues/10098>).
106 .RE
107 .sp
108 \fB\-h\fR,
109 \fB\-\-help\fR
110 .RS 4
111 Prints help information.
112 .RE
113 .sp
114 \fB\-Z\fR \fIflag\fR
115 .RS 4
116 Unstable (nightly\-only) flags to Cargo. Run \fBcargo \-Z help\fR for details.
117 .RE
118 .SH "ENVIRONMENT"
119 See \fIthe reference\fR <https://doc.rust\-lang.org/cargo/reference/environment\-variables.html> for
120 details on environment variables that Cargo reads.
121 .SH "EXIT STATUS"
122 .sp
123 .RS 4
124 \h'-04'\(bu\h'+02'\fB0\fR: Cargo succeeded.
125 .RE
126 .sp
127 .RS 4
128 \h'-04'\(bu\h'+02'\fB101\fR: Cargo failed to complete.
129 .RE
130 .SH "EXAMPLES"
131 .sp
132 .RS 4
133 \h'-04' 1.\h'+01'Save the token for the default registry:
134 .sp
135 .RS 4
136 .nf
137 cargo login
138 .fi
139 .RE
140 .RE
141 .sp
142 .RS 4
143 \h'-04' 2.\h'+01'Save the token for a specific registry:
144 .sp
145 .RS 4
146 .nf
147 cargo login \-\-registry my\-registry
148 .fi
149 .RE
150 .RE
151 .SH "SEE ALSO"
152 \fBcargo\fR(1), \fBcargo\-logout\fR(1), \fBcargo\-publish\fR(1)