From #3119:
The best way to get access to the config object is via ConfigAwareInterface / ConfigAwareTrait.
There's no documentation on the various interfaces that you can give a command that then get you extra functionality. Once I knew about this interface, I was able to look for it in the source code and figure it out (and spot all the other interfaces that get detected), but it's not discoverable for developers.