|
| 1 | +# cargo-logout(1) |
| 2 | + |
| 3 | +## NAME |
| 4 | + |
| 5 | +cargo-logout --- Remove an API token from the registry locally |
| 6 | + |
| 7 | +## SYNOPSIS |
| 8 | + |
| 9 | +`cargo logout` [_options_] |
| 10 | + |
| 11 | +## DESCRIPTION |
| 12 | + |
| 13 | +This command will remove the API token from the local credential storage. |
| 14 | +Credentials are stored in `$CARGO_HOME/credentials.toml` where `$CARGO_HOME` |
| 15 | +defaults to `.cargo` in your home directory. |
| 16 | + |
| 17 | +If `--registry` is not specified, then the credentials for the default |
| 18 | +registry will be removed (configured by |
| 19 | +[`registry.default`](../reference/config.html#registrydefault), which defaults |
| 20 | +to <https://crates.io/>). |
| 21 | + |
| 22 | +This will not revoke the token on the server. If you need to revoke the token, |
| 23 | +visit the registry website and follow its instructions (see |
| 24 | +<https://crates.io/me> to revoke the token for <https://crates.io/>). |
| 25 | + |
| 26 | +## OPTIONS |
| 27 | + |
| 28 | +### Logout Options |
| 29 | + |
| 30 | +<dl> |
| 31 | +<dt class="option-term" id="option-cargo-logout---registry"><a class="option-anchor" href="#option-cargo-logout---registry"></a><code>--registry</code> <em>registry</em></dt> |
| 32 | +<dd class="option-desc">Name of the registry to use. Registry names are defined in <a href="../reference/config.html">Cargo config |
| 33 | +files</a>. If not specified, the default registry is used, |
| 34 | +which is defined by the <code>registry.default</code> config key which defaults to |
| 35 | +<code>crates-io</code>.</dd> |
| 36 | + |
| 37 | + |
| 38 | +</dl> |
| 39 | + |
| 40 | +### Display Options |
| 41 | + |
| 42 | +<dl> |
| 43 | +<dt class="option-term" id="option-cargo-logout--v"><a class="option-anchor" href="#option-cargo-logout--v"></a><code>-v</code></dt> |
| 44 | +<dt class="option-term" id="option-cargo-logout---verbose"><a class="option-anchor" href="#option-cargo-logout---verbose"></a><code>--verbose</code></dt> |
| 45 | +<dd class="option-desc">Use verbose output. May be specified twice for “very verbose” output which |
| 46 | +includes extra output such as dependency warnings and build script output. |
| 47 | +May also be specified with the <code>term.verbose</code> |
| 48 | +<a href="../reference/config.html">config value</a>.</dd> |
| 49 | + |
| 50 | + |
| 51 | +<dt class="option-term" id="option-cargo-logout--q"><a class="option-anchor" href="#option-cargo-logout--q"></a><code>-q</code></dt> |
| 52 | +<dt class="option-term" id="option-cargo-logout---quiet"><a class="option-anchor" href="#option-cargo-logout---quiet"></a><code>--quiet</code></dt> |
| 53 | +<dd class="option-desc">Do not print cargo log messages. |
| 54 | +May also be specified with the <code>term.quiet</code> |
| 55 | +<a href="../reference/config.html">config value</a>.</dd> |
| 56 | + |
| 57 | + |
| 58 | +<dt class="option-term" id="option-cargo-logout---color"><a class="option-anchor" href="#option-cargo-logout---color"></a><code>--color</code> <em>when</em></dt> |
| 59 | +<dd class="option-desc">Control when colored output is used. Valid values:</p> |
| 60 | +<ul> |
| 61 | +<li><code>auto</code> (default): Automatically detect if color support is available on the |
| 62 | +terminal.</li> |
| 63 | +<li><code>always</code>: Always display colors.</li> |
| 64 | +<li><code>never</code>: Never display colors.</li> |
| 65 | +</ul> |
| 66 | +<p>May also be specified with the <code>term.color</code> |
| 67 | +<a href="../reference/config.html">config value</a>.</dd> |
| 68 | + |
| 69 | + |
| 70 | +</dl> |
| 71 | + |
| 72 | +### Common Options |
| 73 | + |
| 74 | +<dl> |
| 75 | + |
| 76 | +<dt class="option-term" id="option-cargo-logout-+toolchain"><a class="option-anchor" href="#option-cargo-logout-+toolchain"></a><code>+</code><em>toolchain</em></dt> |
| 77 | +<dd class="option-desc">If Cargo has been installed with rustup, and the first argument to <code>cargo</code> |
| 78 | +begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such |
| 79 | +as <code>+stable</code> or <code>+nightly</code>). |
| 80 | +See the <a href="https://rust-lang.github.io/rustup/overrides.html">rustup documentation</a> |
| 81 | +for more information about how toolchain overrides work.</dd> |
| 82 | + |
| 83 | + |
| 84 | +<dt class="option-term" id="option-cargo-logout---config"><a class="option-anchor" href="#option-cargo-logout---config"></a><code>--config</code> <em>KEY=VALUE</em> or <em>PATH</em></dt> |
| 85 | +<dd class="option-desc">Overrides a Cargo configuration value. The argument should be in TOML syntax of <code>KEY=VALUE</code>, |
| 86 | +or provided as a path to an extra configuration file. This flag may be specified multiple times. |
| 87 | +See the <a href="../reference/config.html#command-line-overrides">command-line overrides section</a> for more information.</dd> |
| 88 | + |
| 89 | + |
| 90 | +<dt class="option-term" id="option-cargo-logout--C"><a class="option-anchor" href="#option-cargo-logout--C"></a><code>-C</code> <em>PATH</em></dt> |
| 91 | +<dd class="option-desc">Changes the current working directory before executing any specified operations. This affects |
| 92 | +things like where cargo looks by default for the project manifest (<code>Cargo.toml</code>), as well as |
| 93 | +the directories searched for discovering <code>.cargo/config.toml</code>, for example. This option must |
| 94 | +appear before the command name, for example <code>cargo -C path/to/my-project build</code>.</p> |
| 95 | +<p>This option is only available on the <a href="https://doc.rust-lang.org/book/appendix-07-nightly-rust.html">nightly |
| 96 | +channel</a> and |
| 97 | +requires the <code>-Z unstable-options</code> flag to enable (see |
| 98 | +<a href="https://github.com/rust-lang/cargo/issues/10098">#10098</a>).</dd> |
| 99 | + |
| 100 | + |
| 101 | +<dt class="option-term" id="option-cargo-logout--h"><a class="option-anchor" href="#option-cargo-logout--h"></a><code>-h</code></dt> |
| 102 | +<dt class="option-term" id="option-cargo-logout---help"><a class="option-anchor" href="#option-cargo-logout---help"></a><code>--help</code></dt> |
| 103 | +<dd class="option-desc">Prints help information.</dd> |
| 104 | + |
| 105 | + |
| 106 | +<dt class="option-term" id="option-cargo-logout--Z"><a class="option-anchor" href="#option-cargo-logout--Z"></a><code>-Z</code> <em>flag</em></dt> |
| 107 | +<dd class="option-desc">Unstable (nightly-only) flags to Cargo. Run <code>cargo -Z help</code> for details.</dd> |
| 108 | + |
| 109 | + |
| 110 | +</dl> |
| 111 | + |
| 112 | + |
| 113 | +## ENVIRONMENT |
| 114 | + |
| 115 | +See [the reference](../reference/environment-variables.html) for |
| 116 | +details on environment variables that Cargo reads. |
| 117 | + |
| 118 | + |
| 119 | +## EXIT STATUS |
| 120 | + |
| 121 | +* `0`: Cargo succeeded. |
| 122 | +* `101`: Cargo failed to complete. |
| 123 | + |
| 124 | + |
| 125 | +## EXAMPLES |
| 126 | + |
| 127 | +1. Remove the default registry token: |
| 128 | + |
| 129 | + cargo logout |
| 130 | + |
| 131 | +2. Remove the token for a specific registry: |
| 132 | + |
| 133 | + cargo logout --registry my-registry |
| 134 | + |
| 135 | +## SEE ALSO |
| 136 | +[cargo(1)](cargo.html), [cargo-login(1)](cargo-login.html) |
0 commit comments