Liver inflammation and the immune response have been recognized as critical contributors to cirrhosis pathogenesis. Immunity-related genes (IRGs) play an essential role in immune cell infiltration and immune reactions; however, the changes in the immune microenvironment and the expression of IRGs involved in cirrhosis remain unclear. CD45+ liver cell single-cell RNA (scRNA) sequencing data (GSE136103) from patients with cirrhosis were analyzed. The clusters were identified as known cell types through marker genes according to previous studies. GO and KEGG analyses among differentially expressed genes (DEGs) were performed. DEGs were screened to identify IRGs based on the ImmPort database. The protein-protein interaction (PPI) network of IRGs was generated using the STRING database. IRGs activity was calculated using the AUCell package. RNA microarray expression data (GSE45050) of cirrhosis were analyzed to confirm common IRGs and IRGs activity. Relevant regulatory transcription factors (TFs) were identified from the Human TFDB database. A total of ten clusters were obtained. CD8+ T cells and NK cells were significantly decreased in patients with cirrhosis, while CD4+ T memory cells were increased. Enrichment analyses showed that the DEGs focused on the regulation of immune cell activation and differentiation, NK-cell mediated cytotoxicity, and antigen processing and presentation. Four common TFs, IRF8, NR4A2, IKZF3, and REL were expressed in both the NK cluster and the DEGs of liver tissues. In conclusion, we proposed that the reduction of the CD8+ T cell cluster and NK cells, as well as the infiltration of CD4+ memory T cells, contributed to immune microenvironment changes in cirrhosis. IRF8, NR4A2, IKZF3, and REL may be involved in the transcriptional regulation of NK cells in liver fibrosis. The identified DEGs, IRGs, and pathways may serve critical roles in the development and progression of liver fibrosis.