One should be able to take a smaller genset and charge the batteries via the onshore cable. What you may find tho, is that smaller gensets like the Honda 1000W versions, is they only have a typical 3 plug 15W plug, and shore plugs are the 3 or 4 prong twist style. So some time of adapter will need to be done. If you get bigger gensets, ie 2000 wt or bigger, many times these will have the same plugs that one's std house cord would use. Along with, my cord is some 50' long, even if a portable had the proper plugs on it, I would probably make or buy a 10-20' long cord to use while the gen was running in the cockpit by the plug. In my case, a 10' cord would be plenty!
Just remember, a smaller genset ie a 1000W one, will not charge as fast as a larger one to a degree. This does depend upon your AC/DC charger in the boat. If that only charges at 800W, then your fine with a 1000W genset. if the onboard charger can do more, then a lower genset will take longer than a bigger genset.
Also, before buying a genset, figure out what you want to power. If a micro, you better have at least 2000W, an AC, figure a 3000W unit, some AC's can function with a 2000W, may can not. If you want to use a micro, wife's hair dryer and a drill, a 1000 will NOT work, and quite possile a 2000 may not either!
She drives me boat,
I drives me dinghy!