Skip to content

feat(cli): add interactive TUI main menu#56

Open
gpolanco wants to merge 1 commit intomainfrom
feat/tui-main-menu
Open

feat(cli): add interactive TUI main menu#56
gpolanco wants to merge 1 commit intomainfrom
feat/tui-main-menu

Conversation

@gpolanco
Copy link
Copy Markdown
Owner

What

When the user runs devw with no arguments in a TTY, instead of showing --help, a guided interactive menu appears with the main workflows. Non-TTY environments (CI/CD, pipes) still get --help as before.

Why

The CLI had grown to 8+ commands making discoverability difficult. The TUI menu surfaces the core workflows without requiring command memorization. Spec: openspec/changes/tui-main-menu/spec.md.

Changes

  • packages/cli/src/commands/menu.ts ← new: runMainMenu() with looping select menu
  • packages/cli/src/index.ts ← wire program.action(runMainMenu)
  • packages/cli/src/commands/add.ts ← export runAdd
  • packages/cli/src/commands/compile.ts ← export runCompile
  • packages/cli/src/commands/doctor.ts ← export runDoctor
  • packages/cli/src/commands/remove.ts ← export runRemove
  • packages/cli/tests/commands/menu.test.ts ← new: TTY guard unit tests
  • packages/cli/tests/e2e/cli.test.ts ← no-args non-TTY e2e test

Behaviour

  • Menu loops — after each action completes, returns to main menu
  • Ctrl+C inside a subcommand → back to main menu
  • Ctrl+C on main menu → exit
  • Bottom legend shows: ↑↓ navigate • ⏎ select • Ctrl+C back
  • Non-TTY: falls through to existing --help output unchanged

Test

pnpm build && pnpm test          # 283 tests, 0 failures
node packages/cli/dist/index.js  # shows interactive menu
node packages/cli/dist/index.js add  # subcommands still work
node packages/cli/dist/index.js --help  # --help still works

- add program.action() hook in index.ts — launches menu in TTY, falls back to --help in non-TTY
- new commands/menu.ts with runMainMenu(): looping select menu, returns to menu after each action, Ctrl+C in subcommand returns to menu, Ctrl+C in menu exits
- custom keysHelpTip theme adds 'Ctrl+C back' to the bottom legend
- export runAdd, runRemove, runDoctor, runCompile from their modules for menu delegation
- unit tests: TTY guard behavior
- e2e test: no-args non-TTY exits 0 with usage text
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
landing Ready Ready Preview, Comment Mar 19, 2026 1:05am

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