pbuf-cli

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

README.md for PowerBuf CLI


PowerBuf CLI

The pbuf is a Command Line Interface (CLI) tool for PowerBuf, allowing you to easily manage, and vendor modules.


Installation

To use pbuf, you must first ensure that you have Go installed on your system. After that, install application from source using the following commands:

go install github.com/pbufio/pbuf-cli

Usage

General Structure

The general structure of commands is:

pbuf [command] [arguments...]
Available Commands
  1. Vendor

    The vendor command allows you to vendor modules from provided configuration.

    pbuf vendor
    

    By default, this command reads the configuration from pbuf.yaml. The configuration provides details like the repository, branch or tag, path, and output directory for each module.


Configuration (pbuf.yaml)

A typical pbuf.yaml file contains the following:

version: "1.0"
modules:
  - repository: [repository_url]
    path: [path_in_repository]
    branch: [branch_name]
    tag: [tag_name]
    out: [output_folder_on_local]

Replace placeholders with appropriate values:

  • [repository_url]: The URL of the Git repository.
  • [path_in_repository]: Path to the folder or file in the repository you want to vendor.
  • [branch_name]: Specific branch name to clone (optional if tag is provided).
  • [tag_name]: Specific tag to clone (optional if branch is provided).
  • [output_folder_on_local]: Folder where the vendored content should be placed on your local machine.
Examples
version: v1
modules:
  # will copy examples/addressbook.proto file to proto/addressbook.proto
  - repository: https://github.com/protocolbuffers/protobuf
    path: examples/addressbook.proto
    branch: main
    out: proto
   # will copy examples folder to examples folder
  - repository: https://github.com/protocolbuffers/protobuf
    path: examples
    tag: v24.4

Private repositories and authentication

To authenticate with repositories that require authentication, pbuf uses .netrc file. Ensure your .netrc file is properly configured in your home directory with credentials.


Contribution

If you'd like to contribute to pbuf, feel free to fork the repository and send us a pull request!


We hope you find pbuf useful for your projects!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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