Skip to content

docs: lead with the guided install, not the pipe - #56

Open
Behnam-RK wants to merge 1 commit into
feat/problems-and-exportfrom
docs/guided-install
Open

docs: lead with the guided install, not the pipe#56
Behnam-RK wants to merge 1 commit into
feat/problems-and-exportfrom
docs/guided-install

Conversation

@Behnam-RK

Copy link
Copy Markdown
Owner

Stacked on #55#53#52#51#50#49. Last of the set.

The finding

scripts/install.sh has been interactive for a while. It already has:

  • a component menu on a fresh machine (CLI / menubar app / register the service)
  • upgrade / reinstall / uninstall on a machine that already has dezhban, with a typed confirmation and a "keep your config?" question
  • an offer to run dezhban setup right there, so you finish with a configured guard rather than a set of instructions

It gates all of that on [ -t 0 ]. The documented invocation was curl -fsSL … | sudo bash, where stdin is the script text itself — so nobody following the README has ever seen a single prompt. The feature existed; the advertised path could not reach it.

What changed

Documentation only. No script logic changed.

README.md and docs/usage/install.md now lead with:

curl -fsSL https://raw.githubusercontent.com/Behnam-RK/dezhban/main/scripts/install.sh -o /tmp/dezhban-install.sh
sudo bash /tmp/dezhban-install.sh

Interactive by construction, and it lets the reader inspect the script before running it as root — the right habit for anything that installs a kill switch.

The piped one-liner stays documented immediately below, as the unattended form, and says plainly that it takes the defaults without asking. install.md gains a short "Why two lines instead of a pipe" section explaining what the interactive form actually offers, so the extra line reads as a feature rather than an inconvenience.

The "piped never prompts" guarantee is untouched. That promise is load-bearing for provisioners and CI, and the comments at scripts/install.sh:37-51 spell out why testing -t 0 rather than -t 1 is what makes it hold. Nothing in that logic moved.

One small script fix

The "run as root" hint always suggested the pipe. $0 is bash under a pipe and the script's path otherwise, so the hint now names the actual file when there is one:

$ bash scripts/install.sh
error: run as root — e.g. sudo bash scripts/install.sh

$ cat scripts/install.sh | bash
error: run as root — e.g. curl -fsSL .../install.sh | sudo bash

A hint reading "sudo bash bash" would have been worse than none.

Verification

  • bash -n and shellcheck on scripts/install.sh — clean.
  • Both root-hint paths exercised directly (output above).
  • go build, go vet, go test — pass (docs are bundled into the app's help, so internal/help covers the rendering of the changed pages).

🤖 Generated with Claude Code

scripts/install.sh has always been interactive: a component menu on a fresh
machine, upgrade/reinstall/uninstall on one that already has dezhban, and an
offer to run the setup wizard. It gates on `[ -t 0 ]`, and the documented
invocation was `curl … | sudo bash` — where stdin is the script text itself, so
nobody following the README had ever seen a prompt. The feature existed; the
advertised path could not reach it.

README.md and docs/usage/install.md now lead with download-then-run, which is
interactive by construction and lets the reader inspect the script before
running it as root — the right habit for anything installing a kill switch. The
piped form stays documented as the unattended one, and its "piped never prompts"
guarantee is untouched: no script logic changed.

The script's own header now shows both forms, and its "run as root" hint names
the actual file when there is one — $0 is "bash" under a pipe, so the old hint
would have read "sudo bash bash".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Behnam-RK
Behnam-RK force-pushed the docs/guided-install branch from c8fe3af to 89a86ba Compare August 22, 2026 07:11
@Behnam-RK
Behnam-RK force-pushed the feat/problems-and-export branch from 28e19f8 to 0115bc5 Compare August 22, 2026 07:11
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