Skip to content

Add interactive TUI mode#3

Open
horstf wants to merge 3 commits intomainfrom
feature/interactive-tui
Open

Add interactive TUI mode#3
horstf wants to merge 3 commits intomainfrom
feature/interactive-tui

Conversation

@horstf
Copy link
Owner

@horstf horstf commented Mar 2, 2026

Summary

  • Add -i flag that launches a Bubble Tea interactive TUI for browsing gRPC methods, previewing JSON request templates, and copying them to clipboard
  • Refactor ListMethods() to be side-effect free (no stdout printing), moving display logic to the caller in main.go
  • Add automatic gRPC reflection stream reconnection on EOF, fixing failures when making multiple sequential operations

New packages

  • pkg/tui/ — Bubble Tea TUI with filterable list view and scrollable JSON preview
  • pkg/clipboard/ — Cross-platform clipboard write via pbcopy/xclip/clip.exe

Test plan

  • make build compiles successfully
  • make test — all existing tests pass
  • ./goshape -host localhost -port 50051 -list-methods still works (non-interactive)
  • ./goshape -host localhost -port 50051 -i launches TUI
  • Method list is filterable by typing
  • Selecting a method shows JSON template preview
  • Enter on preview copies to clipboard
  • Esc returns to list, q quits

🤖 Generated with Claude Code

Implement a Bubble Tea-based interactive terminal UI launched via the `-i`
flag. Users can browse/filter gRPC methods, preview JSON request templates,
and copy them to clipboard. Also refactors ListMethods() to be side-effect
free and adds automatic stream reconnection to handle server-side EOF.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@horstf
Copy link
Owner Author

horstf commented Mar 3, 2026

@claude test

@claude
Copy link

claude bot commented Mar 3, 2026

Claude finished @horstf's task in 2m 2s —— View job


Test Results

  • Gather context & analyze CI failures
  • Identify root cause of failures
  • Inspect test files
  • Report results

CI Failure: Go Version Mismatch

The CI is failing at the Lint step before tests even run:

Error: can't load config: the Go language version (go1.24) used to build
golangci-lint is lower than the targeted Go version (1.26)

Root cause: .github/workflows/ci.yml line 22 sets go-version: '1.24.x' but go.mod requires Go 1.26. I cannot modify workflow files directly (GitHub App permissions), but the fix is a one-line change: Fix this →

CI Steps That Ran

Step Result
Build (make build) ✅ Passed
Vet (make vet) ✅ Passed
Lint (golangci-lint run ./...) ❌ Failed — Go 1.24 vs 1.26 mismatch
Unit tests ⏸ Never ran
Integration tests ⏸ Never ran

Test Files Found

The test suite covers:

  • pkg/reflection/client_test.goTestNewClient, TestListMethods, TestClientWithCancelledContext, TestGetMethodInputType, TestGenerateRequestTemplate, TestSecureConnection
  • pkg/reflection/template_test.goTestGenerateDefaultValue, TestGenerateMessageTemplate, TestFormatJSON
  • pkg/reflection/descriptor_test.go — descriptor registry tests
  • pkg/reflection/integration_test.go — integration tests (require live server, tagged integration)

The new packages added in this PR (pkg/tui/ and pkg/clipboard/) do not have tests yet.

Next Steps

  1. Fix CI: Update go-version: '1.24.x''1.26.x' in .github/workflows/ci.yml
  2. Once CI is fixed, tests should run automatically on the next push

@horstf
Copy link
Owner Author

horstf commented Mar 4, 2026

@claude we are still seeing issues with golangci lint

@claude
Copy link

claude bot commented Mar 4, 2026

Claude finished @horstf's task in 2m 26s —— View job


Fixed golangci-lint Configuration

  • Gather context & check CI status
  • Read workflow and lint configuration files
  • Identify root cause of lint failures
  • Fix .golangci.yml to use v1-compatible format
  • Commit and push fix

Root Cause

The CI installs golangci-lint@latest which resolves to v1.64.8, but .golangci.yml declared version: "2" (golangci-lint v2 format), causing:

Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2

Fix Applied (commit 3eed9a2)

Converted .golangci.yml from v2 → v1 format:

What changed v2 format v1 format
Version declaration version: "2" (removed)
Formatters section formatters: enable: [gofmt, goimports] Moved to linters.enable
Settings key linters.settings linters-settings
File exclusions issues.exclusions.paths issues.exclude-files
Rule exclusions issues.exclusions.rules issues.exclude-rules

All linters are preserved — gofmt and goimports are valid linters in golangci-lint v1.

Note: If you'd prefer to use golangci-lint v2 long-term, update the CI install command from golangci-lint/cmd/golangci-lint@latest to golangci-lint/v2/cmd/golangci-lint@latest in .github/workflows/ci.yml. This would allow keeping the v2 config format.
|

The CI installs golangci-lint@latest which resolves to v1.x, but the
config used version: "2" format (with formatters section) that is only
supported by golangci-lint v2. Convert to v1-compatible format by:
- Removing version: "2" declaration
- Replacing formatters section with gofmt/goimports as regular linters
- Using linters-settings (hyphenated) instead of linters.settings
- Using issues.exclude-rules and issues.exclude-files instead of
  issues.exclusions.rules and issues.exclusions.paths

Co-authored-by: horstf <horstf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant