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.
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 Atom → Install Shell Commands
You should expect to see:
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 Atom → Install 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)
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With