Oslo is very nice and compact enough for a quick walk around. We bought the Oslo Pass in the cruise terminal and saved 20% off by doing that. The woman was careful to mention before we paid that as it was Monday, most of the museums were closed. We said we wanted to see the museums on the island and she cheerfully said they were open so the pass was a good buy. It includes entry to most of the museums and all public transport.
We saw the Viking, Fram, and Kon-Tiki museums, all of which are very nice. All three can easily be done in a morning, leaving the afternoon to see the city.
One of the best things about Oslo is sailing into and out of the city. The fjord is long and full of things to see and slightly reminiscent of sailing the Inside Passage.