This large-scale study delineates stage-dependent ecological and functional remodelling of the gut microbiome across liver diseases. These findings highlight the potential of microbiome-based markers for non-invasive diagnosis and prognostic risk stratification in liver diseases.