7

I'm having problem launching brackets.io from terminal on MacOS Sierra.

 brackets filename.ext

Gives:

-bash: brackets: command not found

Anyone know what I need to configure to make this happen?

bdkopen
  • 494
  • 1
  • 6
  • 16
Afloz
  • 3,625
  • 3
  • 25
  • 31

6 Answers6

13
  1. Open Bracket editor
  2. Go to file menu and the go to Install Command Line Shortcut

There you have it, to test it go to the terminal and test it

mwangaben
  • 877
  • 10
  • 11
4
  1. Go to terminal.
  2. type open -a brackets filename.ext
Sam
  • 41
  • 1
2

Open Brackets Application: Mac: Select File > Install Command Line Shortcut in Brackets Windows: When installing Brackets, ensure Add "brackets" launcher to PATH for command line use is checked off

Examples

Open a file in the current folder, without switching projects: brackets index.html

Open two files from a specific path, without switching projects: brackets ~/Sites/index.html ~/Sites/index.css

Open the current folder as a project in Brackets: brackets .

Open a specific folder as a project in Brackets: brackets ~/Sites/mysite

Source: https://github.com/adobe/brackets/wiki/Command-Line-Arguments

menhaj
  • 31
  • 3
1

You can do what is called "creating an alias".
Open your .profile with the editor of your choice. f.e.

pico ~/.profile

or with Brackets like this:

open -a /Applications/Brackets.app/ ~/.profile

and add

alias brackets='open -a /Applications/Brackets.app/

to that file.
save.
close.
done.

needlol
  • 101
  • 1
  • 3
0

First, make a custom command for this by opening your bash_profile and putting in the following code:

function brackets() {
    open -a brackets $1
}

Now you can open files and folders in brackets by opening a new terminal window and typing:

brackets <file or folder name> 
0

MacOS 10.15 or greater with zsh

Mac now uses zsh instead of bash, and the GUI option mentioned at https://stackoverflow.com/a/51118156/895245 only adds it to the bash path as of Brackets 1.14. But you can just add it to your PATH manually by adding to:

~/.zprofile

the line:

PATH="$PATH:/usr/local/bin/
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985