Adds ability to autodiscover

cc @Aaroneous