cargo locate-project

Print the full path to the Cargo.toml manifest of a project. If the project is part of a workspace, the manifest of the project is shown, rather than that of the workspace. More information: https://doc.rust-lang.org/cargo/commands/cargo-locate-project.html.

cargo locate-project

cargo locate-project --message-format {{plain|json}}

cargo locate-project --workspace

cargo locate-project --manifest-path {{path/to/Cargo.toml}}