One of the marvels of biology is the phenotypic plasticity of microorganisms. It allows them to maintain high growth rates across conditions. Studies suggest that cells can express metabolic enzymes at tuned concentrations through adjustment of gene expression. The associated transcription factors are often regulated by intracellular metabolites. Here we study metabolite-mediated regulation of metabolic-gene expression that maximises metabolic fluxes across conditions. We developed an adaptive control theory, qORAC (for Specific Flux (q) Optimization by Robust Adaptive Control), and illustrate it with several examples of metabolic pathways. The key feature of the theory is that it does not require knowledge of the regulatory network, only of the metabolic part. We derive that maximal metabolic flux can be maintained in the face of varying N environmental parameters only if the number of transcription-factor binding metabolites is at least equal to N. The controlling circuits appear to require simple biochemical kinetics. We conclude that microorganisms likely can achieve maximal rates in metabolic pathways, in the face of environmental changes.