Is there a way to know from a command line shell if I am currently on a Google Compute Engine machine or somewhere else (development machine)?
You can also use the dmidecode utility to probe the virtual hardware if you don't want to make a network call:
my@myinst:~$ sudo dmidecode -s bios-vendor | grep Google Google