bbctl

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

README

bbctl

bbctl is a CLI tool for managing repositories and automation in Bitbucket Server / Data Center environments.
It provides streamlined support for repository creation, deletion, and updating

✨ Features

  • Management multiple repositories from multiple projects
  • Getting additional information about repository using manifest file from the root of the repository
  • Parallel processing for high-performance bulk operations
  • YAML input/output for full GitOps compatibility
  • Easy configuration via .env file

Configuration

Add .env properties file like below or provide command line keys. For details see --help

BITBUCKET_BASE_URL=https://bitbucket-server.local
BITBUCKET_TOKEN=<token>

Examples

  1. List repos
$ bbctl get repos -p PRJ
Name        Archived  State      Project
my repo     false     AVAILABLE  PRJ
myrepo      false     AVAILABLE  PRJ
new repo    false     AVAILABLE  PRJ
new repo 1  false     AVAILABLE  PRJ
test        false     AVAILABLE  PRJ
test-1      false     AVAILABLE  PRJ

$ bbctl get repo test -p PRJ
Name  Archived  State      Project
test  false     AVAILABLE  PRJ

  1. Create repos
$ cat out/create_repos.yaml 
repos:
  - name: "Repo1"
    project: "PRJ"
    description: "My first repo 1111"
  - name: "Repo2"
    slug: "my-repo-2"
    project: "PRJ"

$ bbctl create repos -f out/create_repos.yaml 
time=2025-08-11T15:15:09.064+03:00 level=INFO msg="Repository created successfully" name=Repo1 slug=""
time=2025-08-11T15:15:09.071+03:00 level=INFO msg="Repository created successfully" name=Repo2 slug=my-repo-2

  1. Delete repos
$ cat out/delete_repos.yaml 
repos:
  - slug: "repo1"
    project: "PRJ"
  - slug: "my-repo-2"

$ bbctl delete repos -f out/repos.yaml 
time=2025-08-11T15:16:46.120+03:00 level=ERROR msg="Repository slug is missing" project=PRJ
time=2025-08-11T15:16:46.279+03:00 level=INFO msg="Repository deleted successfully" project=PRJ slug=my-repo-2

  1. Update repos
$ cat out/update_repos.yaml 
repos:
  - name: "Repo1"
    slug: "repo1"
    project: "PRJ"
    description: "My first repo"
  - name: "Repo2"
    slug: "repo2"
    project: "PRJ"

$ bbctl apply repos -f out/update_repos.yaml 
time=2025-08-11T15:24:33.724+03:00 level=INFO msg="Repository updated successfully" name=Repo2 slug=repo2
time=2025-08-11T15:24:33.799+03:00 level=INFO msg="Repository updated successfully" name=Repo1 slug=repo1

💰 Support the project

Donate on Boosty

Donate TON via NowPayments

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
get

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL