Skip to content

docs: install Keploy without writing install.sh in the working directory - #946

Merged
slayerjain merged 2 commits into
mainfrom
fix/install-oneliner-cwd
Nov 1, 2026
Merged

slayerjain merged 2 commits into
mainfrom
fix/install-oneliner-cwd

Conversation

@slayerjain

Copy link
Copy Markdown
Member

Installers: both installers already stopped touching the caller's folder: keploy/enterprise#3166 (released in v3.8.105, served at keploy.io/ent/install.sh) and keploy/keploy#5025 (merged 2026-11-01, served at keploy.io/install.sh). This PR fixes the commands themselves: their curl -O saved the installer into the working directory before any installer code ran. Nothing else has to merge first.

What was wrong

The docs told users to install Keploy with curl --silent -O -L https://keploy.io/install.sh && source install.sh (5 pages use https://keploy.io/ent/install.sh; the Jenkins pages run it with && bash install.sh). curl -O saves the installer as ./install.sh. Run from a repository root, as the CI pages do, it overwrote the repository's own install.sh before any installer code ran, so no installer fix can prevent it.

What changed

82 lines in 44 files. Each line keeps its text; only the command changes, and the URL stays the same.

  • Where the script was sourced (terminal pages, GitHub Actions and GitLab CI YAML, prose, llms-full-root.txt):
    source /dev/stdin <<<"$(curl -fsSL https://keploy.io/install.sh || echo 'echo Keploy installer download failed >&2; return 1')"
    It is still sourced, so the PATH the installer sets stays set in the user's shell. It reads a here-string because macOS's /bin/bash 3.2 sources <(curl ...) as an empty file and installs nothing.
  • Where the script was run with bash (the Jenkins sh '''...''' steps and one note in jenkins.md):
    (curl -fsSL https://keploy.io/install.sh || echo 'echo Keploy installer download failed >&2; exit 1') | bash
  • Neither writes a file. If the download fails, curl prints its error, the shell prints Keploy installer download failed, and the command returns 1. A CI step (bash -e, GitLab's set -eo pipefail, Jenkins' sh -xe) stops at the install line instead of going on without keploy. A bare curl -fsSL URL | bash would return 0 there.
  • In the 4 HowTo text: "..." props the quotes are escaped as \", as github.md already does.
  • Three GitHub Actions steps already piped the script to bash, but without --fail: version-3.0.0 running-keploy/api-testing-cicd.md:49 (curl --silent -L https://keploy.io/ent/install.sh | bash) and version-4.0.0 quickstart/k8s-proxy-developer-workflow.md:139 and :189 (curl -sSL https://keploy.io/install.sh | bash). A download that got no response (DNS, refused, timeout) handed bash an empty script, so the step passed with nothing installed; an HTTP error handed bash the site's HTML error page to run. They now use the piped form above, each with its own URL (second commit).
  • The two server/windows/installation.md pages (2.0.0, 3.0.0) used curl --silent -O without -L; they now follow redirects like the rest.
  • cd ~ && stays in front of the 4 Lima commands. It moved off the read-only macOS mount; it is no longer needed, but the change stays mechanical.

Files touched (lines changed)

  • content/llms-full-root.txt (1)
  • versioned_docs/version-2.0.0: ci-cd/gitlab.md (1), ci-cd/jenkins.md (2), concepts/installation.md (2), keploy-cloud/installation.md (1), quickstart/java-spring-boot-xml.md (2), running-keploy/keploy-karaf.md (1), server/linux/installation.md (1), server/macos/installation.md (1), server/windows/installation.md (1)
  • versioned_docs/version-3.0.0: ci-cd/gitlab.md (1), ci-cd/jenkins.md (2), concepts/installation.md (2), installation/linux.md (1), installation/macos.md (2), installation/windows.md (2), keploy-cloud/installation.md (1), running-keploy/api-testing-cicd.md (1, second commit), running-keploy/keploy-karaf.md (1), server/installation_tabs.md (6), server/linux/installation.md (1), server/macos/installation.md (1), server/windows/installation.md (1)
  • versioned_docs/version-4.0.0: ci-cd/github.md (4), ci-cd/gitlab.md (3), ci-cd/jenkins.md (4), concepts/installation.md (2), concepts/platform-requirements.md (1), installation/linux.md (1), installation/macos.md (3), installation/windows.md (1), keploy-cloud/installation.md (1), keploy-explained/common-errors.md (1), keploy-explained/dev-guide.md (6), keploy-explained/mac-linux.md (1), keploy-explained/windows-wsl.md (2), quickstart/k8s-proxy-developer-workflow.md (2, second commit), running-keploy/api-testing-cicd.md (1), running-keploy/keploy-karaf.md (1), server/installation.md (1), server/installation_tabs.md (7), server/linux/installation.md (2), server/macos/installation.md (2), server/windows/installation.md (1)

How it was checked

  • The diff is the substitution and nothing else: in each of the 79 changed lines, putting the old command back in place of the new one gives the old line byte for byte; no curl -O ... install.sh, source install.sh or bash install.sh is left.
  • MDX: all 41 changed .md files compile with MDX 3 + GFM (front matter and {#id} heading ids stripped as Docusaurus does), before and after.
  • npx prettier@2.8.8 --check (this repo's PR check) passes on the 41 files.
  • YAML: the 8 fenced YAML blocks that hold the command (GitHub Actions and GitLab pages) parse, and each holds the command exactly, as a list item or a line of a run: | block.
  • The 4 distinct commands, as written in the docs, were run from the root of a temp git repo that tracks install.sh, with only the URL swapped (a stub over file://, a failing stub, or a 404 on keploy.io). Shapes: a terminal, GitHub Actions' bash -e FILE and shell: bash (-eo pipefail), GitLab's script on stdin with set -eo pipefail, and Jenkins' sh -xe FILE.
    • Linux (dash as sh, bash 5.2, zsh 5.9): 63 rows, 0 failures. macOS 26.7 (/bin/sh, /bin/dash, /bin/bash 3.2, /bin/zsh 5.9): 63 rows, 0 failures.
    • Success: status 0, the next line runs, PATH reaches the caller for the sourced form, git status stays empty, nothing is left in $HOME.
    • 404: status 1 and the message; a CI shape stops before the next line. Failing installer (piped): status 3; a CI shape stops.
    • Control: today's commands leave the repo dirty (install.sh overwritten).
  • Second commit: the 3 new lines and every changed line of the other repos' PRs were checked to hold one of 4 exact commands (both piped URLs, both sourced URLs). The 2 run: lines parse as YAML to the command exactly; the third sits in a run: | block. All 43 changed .md files compile with MDX 3 + GFM.
    • The 4 commands ran again in the same harness, with piped commands now also in GitHub Actions' bash -e and -eo pipefail, GitLab's set -eo pipefail and sh -e under dash: 102 rows, 0 failures, on Linux amd64 (dash, bash 5.2, zsh 5.9) and on macOS 26.7 (/bin/sh, /bin/dash, /bin/bash 3.2, /bin/zsh 5.9). The ent piped URL gives the same rows as the OSS one: 404 = status 1, the message, the step stops; repo clean.
  • With both fixed installers served (checked 2026-11-01: keploy.io/install.sh serves keploy/keploy main's keploy.sh after fix(installer): leave the caller's directory, and other files in /tmp, alone keploy#5025, keploy.io/ent/install.sh serves v3.8.105's), real installs on macOS 26.7 under /bin/bash 3.2 and zsh 5.9, in a -e script run from the root of a temp git repo that tracks install.sh, keploy.sh and keploy-enterprise.sh, with HOME and TMPDIR fresh (telemetry posts dropped; the binary served from one cached copy of the live download):
    • the sourced https://keploy.io/install.sh command installed Keploy, the next line found and ran $HOME/.keploy/bin/keploy, and git status stayed empty;
    • the sourced https://keploy.io/ent/install.sh command installed Keploy, the next line found and ran $HOME/.keploy/bin/keploy, and git status stayed empty;
    • the loud piped https://keploy.io/install.sh line installed Keploy into ~/.keploy/bin and left the repo clean.
      Control: the old curl --silent -O -L https://keploy.io/install.sh && source install.sh line leaves the repo dirty (its own curl -O overwrites install.sh).

Not changed

  • The Homebrew installer lines (keploy-explained/mac-linux.md in 2.0.0, 3.0.0 and 4.0.0).
  • HowTo texts that only name the script URL ("install script from https://keploy.io/install.sh") and prose that names install.sh (common-errors.md:281, cli-commands.md:74, github.md:26).

Stated limits

  • keploy/rag-bot keeps hand-made copies of some of these pages in its docs/ folder, and a FAISS index built from them (document_index/). Nothing syncs them from this repo (its only workflow publishes a Docker image), so they keep the old command until someone copies the pages over and rebuilds the index. This PR does not change them.
  • fish: the old curl -O ... && bash install.sh worked in fish; ( ... ) | bash does not, because ( ... ) is a command substitution there. The sourced form needs bash or zsh, as source install.sh did. No fish was available to check.
  • A transfer cut off partway (curl exit 18) hands the shell the part that arrived, then the message and status 1, as any curl | sh install does; a cut inside a comment, a quoted string or a here-document swallows the message line, and the status is then the partial script's. The old curl -O ... && ... ran nothing after curl failed. Both installers keep their top-level code in their last lines (keploy.io/install.sh from line 516 of 596, keploy.io/ent/install.sh from line 810 of 914, on 2026-11-01), so a part that arrived mostly defines functions.
  • Without -e, a failed install returns 1 and the shell goes on, as a terminal should.

Same fix elsewhere

The same command is being replaced, one PR per repo, in keploy/keploy, keploy/enterprise, keploy/api-server, keploy/enterprise-ui, keploy/vscode-extension-enterprise, keploy/vscode-extension, keploy/docs, keploy/landing, keploy/homebrew-tap, keploy/orderflow, keploy/bruno, and the READMEs of keploy/samples-go, samples-python, samples-typescript, samples-csharp, samples-java and samples-rust. keploy/website and the JetBrains plugin also show the old command, but they are not live, so they were skipped.

The docs told users to install Keploy with
`curl --silent -O -L https://keploy.io/install.sh && source install.sh`
(or `&& bash install.sh` in the Jenkins pages). curl -O saves the
installer as ./install.sh, so run from a repository root it overwrote
the repository's own install.sh before the installer even started.

The 79 lines in 42 files now say, where the script was sourced:
  source /dev/stdin <<<"$(curl -fsSL URL || echo '...; return 1')"
and in the Jenkins pages, where it was run with bash:
  (curl -fsSL URL || echo '...; exit 1') | bash
with the echoed script `echo Keploy installer download failed >&2`.
Neither writes a file. The sourced form still sets PATH in the user's
shell; it reads a here-string because macOS's bash 3.2 sources
`<(curl ...)` as an empty file. A failed download prints the message
and returns 1, so a CI step stops at the install line instead of going
on without keploy. The URLs are unchanged; the two Windows pages that
had no -L now follow redirects like the rest.

The change is mechanical: putting the old command back in each changed
line gives the old line byte for byte.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
Three GitHub Actions steps piped the installer to bash without --fail:
- version-3.0.0 running-keploy/api-testing-cicd.md:
  `curl --silent -L https://keploy.io/ent/install.sh | bash`;
- version-4.0.0 quickstart/k8s-proxy-developer-workflow.md (2 lines):
  `curl -sSL https://keploy.io/install.sh | bash`.
A download that gets no response (DNS, refused, timeout) hands bash an
empty script, so the step passes with nothing installed. An HTTP error
hands bash the site's HTML error page to run.

They now show the form the other piped lines use:
  (curl -fsSL URL || echo 'echo Keploy installer download failed >&2; exit 1') | bash
with each line's own URL. Any failed download prints the message and
fails the step.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
@slayerjain
slayerjain merged commit 1507a4a into main Nov 1, 2026
6 checks passed
@slayerjain
slayerjain deleted the fix/install-oneliner-cwd branch November 1, 2026 11:20
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