Searching for two-dimensional (2D) layered materials with diverse electronic conductivities is one of the leading topics in materials science. Herein, from first-principles calculations, we report the thickness-dependent conductivity of layered 2D polyaniline (PANI) structures. When PANI is thinned down to a monolayer, it behaves as a p-type semiconductor with an indirect bandgap of 1.04 eV from the HSE functional, which is the closest to that of bulk silicon among all the known monolayer 2D materials. When two PANI monolayers are stacked together to form a bilayer, the bandgap is reduced to only 0.12 eV. From trilayer to bulk, the characteristic of the metal is realized with both intra- and inter-layer conductivities. Notably, the semiconducting and metallic PANI can form a seamless contact with low contact resistance that greatly benefits the carrier injection and facilitates carrier transport. Electronic structure and density of state analyses reveal the importance of the 2pz orbital in contributing to the metallic conductance through crossing the system Fermi level. The binding between PANI layers is 61.68 meV per atom, indicating that the interlayer interaction within PANI stacks is mostly van der Waals attraction. This striking semiconductor-to-metal transition realized in one homogeneous 2D nanomaterial only through thickness control should open up new opportunities for the design of seamless electronic contacts and constitute the ultimate functional unit for future nano-electronic devices.