How to detect workspaces within a directory via CLI?

I have a repo containing a number of workspaces, and I have some CI actions that require handling each workspace. Is there a good way to identify all workspaces contained within this directory from a CLI command?

My best solution so far is rg -.cttoml '^[workspace([.].*)?]$' | cut -d: -f1 (gets all toml files with a top-level workspace key), which will detect every workspace but which could also detect miscellaneous other toml files (I don’t think crate Cargo.toml files can break this, but my repo also has other toml files for configuration etc.).

cargo metadata | jq '.workspace_members'

It looks like that lists the crates in a workspace, not the workspaces in a directory as I requested.

Oops, I misread the question.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.