Skip to content

Harden Linux installer: stop bin-dir wipe, fix unparseable script, ARM, portability - #11

Merged
ClintonSarkar merged 1 commit into
mainfrom
fix/install-sh-hardening
Jul 18, 2026
Merged

Harden Linux installer: stop bin-dir wipe, fix unparseable script, ARM, portability#11
ClintonSarkar merged 1 commit into
mainfrom
fix/install-sh-hardening

Conversation

@ClintonSarkar

Copy link
Copy Markdown
Owner

Summary

Hardens the Linux/WSL/macOS installer and management CLI. Most importantly, it removes a data-loss hazard and makes the installer script actually runnable on Linux again.

What changed

  • No more wiping unrelated binaries. A failed install could recursively delete the shared ~/.local/bin directory (every tool a user keeps there), not just clawde's own files. Rollback now removes only the specific files clawde installed. (Closes Failed Linux install can delete unrelated binaries in ~/.local/bin #3)
  • The installer script parses on Linux again. It was stored with Windows line endings, so curl … | bash fed bash a script it rejected outright — the installer was fully broken on its own target platform. Line endings are now enforced as LF for shell scripts, the corrupted progress-bar characters are fixed, and a small CI job (bash -n + shellcheck) guards against the whole class recurring. (Closes Linux installer prints mojibake instead of a progress bar #9)
  • ARM Linux gets an ARM build. The installer no longer hands ARM machines an Intel binary; it selects the ARM build, and tells the user clearly (with a pipx fallback) when no ARM build exists. (Closes Linux ARM installs receive an x86_64 proxy binary #7)
  • Consistent provider wiring. The coding agent's provider is now defined in one place with a correct address and key, instead of three components disagreeing. (Contributes to Agent provider config is inconsistent across install, CLI, and config #5 — Linux side)
  • Portability and safety. Config parsing works on macOS/BSD, the Python version check no longer mistakes Python 2 for 3, self-update can't corrupt the running script, and uninstall only removes clawde's own lines from shell startup files. (Closes Cross-platform CLI and uninstall robustness bugs #10 — Linux side)

Reviewer note

The line-ending normalization makes the diff read as a whole-file rewrite for the two shell scripts. Review with git diff --ignore-cr-at-eol (or -w) to see the real logic changes.

Closes #3, #7, #9
Contributes to #5, #10


🤖 Generated with Claude Code

- Never rm -rf the shared ~/.local/bin on rollback; only remove the
  specific files clawde installed (fixes data-loss on failed install, #3)
- Force LF line endings for shell scripts (.gitattributes text eol=lf) and
  renormalize install.sh/clawde.sh: they were committed CRLF, which makes
  Linux bash reject them when served via `curl | bash`. Repair the broken
  \-continuations, replace mojibake progress-bar glyphs with ASCII, and add
  a CI lint job (bash -n + shellcheck) guarding the parse class (#9)
- Select the aarch64 CCProxy tarball on ARM Linux instead of x86_64, with a
  clear quoted pipx fallback when no ARM build exists (#7)
- Make opencode.json the single source of truth for the ccproxy-claude
  provider: fix the jq baseURL that wrote a literal $port, add apiKey, and
  drop the divergent env-var exports from the CLI (#5)
- macOS/BSD portability + robustness: POSIX config regex (first =, tab-safe),
  leftmost python-version parse (no longer accepts py2), atomic self-update
  rename with partial-download cleanup, and uninstall via POSIX awk that
  removes only clawde's own marker block and reports success truthfully (#10)

Refs #3, #5, #7, #9, #10

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ClintonSarkar
ClintonSarkar merged commit c316ffd into main Jul 18, 2026
1 check 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

1 participant