How to open Atom editor from command line in OS X?
With the Atom editor open, in the menu bar:
Click Atom >> Install Shell Commands
You should expect to see:
Potentially restart your terminal. (I did just out of habit, not sure if you need to)
When Atom installs it automatically creates a symlink in your /usr/local/bin. However in case it hasn't, you can create it yourself on your Mac
ln -s /Applications/Atom.app/Contents/Resources/app/atom.sh /usr/local/bin/atom
Now you can use atom folder_name
to open a folder and atom file_name
to open a file.
Roll your own with @Clockworks solution, or in Atom, choose the menu option Atom > Install Shell Commands. This creates two symlinks in /usr/local/bin
apm -> /Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm
atom -> /Applications/Atom.app/Contents/Resources/app/atom.sh
The atom
command lets you do exactly what you're asking. apm
is the command line package manager.