A molecular crystal structure model of the lead-free halide chalcogenide semiconductor Cs2LiInX6 (X = F, Cl, and Br) was established, and its energy band, density of states, optical properties, and thermodynamic properties were calculated using the first nature principle and the effect of different pressures on the bandgap of Cs2LiInX6 (X = F and Cl, Cs2LiInF6 with a bandgap of 7.359 eV, Cs2LiInCl6 with a bandgap of 5.098 eV, and Cs2LiInBr6 with a bandgap of 3.755 eV). The absorption of light is mainly due to the transition of halide ions from p- to s-orbitals. The p- and In-s orbitals of halide ions play a major role in light harvesting. Cs2LiInCl6 has low sensitivity to relative pressure and is stable at a 0–100 GPa pressure. In the structure of Cs2LiInX6 (X = F, Cl, and Br), changing the halogen atom can effectively improve its optical properties. Cs2LiInCl6 and Cs2LiInF6 are considered as the most promising candidates for UV detectors. Cs2LiInF6 has a large forbidden band width and a high Debye temperature and shows a high photoluminescence quantum yield in the field of phosphors with great potential in the field of phosphors with high photoluminescence quantum yields. This study is a positive reference for the preparation of lead-free chalcogenide-type ultraviolet detectors with excellent performance.