Interfacial magnetism and metal-insulator transition at LaNiO$$_3$$
3
-based oxide interfaces have triggered intense research efforts, because of the possible implications in future heterostructure device design and engineering. Experimental observation lack in some points a support from an atomistic view. In an effort to fill such gap, we hereby investigate the structural, electronic, and magnetic properties of (LaNiO$$_3$$
3
)$$_n$$
n
/(CaMnO$$_3$$
3
)$$_m$$
m
superlattices with varying LaNiO$$_3$$
3
thickness (n) using density functional theory including a Hubbard-type effective on-site Coulomb term. We successfully capture and explain the metal-insulator transition and interfacial magnetic properties, such as magnetic alignments and induced Ni magnetic moments which were recently observed experimentally in nickelate-based heterostructures. In the superlattices modeled in our study, an insulating state is found for n=1 and a metallic character for n=2, 4, with major contribution from Ni and Mn 3d states. The insulating character originates from the disorder effect induced by sudden environment change for the octahedra at the interface, and associated to localized electronic states; on the other hand, for larger n, less localized interfacial states and increased polarity of the LaNiO$$_3$$
3
layers contribute to metallicity. We discuss how the interplay between double and super-exchange interaction via complex structural and charge redistributions results in interfacial magnetism. While (LaNiO$$_3$$
3
)$$_n$$
n
/(CaMnO$$_3$$
3
)$$_m$$
m
superlattices are chosen as prototype and for their experimental feasibility, our approach is generally applicable to understand the intricate roles of interfacial states and exchange mechanism between magnetic ions towards the overall response of a magnetic interface or superlattice.