I'm less familiar with the library that OP is using, but it seems to be here: https://github.com/spectresystems/spectre.console/blob/main/...
Going in the other direction, generating command lines: https://github.com/natemcmaster/CommandLineUtils/blob/main/s...
I don't recommend re-inventing this