Smith-Purcell radiation (SPR) is a versatile platform for finely tuning nanoscale light across a broad spectral range. This study introduces a theoretical approach for shaping SPR wavefronts using aperiodic metagratings (AMGs). The AMGs consist of arrays of identical metal nano-rods (MNRs), with each MNR's spatial position precisely adjustable. This precise adjustment allows for effective modulation of the spatial phase distribution of SPR. To demonstrate the efficacy of this method, we conduct simulations to achieve diverse wavefront profiles of focusing, deflection, Bessel beams, and Airy beams. Additionally, our approach allows for integrating multiple SPR wavefront functionalities within a combo AMG. By employing the asymmetric L-shaped meta-atom design, we achieve simultaneous SPR polarization conversion and wavefront shaping. This method is promising for developing highly adaptable and multifunctional nanoscale light sources.