Divergent synthesis of two types of indolizines is described via a step-dependent assembly of pyridine-2-acetonitriles, arylglyoxals, and TMSCN.