Cellulose nanofiber/polyaniline (CNF/PANI) composites films were synthesized through in situ polymerization of aniline in a nanocellulose suspension that was isolated from bamboo (Phyllostachys nidularia Munro). The PANI contents were 5 wt.%, 15 wt.%, or 30 wt.%. Scanning electron microscopy (SEM) and transmission electron microscopy (TEM) showed that the CNF nanofibril surfaces were uniformly coated by PANI particles. Moreover, Fourier transform infrared (FTIR) spectroscopy analysis indicated the formation of hydrogen bonds between the amine groups of aniline and the hydroxyl groups of cellulose. X-ray diffraction (XRD) analysis demonstrated that the cellulose I structure of CNF in the composites did not change, while the crystallinity of CNF was affected. Thermogravimetric analysis (TGA) showed that the thermal stability of CNF was increased due to the addition of PANI. Meanwhile, the obtained electrical conductivity and mechanical properties of the CNF/PANI composites indicated that the composites could be used potentially in anti-static materials, for shielding of electromagnetic radiation, and in biological sensors.