npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

bitbucket-ops

v1.1.0

Published

CLI tool for managing Bitbucket repository and deployment configurations through YAML templates

Readme

Bitbucket Ops CLI

Build Status npm version License

A command-line interface tool for managing Bitbucket repository and deployment variables through configuration templates.

Features

  • 📝 Create configuration templates for Bitbucket repositories
  • 🔧 Manage repository and deployment variables
  • 🔐 Secure handling of secrets through environment variables
  • 📦 Auto-generate templates from .env files
  • ✅ Validate templates before execution
  • 🚀 Simple DevOps workflow integration

Installation

Using npm (Global Installation)

npm install -g @alpharedsolutions/bitbucket-ops

Using npx (No Installation Required)

npx @alpharedsolutions/bitbucket-ops [command]

Using Yarn

yarn global add @alpharedsolutions/bitbucket-ops

Quick Start

After installation, you can use the CLI with bo (short alias) or bitbucket-ops command:

# Show help
bo --help

# Initialize a template from .env file
bo template init --name api-config

# Validate a template
bo template validate --template config.yaml

# Apply configuration (dry run)
bo apply --template config.yaml --dry-run

# Apply configuration
bo apply --template config.yaml

Usage

Initialize Template from Environment File

# Auto-detect .env.sample or .env file
bo template init --name my-config

# Use specific env file
bo template init --name my-config --env-file .env.production

# Non-interactive mode with auto-detection
bo template init --name my-config --auto

Template Management

# List available templates
bo template list

# Show template details
bo template show --template config.yaml

# Validate template
bo template validate --template config.yaml

Apply Configuration

# Preview changes without applying
bo apply --template config.yaml --dry-run

# Apply configuration
bo apply --template config.yaml

List Variables

# List repository variables
bo list variables --template config.yaml

# List deployment variables
bo list deployment-variables --template config.yaml --environment production

Template Format

Templates use YAML format and support environment variable resolution:

version: "1.0.0"
metadata:
  name: "api-service-config"
  description: "Configuration for API service"

repository:
  url: "https://bitbucket.org/company/api-service"
  
variables:
  repository:
    - name: "API_KEY"
      type: "secret"
      value: "${ENV:API_KEY}"
      required: true
    
    - name: "API_ENDPOINT"
      type: "plain"
      value: "https://api.production.com"
      required: true

deployments:
  - name: "production"
    environment_type: "Production"
    variables:
      - name: "DATABASE_URL"
        type: "secret"
        value: "${ENV:PROD_DATABASE_URL}"
        required: true

Authentication

The Bitbucket CLI supports two authentication methods:

API Token (Recommended)

API tokens provide secure access to Bitbucket's REST API:

  1. Create an API token (App Password) at: https://bitbucket.org/account/settings/app-passwords/
  2. Grant permissions: Repository (Read, Write, Admin), Pipelines (Read, Write, Variables)
  3. Set environment variables:
export BITBUCKET_CLOUD_USERNAME="your-username"
export BITBUCKET_CLOUD_API_TOKEN="your-api-token"

OAuth 2.0 (Alternative)

OAuth provides automatic token refresh and more granular permissions:

  1. Create an OAuth consumer at: https://bitbucket.org/{workspace}/workspace/settings/oauth-consumers
  2. Set the callback URL to: http://localhost:8080/callback
  3. Grant required permissions: account, repository (read/write/admin), pipeline (read/write/variable)
  4. Set environment variables:
export BITBUCKET_OAUTH_CLIENT_ID="your-oauth-client-id"
export BITBUCKET_OAUTH_CLIENT_SECRET="your-oauth-client-secret"

See OAuth Setup Guide for detailed instructions.

Note: API tokens are the simplest and most reliable authentication method for CLI tools.

Development

Prerequisites

  • Node.js >= 18.0.0
  • TypeScript

Setup

# Clone the repository
git clone https://bitbucket.org/alpharedsolutions/bitbucket-ops.git
cd bitbucket-ops

# Install dependencies
npm install

# Build
npm run build

# Run locally
npm run dev

Publishing to NPM

# Build the project
npm run build

# Publish to NPM
npm publish --access public

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues and feature requests, please visit: https://bitbucket.org/alpharedsolutions/bitbucket-ops/issues

npx claude-flow@alpha swarm "implement tasks according to ./PRD.md" --claude