LinuxCommandLibrary

cargo-owner

Manage crate ownership on crates.io

TLDR

Invite the given user or team as an owner

$ cargo owner [[-a|--add]] [username|github:org_name:team_name] [crate]
copy

Remove the given user or team as an owner
$ cargo owner [[-r|--remove]] [username|github:org_name:team_name] [crate]
copy

List owners of a crate
$ cargo owner [[-l|--list]] [crate]
copy

Use the specified registry (registry names can be defined in the configuration - the default is )
$ cargo owner --registry [name]
copy

SYNOPSIS

cargo owner <SUBCOMMAND> [OPTIONS]

cargo owner add <USER_NAME> --crate <CRATE_NAME> [OPTIONS]
cargo owner remove <USER_NAME> --crate <CRATE_NAME> [OPTIONS]
cargo owner list --crate <CRATE_NAME> [OPTIONS]

PARAMETERS

add <USER_NAME>
    Adds a user as an owner of the specified crate. <USER_NAME> is the `crates.io` username to add.

remove <USER_NAME>
    Removes a user from the ownership list of the specified crate. <USER_NAME> is the `crates.io` username to remove.

list
    Lists all current owners of the specified crate.

--crate <CRATE_NAME>
    (Required for add, remove, list) Specifies the name of the crate whose ownership will be managed. For example: --crate my-package.

--registry <REGISTRY>
    The name of the registry to interact with. Defaults to crates.io if not specified.

--token <TOKEN>
    An API token to use for authentication with the registry. If not provided, Cargo will attempt to use a token from the configuration.

-v, --verbose
    Use verbose output, displaying more details about the operation.

-q, --quiet
    Do not print `cargo` log messages, suppressing non-error output.

--color <WHEN>
    Control when colors are used in output. Possible values: auto, always, never.

--frozen
    Ensures that Cargo.lock and all caches are up to date before proceeding. Fails if they are not.

--locked
    Ensures that Cargo.lock is up to date before proceeding. Fails if it is not.

--offline
    Run without accessing the network. Fails if network access is required for the operation.

-h, --help
    Prints help information for the owner command or a specific subcommand.

-V, --version
    Prints version information for `cargo`.

DESCRIPTION

cargo owner is an essential subcommand of cargo, the Rust package manager and build system. It provides functionalities to manage the ownership of a package (referred to as a "crate") that has been published to crates.io, the official Rust package registry. The concept of "owners" is critical for collaborative development and security: package owners are authorized to publish new versions of a crate, yank specific versions from the registry, and modify the list of other owners. This command facilitates the process of adding new developers to a project's ownership team, removing individuals who are no longer active, or simply listing all current owners for a given crate. It serves as a vital tool for maintaining control and ensuring the integrity of published Rust libraries and applications, enabling distributed teams to manage their projects efficiently. All operations performed by cargo owner interact directly with the crates.io API, necessitating proper authentication, typically achieved through an API token configured with cargo.

CAVEATS

This command directly interacts with the crates.io registry and requires network access.

Authentication via a valid API token for your `crates.io` account is mandatory to perform ownership modifications (add or remove).

Only existing owners of a crate possess the necessary permissions to add or remove other owners.

The --crate option is required for the add, remove, and list subcommands, specifying which package's ownership is being managed.

CRATES.IO AUTHENTICATION

To use cargo owner for modifying ownership (add or remove), you must be authenticated with crates.io. This is typically done by running cargo login with an API token obtained from your crates.io account settings. The token grants `cargo` the necessary permissions to interact with the registry on your behalf.

ROLE OF AN OWNER

An owner of a crate on crates.io has significant control over the package. They can publish new versions of the crate, yank existing versions (making them unavailable for new builds), and, crucially, manage the list of other owners by adding or removing them. This shared responsibility is key for open-source project sustainability.

HISTORY

The owner subcommand has been an integral part of the cargo tool since its early development, coinciding with the stable release of Rust 1.0 in 2015. It was designed from the outset to facilitate collaborative package maintenance on crates.io, enabling multiple trusted individuals to manage the lifecycle of a single Rust crate. Its stable functionality has remained consistent, serving as a core feature for managing access and control over published Rust libraries and applications.

SEE ALSO

Copied to clipboard