A unified single-mode theory is developed for the gyrotron traveling-wave amplifier (gyro-TWA) at harmonics of electron gyro frequency, both in linear and nonlinear regimes. The theory is applicable to a wide class of waveguide cross sections and waveguide modes; it can also be useful for arbitrary harmonic numbers and with the generalized electron beam model. The waveguide fields are expanded into series of multipoles about the electron guiding centers. A general dispersion equation is derived. Some numerical examples of the gain-frequency curves of gyro-TWA's with out-ridged, magnetron-type, rectangular and circular waveguides are computed by employing the results of kinetic theory.