Clone all repositories from a Bitbucket workspace.
Project description
Bucketcloner
Simple tool to list all your bitbucket workspaces and clone (all) repositories associated with these workspaces.
Requirements
- You need to know your Bitbucket account email. Can be found at https://bitbucket.org/account/settings/email/.
- You need to create an API token here https://id.atlassian.com/manage-profile/security/api-tokens with read permissions for account, workspace membership and repositories.
| Command | Scopes |
|---|---|
| workspace | read:user:bitbucket, read:workspace:bitbucket |
| clone | read:user:bitbucket, read:workspace:bitbucket, read:repository:bitbucket |
| project | read:user:bitbucket, read:workspace:bitbucket, read:project:bitbucket |
Install bucketcloner either by cloning this repository and running pip install . or by installing it via pip install bucketcloner. Minimum required python version is 3.9.
Alternatively, you can run bucketcloner using uvx: uvx bucketcloner --help
Authentication for cloning the repository can be done via https and the API token or using an SSH key. IMPORTANT: When using ssh make sure you have added the bitbucket server ssh fingerprint to the known hosts, otherwise the command will fail. Run git clone git@bitbucket.org:... once manually to make sure the key is added.
You can pass your ssh key with --ssh-key, otherwise the users default ssh key will be used.
List all workspaces
bucketcloner -e <email> -t <api_token> workspace
This lists all workspaces, including your personal workspace, where you have access.
Clone workspace(s)
You can clone all repositories of all workspaces by simply calling
bucketcloner -e <email> -t <api_token> clone
This clones all repositories of all workspaces into the folders workspace/repository relative to the current directory.
To select specific workspace(s), add the -w option with workspace slug names separated by commas
bucketcloner -e <email> -t <api_token> -w workspace1,workspace2 clone
All existing repositories in the folders will be deleted and cloned again. To just skip existing repositories, add --skip-existing flag.
bucketcloner -e <email> -t <api_token> -w workspace1,workspace2 --skip-existing clone
Clone all repos from all workspaces with project PRO1 into /tmp with folder structure workspace/project/repo.
bucketcloner -e <email> -t <api_token> --project PRO1 --base-folder /tmp --project-folder clone
Clone all repos using an ssh key
bucketcloner -e <email> -t <api_token> --base-folder /tmp --auth-mode ssh --ssh-key "/my/id_rsa" clone
List all projects in all workspaces
bucketcloner -e <email> -t <api_token> project
Python example
The example.ipynb includes an example how to read the workspaces and download the repositories from within python.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bucketcloner-0.3.0.tar.gz.
File metadata
- Download URL: bucketcloner-0.3.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8ceab717eeb544c0ed2b3f7834c48b68511e3a2d8e4c3f8b660a3f0354274a
|
|
| MD5 |
57c96c983e9e6632ad07715bace1c2e8
|
|
| BLAKE2b-256 |
71abacfe7cbc330bbdd15fa6864e20076d922e271864ea45a33cd7be62e7a17f
|
Provenance
The following attestation bundles were made for bucketcloner-0.3.0.tar.gz:
Publisher:
publish.yml on phillies/bucketcloner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bucketcloner-0.3.0.tar.gz -
Subject digest:
1c8ceab717eeb544c0ed2b3f7834c48b68511e3a2d8e4c3f8b660a3f0354274a - Sigstore transparency entry: 785675583
- Sigstore integration time:
-
Permalink:
phillies/bucketcloner@2721340d1f41fbf1149dcbf82dd2c79eec44b2b2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/phillies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2721340d1f41fbf1149dcbf82dd2c79eec44b2b2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bucketcloner-0.3.0-py3-none-any.whl.
File metadata
- Download URL: bucketcloner-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7e4875032fc952174531d09f1b34d89bba2a6ae2aba7357bf3fb972f83631f8
|
|
| MD5 |
8d3f5e12612491c41444521d28e8bd27
|
|
| BLAKE2b-256 |
ad8aa435014fe951b1380a482faa6dc776dbb64bec59792bb4fa75015b14ae91
|
Provenance
The following attestation bundles were made for bucketcloner-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on phillies/bucketcloner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bucketcloner-0.3.0-py3-none-any.whl -
Subject digest:
e7e4875032fc952174531d09f1b34d89bba2a6ae2aba7357bf3fb972f83631f8 - Sigstore transparency entry: 785675584
- Sigstore integration time:
-
Permalink:
phillies/bucketcloner@2721340d1f41fbf1149dcbf82dd2c79eec44b2b2 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/phillies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2721340d1f41fbf1149dcbf82dd2c79eec44b2b2 -
Trigger Event:
release
-
Statement type: