login

login $ bower login Authenticate with GitHub and store credentials. login options -t, --token: Pass an existing GitHub auth token rather than prompting for username and password

home

home $ bower home $ bower home <package> $ bower home <package>#<version> Opens a package homepage into your favorite browser. If no <package> is passed, opens the homepage of the local package.

Configuration

Bower can be configured using JSON in a .bowerrc file. For example: { "directory": "app/components/", "analytics": false, "timeout": 120000, "registry": { "search": [ "http://localhost:8000", "https://bower.herokuapp.com" ] } } Placement & Order The config is obtained by merging multiple configurations by this order of importance: CLI arguments via --config Environment variables Local .bowerrc located in the current working directory All .bowerrc files upwards

init

init $ bower init Interactively create a bower.json file

Creating Packages

bower.json Packages are defined by a manifest file bower.json. This is similar to Node’s package.json or Ruby’s Gemfile. Interactively create a bower.json with bower init $ bower init Specification Detailed specification of bower.json file can be found in bower/spec repository. Maintaining dependencies Using bower install <package> --save will add <package> to your project’s bower.json dependencies array. # install package and add it to bower.json dependencies $ bower install <pa

info

info $ bower info <package> $ bower info <package> [<property>] $ bower info <package>#<version> [<property>] Displays overall information of a package or of a particular version.

link

link $ bower link $ bower link <name> [<local name>] The link functionality allows developers to easily test their packages. Linking is a two-step process. Using ‘bower link’ in a project folder will create a global link. Then, in some other package, bower link <name> will create a link in the components folder pointing to the previously created link. This allows you to easily test a package because changes will be reflected immediately. When the link is no longer necessary, s

version

version $ bower version [<newversion> | major | minor | patch] Run this in a package directory to bump the version and write the new data back to the bower.json file. The newversion argument should be a valid semver string, or a valid second argument to semver.inc (one of “build”, “patch”, “minor”, or “major”). In the second case, the existing version will be incremented by 1 in the specified field. If run in a git repo, it will also create a version commit and tag, and fail if the repo i

search

search $ bower search $ bower search <name> Finds all packages or a specific package.

uninstall

uninstall $ bower uninstall <name> [<name> ..] [<options>] Uninstalls a package locally from your bower_components directory uninstall options -S, --save: Remove uninstalled packages from the project’s bower.json dependencies -D, --save-dev: Remove uninstalled packages from the project’s bower.json devDependencies