CARGO-LOGOUT(1)
๐ hey bestie, this is cargo-logout(1) ๐
okay so you opened the manual page for cargo-logout, straight out of the General Commands Manual, section 1, and honestly? it's a short one. it's giving "quick lil cleanup task" energy and I am obsessed. let's get into it ๐ซถ
โจ NAME โจ
cargo-logout โ yeet an API token off your machine, locally ๐
๐ธ SYNOPSIS ๐ธ
cargo logout [options]
๐ฆ DESCRIPTION ๐ฆ
so what actually happens when you run this? cargo runs a credential provider to remove a saved token. that's the whole vibe. ๐
for the default cargo:token credential provider, your credentials live in $CARGO_HOME/credentials.toml, and $CARGO_HOME defaults to .cargo inside your home directory. that's where the token was chilling, and that's where it's about to stop chilling. โจ
if a registry has a credential-provider specified, then that one gets used, no questions asked. otherwise, cargo goes through the providers listed in the config value registry.global-credential-providers, and it tries them starting from the end of the list. yes, from the end. backwards. iconic behavior honestly. ๐ฅ
if you don't pass --registry, then the credentials for the default registry get removed. that default is configured by registry.default (docs at https://doc.rust-lang.org/cargo/reference/config.html#registrydefault), and it defaults to https://crates.io/. so like, if you just wanna be logged out of crates.io, you literally don't have to type anything extra. slay. ๐
โ ๏ธ okay important one, no cap: this does NOT revoke the token on the server. it only removes it locally. if you actually need that token revoked revoked, you have to go to the registry's website and follow their instructions. forhttps://crates.io/, head tohttps://crates.io/meto revoke the token. don't skip this step bestie, a live token is a live token ๐ญ
๐ OPTIONS ๐
๐ Logout Options
--registry registryโ the name of the registry you wanna use. registry names are defined in Cargo config files (https://doc.rust-lang.org/cargo/reference/config.html). if you don't specify one, the default registry is used, and that default is defined by theregistry.defaultconfig key, which defaults tocrates-io. ๐
โจ Display Options
-v,--verboseโ use verbose output. and here's the fun part: you can pass it twice for "very verbose" output, which throws in extra stuff like dependency warnings and build script output. you can also set this with theterm.verboseconfig value (https://doc.rust-lang.org/cargo/reference/config.html). more words, more info, we love to see it ๐ข-q,--quietโ do not print cargo log messages. silence. peace. no thoughts, head empty ๐ may also be specified with theterm.quietconfig value (https://doc.rust-lang.org/cargo/reference/config.html).--color whenโ controls when colored output gets used. valid values are:auto(default): automatically detect if color support is available on the terminal. it just knows. ๐ฎalways: always display colors. rainbow mode, periodt ๐never: never display colors. monochrome moment ๐
may also be specified with the term.color config value (https://doc.rust-lang.org/cargo/reference/config.html).
๐ Common Options
+toolchainโ if Cargo was installed with rustup, and the first argument to cargo starts with+, it gets interpreted as a rustup toolchain name (like+stableor+nightly). see the rustup docs athttps://rust-lang.github.io/rustup/overrides.htmlfor more on how toolchain overrides work. pick your fighter โจ--config KEY=VALUEorPATHโ overrides a Cargo configuration value. the argument should be TOML syntax ofKEY=VALUE, or a path to an extra configuration file. you can pass this flag multiple times. see the command-line overrides section athttps://doc.rust-lang.org/cargo/reference/config.html#command-line-overridesfor the deets.-C PATHโ changes the current working directory before executing any specified operations. this affects stuff like where cargo looks by default for the project manifest (Cargo.toml), and also the directories it searches when discovering.cargo/config.toml. this option must appear before the command name, likecargo -C path/to/my-project build. order matters bestie, don't fight it ๐ซถ
๐ 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-optionsflag to enable. see issue #10098 athttps://github.com/rust-lang/cargo/issues/10098. so like, not for the faint of heart, but go off ๐
-h,--helpโ prints help information. the classic. the icon. ๐-Z flagโ unstable (nightly-only) flags to Cargo. runcargo -Z helpfor details. ๐ง
๐ฟ ENVIRONMENT ๐ฟ
see the reference at https://doc.rust-lang.org/cargo/reference/environment-variables.html for all the details on the environment variables that Cargo reads. env vars stay winning ๐
โญ EXIT STATUS โญ
0: Cargo succeeded. we ate and left no crumbs ๐ฅ101: Cargo failed to complete. it's giving tragedy ๐ญ
๐ EXAMPLES ๐
- Remove the default registry token:
cargo logout
- Remove the token for a specific registry:
cargo logout --registry my-registry
๐ธ SEE ALSO ๐ธ
cargo(1), cargo-login(1) โ the whole friend group ๐ซถ
and that's the whole page, bestie! this was cargo-logout(1) from the General Commands Manual โ the Cargo manual's own page, and there's no date stamped on this footer so we're just gonna let it be mysterious. now go log out of that registry, you absolute main character ๐
โจ๐
๐ฆ where this page comes from
- ubuntu questing: cargo-1.88 1.88.0+dfsg0ubuntu1-0ubuntu1
- ubuntu questing: cargo-1.88 1.88.0+dfsg0ubuntu1-0ubuntu2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms