Creating custom targets

I’d like to create specific custom target and add it to global pio env so it can be invoked in any project but I see no documentation for this. Is this possible at all or we’re limited to builtin targets only?

See Redirecting...

Fine, but this solves only part of my issue, and the less important one. :wink:

How do I define custom target? For example, to collect coverage or perform other code analysis.

Extra scripting is right direction. See scons.org documentation how to use targets.