Bucket
A Command Line Interface for BitBucket.
For now, only git is supported. Mercurial support is planned.
Installation
Add this line to your application's Gemfile:
gem 'bucket-cli'And then execute:
$ bundleOr install it yourself as:
$ gem install bucket-cliUsage
Setup
After the installation, you can run
$ bucket setupto start the configuration.
You need to add your BitBucket username and password (for now it's saved in plaintext in ~/.bucket with a permission bit of 0600, in the future this will change for oauth authorization).
Init repository
You can initialize a new repository (as in doing git init), and automagically creating the repository on BitBucket and adding the remote to origin.
$ bucket init DIRECTORYThis will create a new (private) repository in DIRECTORY (can be . for current directory), and create a repository named after the destination folder (or as specified in the options) in your BitBucket account.
Options
--name NAME A name for the repository in BitBucket
--description DESC A description for the repository in BitBucket
--public Mark the repository as public (private by default)
Cloning
You can clone a repository directly from BitBucket with
$ bucket clone [USER]/REPOSITORYwhere REPOSITORY is the repository name.
If [USER] is not supplied, it's assumed you want a repository from your own account. For example, if you want to clone the bucket-cli repository from your own account you can just use
$ bucket clone bucket-clibut if it's from another account you need to specify it
$ bucket clone xaro/bucket-cliListing repositories
You can list the repositories associated with your account by using
$ bucket reposTODO
- Improve error reporting (and exceptions catching)
- Add more commands
- Shallow redirect commands to git / mercurial
- Replace bitbucket api gem (it has too many dependencies and is not complete)
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request