Skip to content

Add an install menu, and fix the failing macOS build - #2

Merged
v3ai merged 2 commits into
masterfrom
claude/sharp-fermat-ii6gyk
Nov 12, 2026
Merged

v3ai merged 2 commits into
masterfrom
claude/sharp-fermat-ii6gyk

Conversation

@v3ai

@v3ai v3ai commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What

Two commits that weren't in #1 when it was merged:

  1. Install menu. cain -i asks what to install instead of installing everything.
  2. CI fix. master's macOS job has been failing since Add cain vps and an install menu (Full / Light / Dotfiles / Keybindings / Server / Custom) #1 was merged. This fixes it.

Install menu

What should cain install?
up/down move   enter pick   q quit

 > Full         programs, dotfiles, keybindings and desktop settings
   Light        dotfiles and keybindings; no programs, no desktop changes
   Dotfiles     just configs, shell aliases and git settings
   Keybindings  just key remaps and shortcuts
   Server       terminal programs and dotfiles, nothing graphical
   Custom       tick each part yourself
  • Custom opens a checklist of the install steps: Space ticks one, a toggles all, Enter starts.
  • Server only shows on Linux and is the same as cain vps.
  • Controls: arrow keys or j/k, Enter, q or Esc to quit.
  • Plain cain uses the same kind of menu to ask Install or Collect.
  • Skipping the menu:
    • cain install light (or full, dotfiles, keybindings, server) picks a preset directly
    • cain -i -y installs everything
    • with no terminal attached (scripts, CI), cain installs everything as before
  • src/tui.c is plain C with no dependencies: termios on Linux/macOS, conio on Windows. It clips lines to the terminal width so redraws don't break, and falls back to a numbered prompt if the output isn't a terminal.

CI fix

The unknown vps step test runs cain vps keys. On macOS, cain vps stops early with "cain vps is for Linux servers", so the expected message never appeared and the test failed. It now only runs on Linux, like the other server tests.

Testing

  • CI on this branch is green on Linux, macOS and Windows (MSVC).
  • make test: 18 checks pass, including new ones for each preset's steps.
  • Builds with -Werror under gcc and clang, and cross-compiles with MinGW.
  • Menu: driven through a pseudo-terminal. Checked picking a preset, the Custom checklist, q and Esc to cancel, and the Install/Collect menu.
  • Not tested: the Windows console menu was only compiled, never run.

Generated by Claude Code

`cain -i` (and plain `cain`) now open an arrow-key menu instead of
installing everything. Presets:
  full         programs, dotfiles, keybindings, desktop settings
  light        dotfiles + keybindings, no programs or desktop changes
  dotfiles     configs, shell aliases, git settings
  keybindings  key remaps and shortcuts
  server       terminal programs + dotfiles (Linux, same as `cain vps`)
  custom       checklist of install steps

- src/tui.c: dependency-free menu (termios on Linux/macOS, conio on
  Windows), j/k or arrows, Space to tick, q/Esc to quit, clips lines to
  the terminal width, numbered fallback when output isn't a terminal.
- `cain install light` etc. picks a preset without the menu; `-y`
  installs everything. No terminal (scripts, CI) still installs everything.
- The first Install/Collect question uses the same menu.
- Tests for each preset's steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012UFcA7u8gWu2RPdtQjpqhW
On macOS and Windows, `cain vps` stops early with "cain vps is for Linux
servers", so the test never saw the message it looks for and failed the
macOS CI job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012UFcA7u8gWu2RPdtQjpqhW
@v3ai
v3ai merged commit ea1312c into master Nov 12, 2026
8 checks passed
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.

2 participants