In order to accommodate an increasing demand for carbon nanotubes (CNTs) with desirable characteristics one has to understand the origin of helicity of their structures. Here, through in situ atomic scale microscopy we demonstrate that the nucleation of a carbon nanotube is initiated by the formation of the carbon cap. Nucleation begins with the formation of a graphene embryo that is bound between opposite step-edges on the nickel catalyst surface. The embryo grows larger as the step-edges migrate along the surface, leading to the formation of a curved carbon cap when the steps flow across the edges of adjacent facets. Further motion of the steps away from the catalyst tip with attached rims of the carbon cap generates the wall of the nanotube. Density Functional Theory calculations bring further insight into the process, showing that step flow occurs by surface self diffusion of the nickel atoms via a step-edge attachment-detachment mechanism. Based on the interplay between catalyst facets and cap formation and the fact that it occurs first in the sequence of stages involved in nanotube growth, we suggest to exploit the angular distribution of catalyst adjacent facets as a new parameter for achieving selective growth of carbon nanotubes.