Well it depends which ports you are docking at!! It would help considerably to have this info, but in the absence of such, I can recommend a local boat from Naples to either Sorrento ofr Capri, a third of the cost of the cruise ship excursions. The boats leave from close to where cruise ships dock and you can get a timetable from the ticket office.
If you dock at Villefranche, you can get the train to Monaco or Nice, the station is easily within walking distance.
If you are going to Barcelona, it'as easy to do you own thing - free to walk along Las Ramblas and a short underground train ride to see the Gaudi church. Watch out for pickpockets.
As always, make sure you get back to the ship in good time.