Enteroendocrine cells (EECs) are specialised cells in the intestinal epithelium that sense ingested nutrients and secrete hormones to regulate feeding behaviour. How the gut microbiota regulate EEC function during development is still unclear. Here, Lihua Ye and colleagues demonstrate that the gut microbiota are crucial in supporting EEC maturation and mitochondrial function in zebrafish. First, the authors compare developing zebrafish either raised germ-free or colonised with commensal microbiota. They find that gut microbiota can affect EEC morphology and subtype specification. Then, they perform transcriptional analysis on developing zebrafish and find that commensal microbiota colonisation increases the expression of genes associated with EEC maturation and mitochondrial function. To track EEC mitochondrial dynamics and activity, the authors combine transgenic zebrafish tools with in vivo imaging. They find that, in germ-free fish, EECs remain immature and exhibit low mitochondrial activity, whereas in fish raised with commensal microbiota, the authors observe mitochondria hot spots within EECs and increased mitochondrial activity. Lastly, the authors test how the gut microbiota affect the nutrient-sensing response of EECs and find that nutrient-induced EEC mitochondrial activation is almost abolished in germ-free fish. Overall, the findings suggest the gut microbiota are crucial for promoting EEC maturation and mitochondrial function during early postnatal development.