The invention provides an automatic shaft ribbing tool. The automatic shaft ribbing tool comprises a machining platform, a lower die seat, an upper die seat, a lower ribbing die, an upper ribbing die, a driving mechanism, a mounting plate, a clamp, a gear, a mounting seat, a rack, a first air cylinder and a clamping air cylinder. The invention provides a mechanism capable of realizing automatic rotation of a shaft to be machined for a compression tool. When the automatic shaft ribbing tool is used, the upper die seat is pressed on the surface of the shaft to finish first time of ribbing; after the first time of ribbing is finished, the shaft to be machined is clamped by the clamping air cylinder, and the first air cylinder drives the rack to move from front to back, so that the gear is driven to rotate, and furthermore, the shaft to be machined in a clamp is driven to rotate; and after the shaft to be machined rotates for a pre-set angle, the driving mechanism drives the upper die seat to be pressed down so as to carry out second time of ribbing. With the adoption of the structure provided by the invention, the shaft to be machined does not need to be manually rotated, and can rotate for the pre-set angle completely through setting a distance, so that influences caused by artificial factors are avoided, and the machining precision of the shaft and the quality stability of a product are effectively improved; and meanwhile, compared with manual operation, the production efficiency is greatly improved.