Skip to content

feat: bind R to terraform init -reconfigure#153

Open
Slevy35 wants to merge 1 commit into
leg100:masterfrom
Slevy35:feat/init-reconfigure
Open

feat: bind R to terraform init -reconfigure#153
Slevy35 wants to merge 1 commit into
leg100:masterfrom
Slevy35:feat/init-reconfigure

Conversation

@Slevy35

@Slevy35 Slevy35 commented May 26, 2026

Copy link
Copy Markdown

Summary

Adds a R (capital) key binding that runs terraform init -reconfigure on the selected module(s) / workspace(s) in the TUI, mirroring the existing i (init) and u (init -upgrade) shortcuts.

  • New Common.InitReconfigure binding in internal/tui/keys/common.go.
  • module.Service.Init refactored to take an InitOptions{Upgrade, Reconfigure} struct so adding further init flags later won't break call sites.
  • ActionHandler in internal/tui/actions.go dispatches the three init variants through the same code path.
  • README key bindings table updated.

Why R and not I

Capital I is already bound to "toggle task info" (localKeys.ToggleInfo), and lowercase r is "retry". Capital R is unused in the codebase, is the natural mnemonic for "Reconfigure", and follows the existing pattern of capital variants extending lowercase actions. Happy to switch to a different key if you'd prefer.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./internal/module/... ./internal/tui/...
  • New integration test TestExplorer_SingleInitReconfigure plus existing TestExplorer_SingleInit / TestExplorer_SingleInitUpgrade all pass with the local mirror (./hacks/setup_mirror.sh).

Made with Cursor

Pressing R on a module (or selection of modules / workspaces) now runs
`terraform init -reconfigure`, mirroring the existing `i` (init) and
`u` (init -upgrade) bindings.

Refactors `module.Service.Init` to take an `InitOptions` struct so
future init flags can be added without breaking call sites.

Capital R was chosen because lowercase `r` is already "retry"; capital
`I` is already "toggle task info".

Co-authored-by: Cursor <cursoragent@cursor.com>
@Slevy35

Slevy35 commented May 26, 2026

Copy link
Copy Markdown
Author

@leg100 what do you think?

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