`config` cli command and refactored discovery endpoint