Skip to content

feat(cua-driver-rs): single shared post-install-hints.txt for all 4 Rust installers - #1664

Merged
f-trycua merged 1 commit into
mainfrom
feat/cua-driver-rs-post-install-subcommand
May 23, 2026
Merged

feat(cua-driver-rs): single shared post-install-hints.txt for all 4 Rust installers#1664
f-trycua merged 1 commit into
mainfrom
feat/cua-driver-rs-post-install-subcommand

Conversation

@f-trycua

@f-trycua f-trycua commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

The 4 cua-driver-rs installer scripts each inlined their own post-install hint block — with predictable drift:

Installer Skill hint MCP hint Try-it Docs link
_install-rust.sh (canonical Unix Rust path)
install.ps1 (canonical Windows Rust) partial
install-local.sh (Rust dev Unix) partial
install-local.ps1 (Rust dev Windows)

Same hint text would need to land in 4 files in 2 shells. Adding a new MCP client or renaming a CLI flag meant grepping 4 files.

The fix

Single text file libs/cua-driver/scripts/post-install-hints.txt with {{BINARY}} placeholder. Each installer renders it with shell-native substitution:

Installer How it renders
_install-rust.sh curl from raw.githubusercontent.com + sed
install.ps1 Invoke-WebRequest + PS -replace
install-local.sh direct disk read from ../cua-driver/scripts/ + sed
install-local.ps1 direct disk read + -replace

Each has a one-line essentials fallback if the .txt is unreachable (network failure on remote installs, missing file on local) so users always get enough to recover.

What stays inline per installer

OS-specific bits — 4–6 lines each, per-shell natural, each script targets one OS anyway:

  • macOS TCC reminder (open -n -g -a CuaDriver --args serve)
  • Windows Scheduled-Task autostart
  • Linux systemd autostart reference

Why not a CLI subcommand

An earlier draft of this work added cua-driver post-install to the Rust binary and had all 4 installers delegate via & $installedBinary post-install. Reverted — the chicken-and-egg risk (failed binary install ⇒ no hints either) made the .txt approach safer. The .txt has no runtime dependency; even a totally broken binary install still prints hints.

Files

  • New: libs/cua-driver/scripts/post-install-hints.txt — the shared text (~50 lines)
  • Edited: libs/cua-driver/scripts/_install-rust.sh, install.ps1, libs/cua-driver-rs/scripts/install-local.sh, install-local.ps1 — each replaces inline hints with .txt render + keeps install-specific lines (Installed banner, PATH handling, BETA warning, OS-specific autostart)
  • Edited: libs/cua-driver-rs/PARITY.md — new "Installer post-install hints" section documenting the design

Net diff: +194 / −50 LOC across 6 files. Going forward, hint changes happen in one place.

Test plan

  • bash libs/cua-driver-rs/scripts/install-local.sh on macOS — prints the unified block with {{BINARY}} correctly substituted + macOS TCC + LaunchAgent hint
  • .\install-local.ps1 on Windows VM
  • irm https://.../install.ps1 | iex end-to-end (canonical Windows installer, remote fetch path)
  • CI green

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Installers now provide comprehensive post-install guidance including verification commands, optional configuration steps, and platform-specific instructions.
  • Documentation

    • New shared post-install hints template with setup verification, agent skills installation, and MCP server configuration instructions.
    • Added installer post-install hints contract documentation.

Review Change Stack

…ust installers

The 4 cua-driver-rs installer scripts (install.ps1, _install-rust.sh,
install-local.ps1, install-local.sh) each inlined their own
post-install hint block — with predictable drift: _install-rust.sh
had Try-it + skill + docs, install.ps1 had Try-it + autostart + docs,
install-local.* had almost nothing. Adding a new MCP client or
renaming a CLI flag meant grepping 4 files in 2 shells.

This adds `libs/cua-driver/scripts/post-install-hints.txt` as the
single source of truth for the OS-agnostic bulk (Try-it / agent skill
pack / MCP setup for 6 clients / docs link). Uses `{{BINARY}}` as the
placeholder. All 4 install scripts render it natively:

  • _install-rust.sh   — curl from raw.githubusercontent.com + sed
  • install.ps1        — Invoke-WebRequest + PS -replace
  • install-local.sh   — direct read from ../cua-driver/scripts/ + sed
  • install-local.ps1  — direct read + -replace

