How to count the targets in a project

Shai asked how one can count the number of modules in a Tuist project. Even though we don’t have a first-class solution for that, you can use tuist dump in combination with jq as suggested by @danieleformichelli to achieve that:

tuist dump | jq '.targets | length'