An electrochemical direct selective C–H chalcogenocyanation approach for indolizine derivatives under mild conditions has been described.