Clone wiki

bucket / Home

bucket command reference

bucket is a command line program to interact with bitbucket.org from console.

Anonymous examples (no account)

With absent config file ($HOME/.bucket)

List all public atlassian repositories:

$ bucket ls atlassian
-- owner 'atlassian' has 389 repositories
........................................................ [...]
atlassian/10-year-anniversary-raffle
atlassian/3rd_library
atlassian/agent-charlie
[...]
atlassian/xhtmlrenderer-atlassian
atlassian/xmlrpc-binder
atlassian/xmlrpc-supplementary-character-support
atlassian/xwarppointer
-- ok

Get info for a public repo:

$ bucket info atlassian/snippet
full name:   atlassian/snippet
name:        snippet
description: A command-line interface for creating, inspecting, and editing Bitbucket Snippets.
scm:         git
is private:  False
size:        812937
updated on:  2015-06-23T19:55:00.159697+00:00
-- ok

Authenticated use

Default account

List all JohnDoe repositories:

$ bucket ls

If the file $HOME/.bucket contains:

[ui]
  [[account]]
  default = JohnDoe:secret

Explicit account

List all (public and private) JohnDoe repositories:

$ bucket --account JohnDoe:secret ls

Selecting account by label

List all JackMay repositories. Note JackMay is not the default account:

$ bucket --account jack ls

File $HOME/.bucket contains:

[ui]
  [[account]]
  default = JohnDoe:secret
  jack = JackMay:password

Inline password

Skip password in account specifications (--account argument or config file) forces bucket to ask you:

$ bucket --account JackMay: ls
JackMay's password?

The same specification may be done in the config file:

[ui]
  [[account]]
  default = JohnDoe:secret
  jack = JackMay:

Repository creation

Create a repo in the default account:

$ bucket create /doom4

Create a repo with a specific owner (assuming you have permissions):

$ bucket create JackMay/doom4

You may specify the SCM to use (hg is default):

$ bucket create --git JackMay/doom4

Cloning

Clone a repository owned by the default configured account:

$ bucket clone /quake3

Clone any repository. Assume the repository is public or read access is granted for the configured default account:

$ bucket clone JackMay/lemmings

Using SSH to clone the repo (default is 'https')). Note that ssh requires you have a configured public key in your bitbucket account:

$ bucket clone --ssh /quake3

To specify SSH as default protocol write down next in your $HOME/.bucket file:

[ui]
  [[cmd:clone]]
  proto = ssh

Syncing

clone/update given repositories to the specified directory. Useful for backup purposes, issue tracker integration, etc.

Sync all default account repositories:

$ bucket sync

Sync'john' repositories to '/var/repos' directory:

$ bucket sync --owner john --destdir /var/repos

The arguments destdir and proto may be set by config file as:

[ui]
  [[cmd:clone]]
  destdir = /wherever/you/want
  proto = ssh

Using that configuration you may backup (clone/pull/update) all your repos to /wherever/you/want using SSH transport just writing:

$ bucket sync

Configuration

bucket gets preferences from the next places and priority (more to less):

  • command line arguments
  • config file specified at command line (--config argument)
  • $HOME/.bucket file

Updated