Optogenetic tools can provide fine spatial and temporal control over many biological processes. Yet the development of new light-switchable protein variants remains challenging, and the field still lacks general approaches to engineering or discovering protein variants with light-switchable biological functions. Here, we adapt strategies for protein domain insertion and mammalian-cell expression to generate and screen a library of candidate optogenetic tools directly in mammalian cells. The approach is based on insertion of the AsLOV2 photoswitchable domain at all possible positions in a candidate protein of interest, introduction of the library into mammalian cells, and light/dark selection for variants with photoswitchable activity. We demonstrate the approach’s utility using the Gal4-VP64 transcription factor as a model system. Our resulting LightsOut transcription factor exhibits a > 150-fold change in transcriptional activity between dark and blue light conditions. We show that light-switchable function generalizes to analogous insertion sites in two additional Cys6Zn2 and C2H2 zinc finger domains, providing a starting point for optogenetic regulation of a broad class of transcription factors. Our approach can streamline the identification of single-protein optogenetic switches, particularly in cases where structural or biochemical knowledge is limited.