Install aws-cli using Homebrew
My awscli formula has been merged and is officially available with Homebrew.
It would be useful to add Homebrew as an installation option in the README.
As a suggestion something like this,
Homebrew on Mac OS X
aws-cli can also be installed using the Homebrew package manager on Mac OS X:
brew install awscli
If you want the development version of aws-cli:
brew install awscli --HEAD
After installation brew will provide instructions for installing completion and where to find the examples on how to use aws-cli.
Agreed. Homebrew appeals to a much broader audience than pip.
Release history is pretty good but still a bit spotty. https://github.com/Homebrew/homebrew/commits/master/Library/Formula/awscli.rb
This should be made official
Does anyone know how to use pip to install awscli after installing Python with Homebrew? It seems like the path files go wrong somewhere as it's looking for the aws-cli executable in /usr/local/bin/ but if you do
sudo pip install awscli
that places it in /usr/bin/ instead. I got the following error:
Traceback (most recent call last):
File "/usr/local/bin/aws", line 15, in <module>
import awscli.clidriver
ImportError: No module named awscli.clidriver
Just looking for some background info if someone wouldn't mind answering.
What, if anything, can the AWS CLI team do to ensure that we're keeping the homebrew releases in sync with the latest CLI releases? We typically release 1 to 2 times a week. If we officially support this, we'll need to ensure we can have the same release cadence as our other normal release channels (pip, bundled installer, MSIs).
And if I recall correctly, there's going to be some delay no matter what because the PR for the updated CLI versions still needs to be merged into homebrew's master branch each release correct?
Again just trying to get a feel for what's involved.
@iz2140 I'd double check which pip you're using. If you install Python with Homebrew, you should have pip installed to /usr/local/bin/pip. That should install the AWS CLI into /usr/local/bin/.
@jamesls I ended up just uninstalling AWSCLI using pip and re-installing with Homebrew and everything turned out okay. Thanks though!
I’d also love to see an official Homebrew install option.
If someone wouldn't mind chiming in for some of the questions I asked here, we can explore this option further. Marking as a feature request for now.
Homebrew's contribution process is explained here: https://github.com/Homebrew/homebrew/blob/master/CONTRIBUTING.md
I'd expect a dialog with the Homebrew team after a pull request would be the best place to deal with your timing questions.
Given I've been running the same version of aws-cli from Homebrew, I'm not sure I need anything more than a weekly update.
Bump
@jamesls thank you for responding. I think I found some answers to your questions.
For virtually instantaneous synchrony, just use a URL, e.g.:
brew install https://s3.amazonaws.com/homebrew/formulae/aws-cli.rb
Run man brew to show the brew(1) manpage, and see SPECIFYING FORMULAE.
Otherwise, yes, there will likely be some delay: According to How To Open a Homebrew Pull Request (and get it merged), "[Homebrew's maintainers] typically respond to all PRs within a couple days."
Note: If you choose to add a new formula to Homebrew Core, name the formula aws-cli, not awscli, because it's called aws-cli on Github and Homebrew Formula Cookbook: A Quick Word on Naming says, "Name the formula like the project markets the product. So it’s pig-config, not pkgconfig; sdl_mixer, not ssl-mixer or sdlmixer." The same goes for the pip package name. See #2090.
Below are some more links I found that document how to create & update a Homebrew formula.
Does that answer your questions?
Best wishes & good luck in officially supporting the installation of AWS CLI via Homebrew!
If you have anymore questions, concerns, or requests, please let us know.
FYI, there are some dead links in there @mattdipasquale
Thank you, @dijonkitchen. I think I revived them all.
If the AWS team is going to go so far as to maintain their own brew recipe, they might as well go a step further and create a tap.
This explains the meaning of brew tap. https://github.com/Homebrew/brew/blob/master/docs/brew-tap.md
Essentially, what that means is that this github aws account would create a repository called [something like] "homebrew-aws" and put the recipe in there.
@jamesls should be familiar with this concept since he has done this for jmespath at https://github.com/jmespath/homebrew-jmespath So, to answer his question above I'd suggest that either add the formula to his jmespath/homebrew-jmespath or create a aws/homebrew-aws repo. Then update reference to brew at http://docs.aws.amazon.com/cli/latest/userguide/installing.html#choosing-an-installation-method to describe doing either...
brew tap jmespath/jmespath
brew install jmespath/jmespath/awscli
...or...
brew tap aws/aws
brew install aws/aws/awscli
...as an official installation method. If you do not, then for better or worse https://github.com/Homebrew/homebrew-core/blob/master/Formula/awscli.rb is what the majority of Mac users are going to be installing because this looks pretty damn official...
$ brew info awscli
awscli: stable 1.11.5 (bottled), HEAD
Official Amazon AWS command-line interface
https://aws.amazon.com/cli/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/awscli.rb
@mattdipasquale your https://s3.amazonaws.com/homebrew/formulae/aws-cli.rb url above seems to have problems.
$ curl -s https://s3.amazonaws.com/homebrew/formulae/aws-cli.rb | xmllint --format -
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AllAccessDisabled</Code>
<Message>All access to this object has been disabled</Message>
<RequestId>636AE6C270CD649F</RequestId>
<HostId>y8HMrOTA5l7SMOQM5uh0xZ5tdCumNk8td0RPLJh53kVHypP+K1s7OD8pJLSlcs70rsfzTDGEXDg=</HostId>
</Error>
@RichardBronosky I think @mattdipasquale just meant that as an example.
Another +1 for just adding the suggested info to the README for now. It seems like they've been tracking closely enough for the most part. I'm using their formula to keep aws-cli up to date, and it hasn't seemed to be a problem.
Quick analysis of time deltas between releases from the AWS team and the Homebrew maintainers here, along with the gist of the hacky bits to get to the analysis.
Is there currently any reason not to use Homebrew over pip to install and maintain AWS command line tools?
Is the procedure for migrating an existing pip-based installation to Homebrew a simple matter of
pip uninstall awsebcli
pip uninstall awscli
brew install awscli
brew install awsebcli
or is there more to it?
@orome It should work, it seems that the homebrew package is pretty up to date. However, we don't make any guarantees that it will work, so if the formula breaks then you'll need to seek help from whoever is maintaining it.