sensors for air cylinder and how to program it

What is the best type of sensors to use with air cylinder? its a double action 750 mm length of stroke. I want to make it automatic so if there's any object in front of them, the cylinder will push them. And what software should i use to program it?