A β-enaminone-initiated multicomponent domino reaction for the synthesis of indoloquinolizines and benzoquinolizines from acyclic precursors.