Skip to content

Repository files navigation

rtbrick/tools

License Go Version Module

1. Overview

rtbrick/tools is a collection of CLI tools for the RtBrick platform.

2. Tools

Tool Description

rtb-buddy

Multipurpose helper tool for the RtBrick fullstack. See documentation.

3. Installation

3.1. Quick Install

curl -fsSL https://raw.githubusercontent.com/rtbrick/tools/main/install_rtb_buddy.sh | sudo bash

This detects your OS and architecture, downloads the latest release from GitHub, verifies the checksum, and installs rtb-buddy to /usr/local/bin.

3.2. Options

# Install a specific version
curl -fsSL https://raw.githubusercontent.com/rtbrick/tools/main/install_rtb_buddy.sh | sudo bash -s -- --version v1.0.0

# Install to a custom directory
curl -fsSL https://raw.githubusercontent.com/rtbrick/tools/main/install_rtb_buddy.sh | bash -s -- --dir ~/.local/bin

# Uninstall
curl -fsSL https://raw.githubusercontent.com/rtbrick/tools/main/install_rtb_buddy.sh | sudo bash -s -- --uninstall

3.3. Homebrew (macOS)

brew install rtbrick/tap/rtb-buddy

3.4. From Source

git clone https://github.com/rtbrick/tools.git
cd tools
make build
sudo cp rtb-buddy /usr/local/bin/

4. Development

4.1. Prerequisites

4.2. Make Targets

make build    # Build the rtb-buddy binary
make test     # Run all tests
make fmt      # Format source code
make lint     # Run golangci-lint
make vet      # Run go vet
make clean    # Remove built binaries

5. Contributing

We welcome contributions! Please follow these guidelines:

5.1. Reporting Issues

  • Search existing issues first to avoid duplicates

  • Use the issue template if available

  • Include: steps to reproduce, expected vs actual behavior, environment

5.2. Pull Requests

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/my-change

  3. Make your changes with clear, focused commits

  4. Run make fmt and make lint before committing

  5. Add tests for new functionality

  6. Open a PR with a descriptive title and description

5.3. Code Style

  • Follow standard Go conventions (gofmt, golint)

  • Keep functions small and focused

  • Document exported types and functions with Go doc comments

  • Update documentation when behavior changes

5.4. Commit Messages

Use conventional commits format:

<type>(<scope>): <subject>

<body>

<footer>

Examples: * feat(rtb-buddy): add --aud flag for token audience * fix(utils): handle empty KID in JWKS lookup * docs: update shell completion instructions

6. Testing the Release Workflow

6.1. Prerequisites

  • GoReleaser v2+ (go install github.com/goreleaser/goreleaser/v2@latest)

  • jq (for install script testing)

6.2. Step 1: Snapshot Build (Local)

Test cross-compilation and archive creation without publishing:

make snapshot

This builds all 6 binaries (linux/darwin/windows × amd64/arm64) and outputs them to dist/. Verify:

ls dist/
dist/rtb-buddy_linux_amd64/
dist/rtb-buddy_darwin_arm64/
dist/checksums.txt
...

# Test the local binary
./dist/rtb-buddy_linux_amd64/rtb-buddy version

6.3. Step 2: CI Workflow (PR)

Push a branch and open a PR to verify lint and tests run:

git checkout -b test-ci
git add . && git commit -m "ci: test workflow"
git push -u origin test-ci
# Open a PR → CI runs automatically

6.4. Step 3: Pre-Release (Full End-to-End)

Create a pre-release tag to test the full release pipeline:

git tag v0.0.1-rc.1
git push --tags

This triggers the release workflow which:

  1. Builds all binaries via GoReleaser

  2. Creates a GitHub release at https://github.com/rtbrick/tools/releases/tag/v0.0.1-rc.1

  3. Pushes a Homebrew formula to rtbrick/homebrew-tap

6.5. Step 4: Test the Install Script

# Test against the pre-release
curl -fsSL https://raw.githubusercontent.com/rtbrick/tools/main/install_rtb_buddy.sh | sudo bash -s -- --version v0.0.1-rc.1

# Verify
rtb-buddy version

6.6. Step 5: Cleanup

Delete the test release and tag:

gh release delete v0.0.1-rc.1 --yes --cleanup-tag

6.7. Quick Reference

Command What it tests

make snapshot

Local cross-compilation, archives, checksums

Push branch + open PR

CI workflow (lint + test)

git tag v0.0.1-rc.1 && git push --tags

Full release pipeline (build + publish + Homebrew)

curl …​ | sudo bash -s — --version v0.0.1-rc.1

Install script (download + checksum + install)

rtb-buddy version

Version injection via ldflags

7. License

BSD 3-Clause License — see the LICENSE file for details.

Copyright (c) 2026, RtBrick

7.1. SPDX Identifier

BSD-3-Clause

About

tools project for rtbrick rbfs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages