To get the versions installed, highly recommend using a Puppetfile[1].
This file lists all of your modules tied to where you download them from
and at what git reference, which could be a tagged version or branch or
commit SHA. I use a mix of librarian-puppet-simple[2] and r10k[3] which
do not do any dependency resolution of modules, so I always know exactly
what code is being deployed.
To see what is available is trickier, though if you are using modules
from the Forge, you could use their API[4].