For god mode in single-player, the command you're looking for is /damage.
Entering it disables all incoming damage to your character, effectively making you invincible, which is exactly what a god mode is meant to do. Just remember this kind of command only applies in single-player settings.