CARGO-LOGOUT(1)

๐Ÿ“ฆ version 1.97.1, in ubuntu stonking

๐Ÿ’– 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. for https://crates.io/, head to https://crates.io/me to 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 the registry.default config key, which defaults to crates-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 the term.verbose config 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 the term.quiet config 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 +stable or +nightly). see the rustup docs at https://rust-lang.github.io/rustup/overrides.html for more on how toolchain overrides work. pick your fighter โœจ
  • --config KEY=VALUE or PATH โ€” overrides a Cargo configuration value. the argument should be TOML syntax of KEY=VALUE, or a path to an extra configuration file. you can pass this flag multiple times. see the command-line overrides section at https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides for 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, like cargo -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-options flag to enable. see issue #10098 at https://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. run cargo -Z help for 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 ๐Ÿ’œ

  1. Remove the default registry token:
cargo logout
  1. 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