How to open emacs gui/ide from mac terminal?

emacs, ide, macos, terminal, user-interface

Solution

Assuming you have Emacs installed from Homebrew like this:

brew install emacs --with-cocoa

Just type the following command to open Emacs.app from terminal:

open -a Emacs filename.py

If you want all files opened in the same frame, instead of new frames, put this into your `.emacs` file:

(setq ns-pop-up-frames nil)

Problem

I'm trying to open files up on emacs outside of the terminal. I prefer a gui/ide environment when I code instead of doing it through a terminal. I initially thought that typing `emacs filename.py` would open that file through Emacs.app, however it only allowed me to edit the file through the terminal. When this didn't work, I looked into editing the .profile and .emacs files in my home directory but this was to no avail. Maybe this is more intuitive than what I've read but I can't seem to figure it out. Any help is appreciated.

Original source