The lithium-rich anti-perovskite Li3OCl has emerged as an ideal candidate for next-generation lithium-ion batteries (LIBs) due to its excellent ionic conductivity and wide electrochemical stability window. However, achieving ionic conductivity that meets practical application requirements remains challenging. Strain engineering and opto-ionic effects provide new approaches for optimizing the performance, but currently there is a lack of research on the quantitative regulatory mechanisms by which strain influences the electronic structure and optical properties of Li3OCl (both of which are critical for ionic transport and optoelectronic integration). In this study, first-principles calculations are performed using the HSE06 hybrid functional to systematically investigate the effects of biaxial (+2%)and uniaxial (–2%) strains - on electronic structure and optical properties of Li3OCl.In this study, it is found that strain-free Li3OCl exhibits an indirect bandgap of 6.263 eV. Biaxial tensile strain causes a significant downward shift in the energy of the conduction band minimum (Γ point), reducing the bandgap to 6.023 eV (+2% strain) and reinforcing the indirect bandgap characteristics. Biaxial compressive strain (–2%) expands the bandgap to 6.380 eV and triggers off an upward shift in the Γ-point energy level, leading to a transition from an indirect to a direct bandgap. Uniaxial strain exhibits similar trends but with a smaller regulatory magnitude than biaxial strain. The analysis of density of states shows that tensile strain reduces the Li-p state density near the conduction band minimum while enhancing the hybridization of Li-p with O-p/Cl-p orbitals, optimizing carrier transition channels. Compressive strain increases the electron state density near the Fermi level, enhancing the probability of optical transitions. In terms of optical response, tensile strain induces an overall redshift in the complex dielectric function (ε1(ω) and ε2(ω)), absorption coefficient, and extinction coefficient. Compressive strain causes a systematic blue-shift in optical parameters. Despite the expanded bandgap, the optical absorption intensity is significantly enhanced in the ultraviolet region due to the direct bandgap characteristics and the increased state density at the band edges.This study provides new ideas for studying the applications of Li3OCl in optoelectronic devices and solid-state batteries. By precisely regulating its bandgap and light absorption properties through strain engineering, Li3OCl can adapt to the excitation requirements of different wavelengths of light. For example, in light-controlled solid-state batteries, Li3OCl optimized by tensile strain has a wider light response range (red-shifted to lower energy), which can effectively utilize lower-energy photons (such as near-ultraviolet or the edge of visible light) to excite carriers. On the other hand, Li3OCl optimized by compressive strain has higher light absorption efficiency in specific ultraviolet bands, potentially increasing the concentration of carriers excited by photons in these bands. The strain-optimized Li3OCl can synergistically utilize the light field and stress field to enhance ionic conductivity. In addition, its red-shifted light absorption edge makes it promising as an ultraviolet-visible light conversion layer, expanding the range of light energy utilization. However, in practical applications, further research is needed on the synergistic mechanisms of non-uniform strain, temperature effects, and light-force coupling. Moreover, experimental verification of its interfacial stability and cycle performance is required to promote the practical application of high-performance all-solid-state batteries.