Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I open the Atom editor from the command line in OS X?

People also ask

How do I open Atom editor in terminal?

To enable opening Atom from the command-line, you will need to install shell commands from the either the Atom menu or the Atom Command Palette. In the Command Palette, search for “Window: Install Shell Commands”. To open a specific directory into the Project Explorer, you can add a path argument to the atom command.

How do I open Atom editor in CMD?

To open a project with atom Go to your project directory: by typing cd /<foldername> using cmd or bash. Then type, atom . Thanks.


With the Atom editor open, in the menu bar:

Click AtomInstall Shell Commands

atom-add-shell-commands

You should expect to see:

atom-commands-installed

Potentially restart your terminal (I did it just out of habit and am not sure if you need to).


When Atom installs, it automatically creates a symbolic link in your /usr/local/bin folder. 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 user3283997's solution, or in Atom, choose the menu option AtomInstall Shell Commands. This creates two symbolic links 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.


For Windows 7 x64 with default Atom installation add this to your PATH

%USERPROFILE%\AppData\Local\atom\app-1.4.0\resources\cli

and restart any running consoles

(if you don't find Atom there - right-click Atom icon and navigate to Target)

enter image description here


The symlink solution for this stopped working for me in zsh today. I ended up creating an alias in my .zshrc file instead:

alias atom='sh /Applications/Atom.app/Contents/Resources/app/atom.sh'