The final solution will have to be selected according to needed accuracy and stability, weight and forces necessary.
Some air pneumatic cylinders can be eqipped with a magnetic material strip attaced to the piston ring. Normally you will use this to detect lower and upper end position with outside mounted and adjustable proximity limit switches. As for instance used for piston cylinders to operate knife-gate valves.
It is also common to use such solutions together with a PLS (programmable logic steering unit).
A suggested solution could be a combination consisting of your pneumatic cylinder, proximity switches for end positions and your steps (switches either directly on cylinder or mounted on strokeside to react on proximity of 'metal flag' mounted on load, piston end or holding device) PLS and a 5/3- way solenoid valve to open/close or hold according to signals from switches and program.
If you do not need an automated operation the 5/3 way solenoid valve should be/is of type with two solenoids: current to solenoid one to move cylinder one way, current to solenoid two opposite way, and mid position (no current) to lock all ports as is (lock to existing position)
You can then hand operate current to solenoid with limit switches arranged to give you visual signals, for instance LED lights.
Throttle valves will let you adjust air in and out and slow down the movement. Seek advice on this from solenoid supplier because some 5/3 valves needs a a certain minimum pressure difference to operate properly and may lock if unsuitable throtteled.
An pure electrical solution would be slower but much more precise. A multiturn actuator for valves with rising stem could probably be used without alterations, but limit switches must be arranged or intergrated. Watch out for limits on allowed operation/running time per time unit for electrical actuators!