Skip to main content

bitbucket-helper

Bitbucket-helper is a command-line utility for working with lots of bitbucket server projects and repositories. This handy helper allows you to clone or pull every bitbucket repository you have access too. Repositories are pathed under their parent project, making it easy to identify the source project.

Installation

The utility requires python3.7.

pip install bitbucket-helper

Setup

The first time you attempt to sync, you will get prompted to provide your bitbucket details. The tool supports both Bitbucket Server and Bitbucket Cloud.

Bitbucket Server requires a read-only personal access token. To generate goto Bitbucket -> Manage account -> Personal Access Tokens.

BitBucket Cloud requires an App Password if you use 2FA. The App needs to be granted read access.

All configuration settings get stored in ~/.bitbucket-helper.config. To reconfigure you can delete this file.

Listing Repositories

To list all of the repositories, you have permission to access:

bitbucket-helper repo

The command outputs the following quoted comma-separated values:

"project_key","clone_uri"

Synchronising

The synchronisation function uses bitbucket APIs to get all accessible projects and repositories. For each project, it will create a directory using its key. For each repository, we perform a git clone or a git pull if we already have a local copy. After the pull, we prune and delete local branches that have been merged at the origin.

Local directory structure:

  • working_directory (~/bitbucket-server)
    • proj1
      • repo1
      • repo2
    • proj2
      • repo1
      • repo2
bitbucket-helper sync

Pull requests

Bitbucket helper can list pull requests across all of your repositories. By default it returns OPEN pull requests, you can also filter for pull requests in a specific state, e.g. ALL, OPEN, MERGED, DECLINED.

bitbucket-helper pr --state=MERGED

Git log commands

Bitbucket helper makes it easy to search for commits across all of your repositories using simple filters. Log commands operate on locally synched repositories, so remember to do a bitbucket-helper sync first.

You can find all commits after a specified date using:

bitbucket-helper log --after=2020-03-02

To search from commits between two tags:

bitbucket-helper log --from_tag=1.9.0 --to_tag=1.9.1

Create a Snyk Import File

Snyk created an import utility to help import projects into BitBucket Cloud. The utility supports stable imports by pacing to avoid rate limiting and by implementing retries.

The import tool requires an import configuration file that bitbucket-helper can generate for you.

To generate an import configuration:

bitbucket-helper snyk:import --owner <repositoryOwner> --orgid <snykOrganisationId> --integrationid <snykIntegrationId> --outfile /tmp/import-projects.json

Find out more

You can find out more here

Metadata

Release files for bitbucket-helper 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitbucket-helper 0.1.7
File Size Uploaded Provenance
bitbucket-helper-0.1.7.tar.gz 7.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bitbucket-helper 0.1.7
File Interpreter ABI Platform
bitbucket_helper-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / bitbucket-helper-0.1.7.tar.gz

Download URL bitbucket-helper-0.1.7.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8201bc4ffa06860f022aa4e2b3de02abfca51ae4339bcfd2e106c5e27648d5d8
BLAKE2b-256 checksum
How to use checksums
5854591fa037ffaf3f2cf2f5b6385d9a3dda7a9f633620a4ad99db4af42c40a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.10

Release files / bitbucket_helper-0.1.7-py3-none-any.whl

Download URL bitbucket_helper-0.1.7-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d67e902a673f758e5e5f64fd3796e39d744973b2ed786bdb436e15ffd3206a1b
BLAKE2b-256 checksum
How to use checksums
849f02cb7c3a6b0dd20a69fab741fba51af23c438e0a529ca4c27a251013e18b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.10

Security for bitbucket-helper 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page