Abstract The enteroendocrine system plays an important role in metabolism. The gut microbiome regulates enteroendocrine in an extensive way, arousing attention in biomedicine. However, conventional strategies of enteroendocrine regulation via gut microbiome are usually non-specific or imprecise. Here, an optogenetic operated probiotics system was developed combining synthetic biology and flexible electronics to achieve in situ controllable secretion to mimic enteroendocrine. Firstly, optogenetic engineered Lactococcus lactis ( L. lactis ) were administrated in the intestinal tract. A wearable optogenetic device was designed to control optical signals remotely. Then, L. lactis could secrete enteroendocrine hormone according to optical signals. As an example, optogenetic L. lactis could secrete glucagon-like peptide-1(GLP-1) under the control of the wearable optogenetic device. To improve the half-life of GLP-1 in vivo , the Fc domain from immunoglobulin was fused. Treated with this strategy, blood glucose, weight and other features were relatively well controlled in rats and mice models. Furthermore, up-conversion microcapsules were introduced to increase the excitation wavelength of the optogenetic system for better penetrability. This strategy has biomedical potential in metabolic diseases therapy by mimicking enteroendocrine.