Foxtail millet, a traditional cereal crop, has gained increasing attention for its high nutritional value and potential health benefits. This study aimed to investigate the simultaneous and rapid detection of amylose and amylopectin content of foxtail millet flour under different sheep manure application rates by hyperspectral imaging combined with chemometrics. The spectral data preprocessing used multiplicative scatter correction (MSC), and the combined algorithm of competitive adaptive reweighted sampling (CARS), random frog (RF), iterated retaining informative variables (IRIV) were employed for key band extraction. The partial least squares regression (PLSR) was then used to establish the prediction model and the regression equation, that was used to visualize the two components. Results demonstrated the key band extraction combined algorithm effectively reduced data dimension without compromising the accuracy of the prediction model. The prediction model for amylose using MSC-RF-IRIV-PLSR exhibited good performance, with the correlation coefficient (R) and root mean square error (RMSE) predicted to be 0.73 and 1.23, respectively. Similarly, the prediction model for amylopectin using MSC-CARS-IRIV-PLSR also demonstrated good performance, with the R and RMSE predicted to be 0.59 and 7.34, respectively. Then, the visualization graph generated clearly shows under the condition of applying 6 m3 of sheep manure, the amount of amylopectin accumulation was highest, and the amount of amylose was lowest. The experimental results offer valuable insights for the rapid detection of nutritional components in foxtail millet, serving as a basis for further research.