The inventors have developed a new system of optogenetics-based recombinant system allowing to target tumor cells to control in space and time tumor cell lysis by cytotoxic T lymphocytes (CTLs) with light. To do so, they have coupled tumor-specific antigen antibody to a photoreceptor protein that can bind an optogenetic domain linked to a Fab fragment derived from an agonistic antibody targeting the TCR. They demonstrated that these new system allow the spatio-temporal control of the tumor cell killing by CTLs in vitro, in response to light. The present invention relates to methods of activating on demand an immune cell or a plurality of immune cells, and methods for treating cancer.