OS-specific bits (macOS TCC reminder, Windows Scheduled-Task autostart,
Linux systemd autostart) stay inline in each script — they're 4-6
lines, per-shell natural, and each script targets one OS anyway.

Each installer has a one-line essentials fallback if the .txt is
unreachable (network failure on remote installs, missing file on
local). So users always get enough to recover.

Why not a CLI subcommand: an earlier draft added `cua-driver
post-install` to the Rust binary and had all 4 installers delegate via
`& $installedBinary post-install`. Reverted — the chicken-and-egg risk
(failed binary install = no hints either) made the .txt approach
safer. The .txt has no runtime dependency; even a totally broken
binary install still prints hints.

Live verified on macOS: `bash libs/cua-driver-rs/scripts/install-local.sh`
runs end-to-end and prints the unified block with macOS-specific TCC +
LaunchAgent hints. Windows VM verification pending.

PARITY.md updated with the design rationale and renderer mapping.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored May 23, 2026 2:37pm

Request Review

@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

All four installer scripts (Rust driver local, Go driver remote, for both Windows and Unix) now load a unified post-install hints template instead of maintaining separate hardcoded messages. The shared template is substituted with the installed binary path and displayed; a fallback message appears when the template is unavailable.

Changes

Unified post-install hints across installers

Layer / File(s) Summary
Shared post-install hints template
libs/cua-driver/scripts/post-install-hints.txt
New post-install-hints.txt defines unified next-step guidance covering installation verification, optional skill pack installation, and MCP server setup for multiple client platforms, serving as the contract that all installers load and render.
Unix local installer hints integration
libs/cua-driver-rs/scripts/install-local.sh
Rust driver's install-local.sh loads shared hints from local post-install-hints.txt, substitutes the installed binary path, and displays them; falls back to brief "Next steps" message when the file is absent. Conditional autostart guidance is printed only when --autostart was not used.
Windows local installer hints integration
libs/cua-driver-rs/scripts/install-local.ps1
Rust driver's install-local.ps1 reads shared hints from local post-install-hints.txt, substitutes the binary path, and displays them with fallback; autostart registration is try/catch guarded, and Windows-specific autostart command hints are printed conditionally when -AutoStart is not set.
Unix remote installer hints integration
libs/cua-driver/scripts/_install-rust.sh
Go driver's _install-rust.sh downloads shared post-install-hints.txt from GitHub, substitutes the installed binary path, and displays it; includes fallback messaging on network failure. Adds OS-specific TCC grant instructions on macOS and optional logon auto-start guidance on Linux referencing the --autostart flag.
Windows remote installer hints integration
libs/cua-driver/scripts/install.ps1
Go driver's install.ps1 adds User PATH awareness (prints confirmation or manual instructions based on bin directory presence), downloads and renders shared hints with {{BINARY}} substitution and network fallback, and displays Windows-specific autostart command hints. Removes prior verbose AutoStart informational messaging.
Parity documentation for shared hints contract
libs/cua-driver-rs/PARITY.md
New "Installer post-install hints" section in PARITY.md documents the shared template contract (including {{BINARY}} placeholder), how each OS-specific installer script reads and renders the template, fallback behavior when the template is unreachable, rationale for static text file over CLI subcommand, and verification status per platform.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • trycua/cua#1550: Both PRs update Windows installer post-install/autostart messaging and delegate to new autostart command handling in install.ps1 and install-local.ps1.
  • trycua/cua#1630: Both PRs refactor libs/cua-driver/scripts/install.ps1 post-install hints output and {{BINARY}} template rendering for Windows autostart/user guidance.
  • trycua/cua#1628: Both PRs modify the same libs/cua-driver/scripts/install.ps1 post-install hint/autostart output block with potential content/formatting overlap.

Poem

🐰 From template to terminal, hints now unite,
Four installers fetch guidance and render just right,
With {{BINARY}} whispers and fallback so sage,
We share the next steps across every page!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically identifies the main change: centralizing post-install hints into a single shared text file for all four Rust installers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cua-driver-rs-post-install-subcommand

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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