CARGO-LOGOUT(1)
π CARGO-LOGOUT(1) π
okay bestie, welcome to the cargo-logout page β it lives in the General Commands Manual and it's genuinely one of the chillest little commands in the whole cargo family. no cap.
β¨ NAME β¨
cargo-logout β Remove an API token from the registry locally
πΈ SYNOPSIS πΈ
cargo logout [options]
π¦ DESCRIPTION π¦
so what does this actually do? it runs a credential provider to remove a saved token. that's the whole vibe. π
for the default cargo:token credential provider, your credentials are stored in $CARGO_HOME/credentials.toml β and $CARGO_HOME defaults to .cargo in your home directory, iykyk.
if a registry has a credential-provider specified, that one gets used. otherwise, the providers from the config value registry.global-credential-providers will be attempted, starting from the end of the list. yes, from the end. that's not a typo, that's just how it goes.
if --registry is not specified, then the credentials for the default registry get removed β that's configured by registry.default (https://doc.rust-lang.org/cargo/reference/config.html#registrydefault), which defaults to https://crates.io/.
β οΈ ok important one, listen up: this will not revoke the token on the server. like, it's gone from your machine but it is still out there living its life. if you actually need to revoke it, go visit the registry website and follow its instructions β see https://crates.io/me to revoke the token for https://crates.io/. π«Ά
π OPTIONS π
π Logout Options π
--registryregistry β name of the registry to use. registry names are defined in Cargo config files (https://doc.rust-lang.org/cargo/reference/config.html). if you don't specify it, the default registry is used, which is defined by theregistry.defaultconfig key β and that defaults tocrates-io.
π Display Options π
-v,--verboseβ use verbose output. you can specify it twice for "very verbose" output, which includes extra output like dependency warnings and build script output. may also be specified with theterm.verboseconfig value (https://doc.rust-lang.org/cargo/reference/config.html).-q,--quietβ do not print cargo log messages. may also be specified with theterm.quietconfig value (https://doc.rust-lang.org/cargo/reference/config.html).--colorwhen β control when colored output is used. valid values are:auto(default): automatically detect if color support is available on the terminal.always: always display colors.never: never display colors.
may also be specified with the term.color config value (https://doc.rust-lang.org/cargo/reference/config.html).
β Common Options β
+toolchainβ if Cargo has been installed with rustup, and the first argument tocargobegins with+, it will be interpreted as a rustup toolchain name (such as+stableor+nightly). see the rustup documentation (https://rust-lang.github.io/rustup/overrides.html) for more info about how toolchain overrides work.--configKEY=VALUE or PATH β overrides a Cargo configuration value. the argument should be in TOML syntax ofKEY=VALUE, or provided as a path to an extra configuration file. this flag may be specified multiple times. see the command-line overrides section (https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides) for more info.-CPATH β changes the current working directory before executing any specified operations. this affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering.cargo/config.toml, for example. this option must appear before the command name, for examplecargo -C path/to/my-project build.
π heads up: this option is only available on the nightly channel (https://doc.rust-lang.org/book/appendix-07-nightly-rust.html) and requires the -Z unstable-options flag to enable (see #10098 https://github.com/rust-lang/cargo/issues/10098).
-h,--helpβ prints help information. iconic behaviour honestly.-Zflag β unstable (nightly-only) flags to Cargo. runcargo -Z helpfor details.
π ENVIRONMENT π
see the reference (https://doc.rust-lang.org/cargo/reference/environment-variables.html) for details on environment variables that Cargo reads. π
π EXIT STATUS π
0: Cargo succeeded. slay. β¨101: Cargo failed to complete. π
π§ EXAMPLES π§
- Remove the default registry token:
cargo logout
- Remove the token for a specific registry:
cargo logout --registry my-registry
π₯ SEE ALSO π₯
ok that's the whole page bestie, you're so done. this came from the General Commands Manual, filed under CARGO-LOGOUT(1) β go forth and de-token responsibly, ily π«Άππ
π¦ where this page comes from
- ubuntu jammy: cargo-1.77 1.77.2+dfsg1ubuntu1~bpo0-0ubuntu0.22.04.1 Β· Apache-2.0 WITH LLVM exception
- ubuntu noble: cargo-1.77 1.77.2+dfsg1ubuntu1-0ubuntu0.24.04.1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms