What you need to install is a transfer switch. This is similar in concept
to a battery selector switch which allows you to select which batt will supply 12 volts to the system.
You would wire your shore power to one "side" of the transfer switch and the inverter
to the other side. All the loads are connected to the "output".
Blue Seas makes several versions of these switches, for two 3 and even 4 sources I believe such as the 30 amp 2 sources on off 120V AC Rotary 30A OFF + 2 Sources - PN 1481 - Blue Sea Systems
You will need to fuse or install a circuit breaker for both the shore power and the inverter
. If you have other AC loads, such as a battery charger or a heater
, you need to connect these as well. Your inverter may be too small to handle the additional loads which may ONLY be used when on show power.
In that case you would need to have a panel which has the 30amp main breaker and two or three breakers of less amps for the other loads including convenience outlets. A panel such as 120 Volt AC 2 Sources - PN 1208 - Blue Sea Systems
is what you will also need.
here is a diagram for the above: