install: offer to replace existing shell integration (interactive) + --force
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Problem
tryme install refuses when the # try shell integration marker already exists in the rc file:
try is already installed in /Users/x/.zshrc
To reinstall, remove the '# try shell integration' block first.
The installed block embeds the absolute path of the binary that ran install (resolve_self_path), so this bites on every channel switch — brew ↔ cargo ↔ dev build — and the remedy is hand-editing the rc file, which is exactly the surgery install exists to spare people. The eval "$(tryme init …)" form sidesteps it, but install should be able to maintain what it wrote.
This is upstream-inherited behavior (try.rb marker check), so shipping it is a deliberate divergence to be recorded per ADR-0003 — optionally proposed upstream first if we want the behaviors to converge, owner's call.
Proposal
Two additive changes, no change to any existing exit code or script-observable behavior (conformance suite unaffected — install has no upstream conformance test):
-
tryme install --force— replace the marker-delimited block instead of refusing: strip from the# try shell integrationline through the wrapper function it wrote, append the freshly generated block. Non-interactive-safe; second--forcerun is a no-op rewrite. -
Interactive default: prompt instead of refuse. Marker found + tty session → ask on stderr:
try is already installed in ~/.zshrc — replace it? [y/N]N/default preserves today's behavior exactly (message + exit 0). Non-tty keeps the current refuse-with-hint unconditionally, so scripts/CI never block on a prompt. Read the answer from/dev/tty, consistent with the selector's stream discipline.
Safety
- Replacement bounded strictly by the block
installwrites (marker + emitted function) — never pattern-match user-authoredtryfunctions. - Read-only rc files keep the existing warning + exit 1 path.
- New
--forceflag joins the clap declaration +try.usage.kdlvia the inventory-diff chain; hidden nothing.
Sequencing
Post-1.0 surface per ADR-0004 staging, or earlier if the owner rules the divergence in — it needs an ADR-0003 ruling-log entry either way.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the install command's marker check and resolve_self_path, then trace the clap declaration and try.usage.kdl inventory-diff chain. Read docs/adr/0003-divergence-authority.md and the ADR-0004 staging reference before deciding scope. Done means --force replaces only the generated block, interactive TTY sessions prompt, non-TTY sessions preserve refusal behavior, and existing exit codes and read-only handling remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100