In the search for the building blocks of life, nitrogen-bearing molecules are of particular interest since nitrogen-containing bonds are essential for the linking of amino acids and ultimately the formation of larger biological structures. The elusive molecule methylamine (CH$_3$NH$_2$) is thought to be a key pre-biotic species but has so far only been securely detected in the giant molecular cloud Sgr B2. We identify CH$_3$NH$_2$ and other simple nitrogen-bearing species towards three hot cores in NGC 6334I. Column density ratios are derived in order to investigate the relevance of the individual species as precursors of biotic molecules. Observations obtained with ALMA were used to study transitions of CH$_3$NH$_2$, CH$_2$NH, NH$_2$CHO, and the $^{13}$C- and $^{15}$N-methyl cyanide (CH$_3$CN) isotopologues. Column densities are derived for each species assuming LTE and excitation temperatures in the range 220-340 K for CH$_3$NH$_2$, 70-110 K for the CH$_3$CN isotopologues, and 120-215 K for NH$_2$CHO and CH$_2$NH. We report the first detections of CH$_3$NH$_2$ towards NGC 6334I with column density ratios with respect to CH$_3$OH of 5.9$times$10$^{-3}$, 1.5$times$10$^{-3}$, and 5.4$times$10$^{-4}$ for the three hot cores MM1, MM2, and MM3, respectively. These values are slightly lower than the values derived for Sgr B2 but higher by more than order of magnitude as compared with the values derived for the low-mass protostar IRAS 16293-2422B. The detections of CH$_3$NH$_2$ in the hot cores of NGC 6334I hint that CH$_3$NH$_2$ is generally common in the interstellar medium, albeit high-sensitivity observations are essential for its detection. The good agreement between model predictions of CH$_3$NH$_2$ ratios and the observations towards NGC 6334I indicate a main formation pathway via radical recombination on grain surfaces.