cargo-locate-project(1)

NAME

cargo-locate-project --- Print a JSON representation of a Cargo.toml file's location

SYNOPSIS

cargo locate-project [options]

DESCRIPTION

This command will print a JSON object to stdout with the full path to the manifest. The manifest is found by searching upward for a file named Cargo.toml starting from the current working directory.

If the project happens to be a part of a workspace, the manifest of the project, rather than the workspace root, is output. This can be overridden by the --workspace flag. The root workspace is found by traversing further upward or by using the field package.workspace after locating the manifest of a workspace member.

OPTIONS

Display Options

Manifest Options

Common Options

ENVIRONMENT

See the reference for details on environment variables that Cargo reads.

EXIT STATUS

  • 0: Cargo succeeded.
  • 101: Cargo failed to complete.

EXAMPLES

  1. Display the path to the manifest based on the current directory:

    cargo locate-project
    

SEE ALSO

cargo(1), cargo-metadata(1)