Skip to content

Selective reconfigure for install script #40

@dasirra

Description

@dasirra

Problem

Returning users must walk through the entire sequential installation wizard to change a single setting (e.g., rotate a GitHub token). The wizard already detects .env and shows "keep current" prompts, but there is no way to jump directly to the setting you want to change.

Solution

Add a run_reconfigure_menu function to install.sh that presents a two-level TUI menu when .env already exists. Fresh installs continue through the existing sequential wizard unchanged.

Design

Entry point

install.sh flow:
  banner
  if .env exists:
    source all integration modules
    run_reconfigure_menu()
    run_reconfigure_summary()
  else:
    existing sequential wizard (unchanged)

In reconfigure mode, Screen 2 (multi-select agent chooser) and the sequential integration flows are skipped entirely. The SELECTED_AGENT_IDS variable is not used; the menu operates on per-agent context directly.

Top-level menu

A gum choose single-select menu that loops until the user selects "Done."

What would you like to configure?

> Forge
  Scouter (not installed)
  Alfred (not installed)
  Done
  • Agent list is built dynamically from manifest.json.
  • Configured vs not installed: An agent is "configured" if its per-agent Discord token key (DISCORD_{{AGENT}}_TOKEN) has a non-empty value in .env. Otherwise it shows "(not installed)".
  • Done exits the menu loop and proceeds to the reconfigure summary screen.

Agent submenu

Selecting an agent opens a single-select submenu that also loops until "Back."

Forge

> Git Identity
  Discord (configured)
  GitHub (configured)
  Claude Code (not configured)
  Back
  • Integration list is built from the agent's integrations map in the manifest.
  • Agent-specific options are added where relevant (Git Identity for Forge).
  • Status detection per integration:
    • For integrations with per_agent_keys: check DISCORD_{{AGENT}}_TOKEN. Non-empty = "configured."
    • For integrations with shared_keys: check the first key (e.g., GH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN). Non-empty = "configured."
    • For GWS (no env vars, credentials stored as file): check existence of home/.config/gws/credentials.json. Exists = "configured."
    • For Git Identity: check GIT_AUTHOR_NAME. Non-empty = "configured."
  • Selecting an integration runs the existing module function directly (full flow with instructions, validation, "keep current" prompts).
  • Back returns to the top-level menu.

Integration-to-function mapping

Integration Function(s) called
Discord run_discord_shared + run_discord_agent $id $name
GitHub run_github
Claude Code run_claude
GWS run_gws
X/Twitter run_xurl
Git Identity Inline prompts (same as current Screen 3)

Non-installed agent flow

Selecting an agent marked "(not installed)" runs its full setup via a run_full_agent_setup $agent_id helper.

Summary screen

Both paths converge at a summary screen. Reconfigure uses run_reconfigure_summary that reads status directly from .env and file checks.

Scope

In scope

  • run_reconfigure_menu function in install.sh
  • run_full_agent_setup helper function
  • run_reconfigure_summary function
  • Top-level agent menu with status annotations
  • Per-agent submenu with integration status annotations

Out of scope

  • Changes to integration modules
  • CLI flags (e.g., --reconfigure discord)

Testing

No new TUI-interaction tests. Any unit-testable helpers extracted during implementation should have bats tests.

Source

SOL-25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions