Skip to content

Interactive, arrow-key guided setup for whygraph init#32

Merged
cvetty merged 2 commits into
mainfrom
feature/interactive-init
Jul 7, 2026
Merged

Interactive, arrow-key guided setup for whygraph init#32
cvetty merged 2 commits into
mainfrom
feature/interactive-init

Conversation

@cvetty

@cvetty cvetty commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • whygraph init on a terminal now runs a create-next-app-style guided setup: agent, analyze/rationale LLM provider+model (+ per-provider API key), and source-control provider (+ GitHub token) — every prompt defaulted so a bare Enter accepts it.
  • Before any write, a Rich summary panel lists every choice with secrets shown as status only (set (hidden) / from $ENV / not set, never a value), gated by a final "Write these files?" confirm.
  • On confirm, writes both a committable whygraph.example.toml (no secrets) and a ready-to-run whygraph.toml (with any secrets entered), from one parameterized template rendered two ways.
  • --yes/-y (and any non-TTY invocation — pipes, CI, git hooks) skips all prompts, uses defaults, and never clobbers an existing whygraph.toml — identical to prior behavior.
  • Ctrl-C or a declined confirm aborts cleanly before any file write or DB bootstrap.

Test plan

  • uv run pytest — 518 passed
  • ruff check src/ tests/ — clean
  • Golden fixture (tests/fixtures/default_config_golden.toml) pins byte-exact reproduction of the unfilled template
  • Manual smoke: whygraph init --yes in a scratch repo writes both files with defaults, preserves an existing whygraph.toml
  • Manual smoke: full interactive TTY flow (pty-driven) — arrow menus, masked summary panel, confirm, both files + agent wiring written correctly

cvetty added 2 commits July 6, 2026 09:05
Prompts for the agent, analyze/rationale LLMs (+ per-provider API keys),
and the source-control provider (+ token), shows a secret-masked summary
panel to confirm, then writes both whygraph.example.toml (no secrets) and
a ready-to-run whygraph.toml. --yes and any non-TTY invocation skip all
prompts and preserve today's behavior.
CI checks ruff format --check in addition to ruff check, which wasn't
run before the last push. Reformat the affected files and add a
"Before pushing" section to CLAUDE.md spelling out all three commands
CI gates on, so this doesn't happen again.
@cvetty cvetty self-assigned this Jul 7, 2026
@cvetty cvetty merged commit e7e9bee into main Jul 7, 2026
2 checks passed
@cvetty cvetty deleted the feature/interactive-init branch July 7, 2026 17:27
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