We love Gibraltar and have been there twice; last time last year. Gibraltar with a cruise ship in port is an entirely different experience than without a cruise ship in port. Since you're going by cruise ship, you don't have the option to avoid cruise-ship days. As noted, I would not bother with the cable car - the queue will take up most of your day (even with tickets in advance, we queued for over an hour).
If you can arrange a taxi tour via your cruise ship as an excursion, I would do that. If not, you'll be at the dockside competing with your thousands of shipmates for the the dozens of taxis. If you get a taxi, there is a pretty standard tour. You'll see the apes and great views. Make sure your cabbie takes you to St Michael's Cave. This is the #1 highlight in all of Gibraltar for me.
If you don't get a cab or a cruise ship excursion, I'm afraid you are limited to where you can go on foot or by bus (https://www.gibraltarbuscompany.gi/). It will be tough to get to the top of the Rock, but that is not a terrible thing. The town of Gibraltar is still a very nice place to spend a day. Casemate Square is a nice place to sit on a terrasse and eat and drink, but an even better spot is a number of bars and restaurants along the waterfront at Queensway Quay. Also near there is the Trafalgar Cemetery, a leafy oasis of quiet, where the dead of the famous battle are buried. And if you really want to get away from the crowds, take the bus to Catalan Bay, on the east side of the Rock.