• A porous organic cage (POC)-based quasi-solid-state electrolyte (QSSE) with cavity-induced anion-trapping effect was rationally designed to enable stable operation of Li-metal batteries.
• The POC-based QSSE exhibits a high Li+ transference number of 0.67 and a high ionic conductivity of 1.25×10−4 S cm−1 with a low activation energy of 0.17 eV.
• The POC-based QSSE demonstrates highly reversible Li plating/stripping cycling for 2000 h and superior Li||LFePO4 cycling for thousands of cycles at room temperature.
• This work demonstrates the practical applicability of POC as solid-state electrolytes for LMBs and could be extended to other energy-storage systems, such as Na and K batteries.