diff --git a/.goreleaser.yml b/.goreleaser.yml index fdb5fa3..3a95759 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,11 +1,11 @@ version: 2 -project_name: req +project_name: breq builds: - - id: req - main: ./cmd/req - binary: req + - id: breq + main: ./cmd/breq + binary: breq env: - CGO_ENABLED=0 goos: @@ -21,8 +21,8 @@ builds: - -trimpath archives: - - id: req - name_template: "req_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + - id: breq + name_template: "breq_{{ .Version }}_{{ .Os }}_{{ .Arch }}" formats: - tar.gz - zip @@ -37,10 +37,10 @@ archives: - none* nfpms: - - id: req - package_name: req + - id: breq + package_name: breq ids: - - req + - breq vendor: BlueFunda maintainer: BlueFunda description: Cross-platform CLI for the bluerequests change and release management platform. @@ -48,14 +48,14 @@ nfpms: formats: - deb - rpm - bindir: /opt/req/bin + bindir: /opt/breq/bin contents: - - dst: /opt/req/etc + - dst: /opt/breq/etc type: dir - - dst: /opt/req/log + - dst: /opt/breq/log type: dir - - dst: /usr/local/bin/req - src: /opt/req/bin/req + - dst: /usr/local/bin/breq + src: /opt/breq/bin/breq type: symlink notarize: @@ -70,11 +70,11 @@ notarize: key: "{{ .Env.NOTARIZATION_KEY }}" homebrew_casks: - - name: req + - name: breq ids: - - req + - breq binaries: - - req + - breq homepage: https://github.com/bluefunda/bluerequests description: CLI for the bluerequests change and release management platform directory: Casks @@ -102,9 +102,9 @@ release: name: bluerequests draft: false replace_existing_draft: true - name_template: "req v{{ .Version }}" + name_template: "breq v{{ .Version }}" header: | - ## bluerequests CLI (req) v{{ .Version }} + ## bluerequests CLI (breq) v{{ .Version }} Cross-platform CLI for the bluerequests change and release management platform. @@ -113,7 +113,7 @@ release: **Homebrew (macOS):** ```bash brew tap bluefunda/tap - brew install --cask req + brew install --cask breq ``` **One-line installer (macOS and Linux):** @@ -123,30 +123,30 @@ release: **Debian/Ubuntu (x86_64):** ```bash - curl -sL https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/req_{{ .Version }}_linux_amd64.deb -o req.deb - sudo dpkg -i req.deb + curl -sL https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/breq_{{ .Version }}_linux_amd64.deb -o breq.deb + sudo dpkg -i breq.deb ``` **Debian/Ubuntu (ARM64):** ```bash - curl -sL https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/req_{{ .Version }}_linux_arm64.deb -o req.deb - sudo dpkg -i req.deb + curl -sL https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/breq_{{ .Version }}_linux_arm64.deb -o breq.deb + sudo dpkg -i breq.deb ``` **RHEL / Fedora / Rocky (x86_64):** ```bash - sudo dnf install https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/req_{{ .Version }}_linux_amd64.rpm + sudo dnf install https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/breq_{{ .Version }}_linux_amd64.rpm ``` **RHEL / Fedora / Rocky (ARM64):** ```bash - sudo dnf install https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/req_{{ .Version }}_linux_arm64.rpm + sudo dnf install https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/breq_{{ .Version }}_linux_arm64.rpm ``` **Linux (manual):** ```bash - curl -sL https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/req_{{ .Version }}_linux_amd64.tar.gz | tar xz - chmod +x req && sudo mv req /usr/local/bin/ + curl -sL https://github.com/bluefunda/bluerequests/releases/download/v{{ .Version }}/breq_{{ .Version }}_linux_amd64.tar.gz | tar xz + chmod +x breq && sudo mv breq /usr/local/bin/ ``` snapshot: diff --git a/AGENTS.md b/AGENTS.md index 34d410b..b46e68b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,10 +6,10 @@ Instructions for AI coding agents working on bluerequests. Go 1.25 CLI for the BlueFunda bluerequests change/release management platform. All requests flow through `trm-bff` via gRPC — the CLI never talks to NATS or backend services directly. -Binary name: `req` +Binary name: `breq` Module: `github.com/bluefunda/bluerequests` -Entry point: `cmd/req/main.go` -Config location: `~/.req/config.yaml` +Entry point: `cmd/breq/main.go` +Config location: `~/.breq/config.yaml` ## Build and Test Commands @@ -35,7 +35,7 @@ All must pass with zero errors before committing. ## Project Structure ``` -cmd/req/main.go # Entry point: invokes root command +cmd/breq/main.go # Entry point: invokes root command api/proto/ bff.proto # BFFService definition — keep in sync with trm-bff bff/ @@ -57,7 +57,7 @@ internal/ auth/ auth.go # OAuth2 device authorization grant (RFC 8628) config/ - config.go # ~/.req/config.yaml loader; token storage + config.go # ~/.breq/config.yaml loader; token storage ui/ output.go # Printer: table/json/quiet output modes scripts/ @@ -72,16 +72,16 @@ scripts/ | `req events sub` | SubscribeEvents | Stream realm-scoped events | | `req events pub` | PublishEvent | Publish event to NATS subject | | `req rpc request` | RequestReply | NATS request-reply | -| `req cr list` | ListChangeRequests | List change requests with filters | -| `req cr get` | GetChangeRequest | Get a single change request by ID | -| `req cr create` | CreateChangeRequest | Create a new change request | -| `req cr update` | UpdateChangeRequest | Update fields on a change request | -| `req cr delete` | DeleteChangeRequest | Archive a change request | -| `req cr stage` | UpdateChangeRequestStage | Advance the workflow stage | -| `req cr comment list` | ListComments | List comments on a change request | -| `req cr comment add` | AddComment | Add a comment | -| `req cr comment update` | UpdateComment | Edit a comment | -| `req cr comment delete` | DeleteComment | Delete a comment | +| `breq cr list` | ListChangeRequests | List change requests with filters | +| `breq cr get` | GetChangeRequest | Get a single change request by ID | +| `breq cr create` | CreateChangeRequest | Create a new change request | +| `breq cr update` | UpdateChangeRequest | Update fields on a change request | +| `breq cr delete` | DeleteChangeRequest | Archive a change request | +| `breq cr stage` | UpdateChangeRequestStage | Advance the workflow stage | +| `breq cr comment list` | ListComments | List comments on a change request | +| `breq cr comment add` | AddComment | Add a comment | +| `breq cr comment update` | UpdateComment | Edit a comment | +| `breq cr comment delete` | DeleteComment | Delete a comment | ## Adding a New Command @@ -152,5 +152,5 @@ Follows `bluefunda` org-level standards: - Connect to NATS, trm-backend-go, or Keycloak directly from the CLI — all traffic goes through `trm-bff` via gRPC - Edit `api/proto/bff/bff.pb.go` or `bff_grpc.pb.go` by hand — regenerate with `make proto` -- Commit tokens, credentials, or `~/.req/` contents +- Commit tokens, credentials, or `~/.breq/` contents - Modify `.github/workflows/` without explicit request diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ccf4183..dce614b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ Open a [GitHub Issue](https://github.com/bluefunda/bluerequests/issues) with: - A clear description of the problem - Steps to reproduce - Expected vs actual behavior -- Version (`req version`) and OS/arch +- Version (`breq version`) and OS/arch ## License diff --git a/Dockerfile b/Dockerfile index f1d742b..45d8f75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,9 @@ COPY . . ARG VERSION=dev RUN CGO_ENABLED=0 go build \ -ldflags "-X github.com/bluefunda/bluerequests/internal/cmd.Version=${VERSION}" \ - -o /req ./cmd/req + -o /breq ./cmd/req FROM alpine:3.21 RUN apk --no-cache add ca-certificates -COPY --from=builder /req /usr/local/bin/req -ENTRYPOINT ["req"] +COPY --from=builder /breq /usr/local/bin/req +ENTRYPOINT ["breq"] diff --git a/Makefile b/Makefile index 3e51c1f..6d184a8 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ .PHONY: build clean vet fmt tidy test proto snapshot release -BINARY := req +BINARY := breq VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev) LDFLAGS := -ldflags "-X github.com/bluefunda/bluerequests/internal/cmd.Version=$(VERSION)" build: tidy - go build $(LDFLAGS) -o $(BINARY) ./cmd/req + go build $(LDFLAGS) -o $(BINARY) ./cmd/breq clean: rm -f $(BINARY) diff --git a/README.md b/README.md index b8cc7f4..2ed6ec7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Release](https://img.shields.io/github/v/release/bluefunda/bluerequests)](https://github.com/bluefunda/bluerequests/releases) [![CI](https://github.com/bluefunda/bluerequests/actions/workflows/ci.yml/badge.svg)](https://github.com/bluefunda/bluerequests/actions/workflows/ci.yml) -**`req`** — A terminal-native CLI for the BlueRequests change and release management platform. Manage SAP transport requests, change orders, and release workflows from the command line or an interactive TUI dashboard. +**`breq`** — A terminal-native CLI for the BlueRequests change and release management platform. Manage SAP transport requests, change orders, and release workflows from the command line or an interactive TUI dashboard. ## Features @@ -24,7 +24,7 @@ ```bash brew tap bluefunda/tap -brew install --cask req +brew install --cask breq ``` ### One-line installer (macOS and Linux) @@ -36,20 +36,20 @@ curl -fsSL https://raw.githubusercontent.com/bluefunda/bluerequests/main/install ### Debian / Ubuntu ```bash -curl -sL https://github.com/bluefunda/bluerequests/releases/latest/download/req_linux_amd64.deb -o req.deb -sudo dpkg -i req.deb +curl -sL https://github.com/bluefunda/bluerequests/releases/latest/download/breq_linux_amd64.deb -o breq.deb +sudo dpkg -i breq.deb ``` ### RHEL / Fedora / Rocky ```bash -sudo dnf install https://github.com/bluefunda/bluerequests/releases/latest/download/req_linux_amd64.rpm +sudo dnf install https://github.com/bluefunda/bluerequests/releases/latest/download/breq_linux_amd64.rpm ``` ### From source ```bash -go install github.com/bluefunda/bluerequests/cmd/req@latest +go install github.com/bluefunda/bluerequests/cmd/breq@latest ``` ### Manual download @@ -60,30 +60,30 @@ Download the latest binary for your platform from the [Releases](https://github. ```bash # Authenticate with the bluerequests platform -req login +breq login # Open the interactive TUI dashboard req # List change requests -req cr list +breq cr list # Create a change request -req cr create --project PROJ-1 --description "Hotfix for order processing" +breq cr create --project PROJ-1 --description "Hotfix for order processing" # View a specific change request -req cr get --id +breq cr get --id # Advance a change request to the next stage -req cr stage --id +breq cr stage --id # Check connection health -req health +breq health ``` ## TUI Usage -Launch the interactive dashboard by running `req` with no arguments: +Launch the interactive dashboard by running `breq` with no arguments: ``` req @@ -103,7 +103,7 @@ req ## CLI Reference ``` -req [command] [flags] +breq [command] [flags] Commands: login Authenticate via OAuth device flow @@ -125,56 +125,56 @@ Global Flags: ```bash # List change requests -req cr list -req cr list --project PROJ-1 -req cr list --status pending --severity high +breq cr list +breq cr list --project PROJ-1 +breq cr list --status pending --severity high # Get a specific change request -req cr get --id +breq cr get --id # Create a change request -req cr create --project PROJ-1 --description "My change" +breq cr create --project PROJ-1 --description "My change" # Update fields -req cr update --id --description "Updated description" +breq cr update --id --description "Updated description" # Advance workflow stage -req cr stage --id +breq cr stage --id # Archive (soft delete) -req cr delete --id +breq cr delete --id # Comment management -req cr comment list --id -req cr comment add --id --message "Approved for prod" -req cr comment update --id --comment-id --message "Revised" -req cr comment delete --id --comment-id +breq cr comment list --id +breq cr comment add --id --message "Approved for prod" +breq cr comment update --id --comment-id --message "Revised" +breq cr comment delete --id --comment-id ``` ### Shell Completion ```bash # bash -req completion bash > /etc/bash_completion.d/req +breq completion bash > /etc/bash_completion.d/req # zsh -req completion zsh > "${fpath[1]}/_req" +breq completion zsh > "${fpath[1]}/_req" # fish -req completion fish > ~/.config/fish/completions/req.fish +breq completion fish > ~/.config/fish/completions/req.fish ``` ## Workflow Concepts -**Stages** represent the approval lifecycle of a change request — typically Draft → Review → Approved → Released. The `req cr stage` command advances a change request to the next stage. +**Stages** represent the approval lifecycle of a change request — typically Draft → Review → Approved → Released. The `breq cr stage` command advances a change request to the next stage. -**Events** are emitted at each stage transition and can be subscribed to with `req events`. +**Events** are emitted at each stage transition and can be subscribed to with `breq events`. **Projects** group related change requests. Use `--project` to filter requests by project. ## Configuration -`req` reads its configuration from `~/.req/config.yaml`: +`breq` reads its configuration from `~/.breq/config.yaml`: ```yaml endpoint: grpc.bluefunda.com:443 # BFF gRPC address @@ -187,8 +187,8 @@ defaults: | Variable | Description | |----------|-------------| -| `REQ_INSTALL_DIR` | Custom install directory for `install.sh` | -| `BLUEFUNDA_TOKEN` | Bearer token (alternative to `req login`) | +| `BREQ_INSTALL_DIR` | Custom install directory for `install.sh` | +| `BLUEFUNDA_TOKEN` | Bearer token (alternative to `breq login`) | ## Development @@ -201,7 +201,7 @@ defaults: ### Build ```bash -make build # Build req binary +make build # Build breq binary make test # Run tests with race detector make vet # Run go vet make fmt # Format code @@ -212,11 +212,11 @@ make snapshot # Build release snapshot with goreleaser ``` bluerequests/ -├── cmd/req/ # Entry point +├── cmd/breq/ # Entry point ├── internal/ │ ├── auth/ # OAuth2 device flow (RFC 8628) │ ├── cmd/ # Cobra command definitions -│ ├── config/ # Config loader (~/.req/config.yaml) +│ ├── config/ # Config loader (~/.breq/config.yaml) │ ├── grpc/ # gRPC connection + interceptors │ ├── tui/ # BubbleTea TUI dashboard │ └── ui/ # Output formatting diff --git a/SECURITY.md b/SECURITY.md index 8fd40fe..dd1a63b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Supported Versions -We release security fixes for the latest stable version of `req`. +We release security fixes for the latest stable version of `breq`. | Version | Supported | |---------|-----------| diff --git a/cmd/req/main.go b/cmd/breq/main.go similarity index 100% rename from cmd/req/main.go rename to cmd/breq/main.go diff --git a/install.sh b/install.sh index d043b93..b7929ad 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -e REPO="bluefunda/bluerequests" -BINARY="req" +BINARY="breq" INSTALL_DIR="" # Colors @@ -38,8 +38,8 @@ else fi # Resolve install directory -if [ -n "$REQ_INSTALL_DIR" ]; then - INSTALL_DIR="$REQ_INSTALL_DIR" +if [ -n "$BREQ_INSTALL_DIR" ]; then + INSTALL_DIR="$BREQ_INSTALL_DIR" elif [ -w "/usr/local/bin" ]; then INSTALL_DIR="/usr/local/bin" else @@ -111,5 +111,5 @@ if [ "$INSTALL_DIR" = "$HOME/.local/bin" ]; then esac fi -printf "\n${GREEN}${BOLD}bluerequests CLI installed!${RESET}\n" +printf "\n${GREEN}${BOLD}bluerequests CLI (breq) installed!${RESET}\n" printf " Run: ${BOLD}${BINARY} login${RESET}\n\n" diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 6dd8428..562ca49 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -16,9 +16,9 @@ var ( var Version = "dev" var rootCmd = &cobra.Command{ - Use: "req", - Short: "req -- CLI for the bluerequests change/release management platform", - Long: "req is a command-line interface for interacting with the BlueRequests platform via gRPC.", + Use: "breq", + Short: "breq -- CLI for the bluerequests change/release management platform", + Long: "breq is a command-line interface for interacting with the BlueRequests platform via gRPC.", Version: Version, } diff --git a/internal/config/config.go b/internal/config/config.go index 394ebf6..08ad61a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -46,7 +46,7 @@ func configDir() (string, error) { if err != nil { return "", fmt.Errorf("home directory: %w", err) } - dir := filepath.Join(home, ".req") + dir := filepath.Join(home, ".breq") if err := os.MkdirAll(dir, 0700); err != nil { return "", fmt.Errorf("create config dir: %w", err) }