CARGO-LOGOUT(1)

πŸ“¦ version 1.79.0, in ubuntu jammy, ubuntu noble

πŸ’– 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 πŸŽ€

  • --registry registry β€” 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 the registry.default config key β€” and that defaults to crates-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 the term.verbose config value (https://doc.rust-lang.org/cargo/reference/config.html).
  • -q, --quiet β€” do not print cargo log messages. may also be specified with the term.quiet config value (https://doc.rust-lang.org/cargo/reference/config.html).
  • --color when β€” 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 to cargo begins with +, it will be interpreted as a rustup toolchain name (such as +stable or +nightly). see the rustup documentation (https://rust-lang.github.io/rustup/overrides.html) for more info about how toolchain overrides work.
  • --config KEY=VALUE or PATH β€” overrides a Cargo configuration value. the argument should be in TOML syntax of KEY=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.
  • -C PATH β€” 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 example cargo -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.
  • -Z flag β€” unstable (nightly-only) flags to Cargo. run cargo -Z help for 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 🧚

  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)


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