CLI vs GUI?

How do I tell if a program was started from the CLI or GUI?