fix: #7 — feat(install): one-line install.sh#18
Merged
Merged
Conversation
…iring Closes #7. - install.sh detects OS (darwin/linux) and arch (arm64/x86_64), downloads the matching scripture-mcp release tarball, and installs the binary to ~/.local/bin (overridable with --prefix). Re-running overwrites the binary in place — that's the upgrade path. - After install, it detects which coding agents are on $PATH (claude, codex), prompts (via /dev/tty so the prompt still works under curl|bash), and calls 'scripture-mcp init --target=<agent>' for each. init is already idempotent on configs (PR #14's marker-fenced splice). - --uninstall reverses both halves: 'init --uninstall' for each detected agent, then removes the binary. - --no-wire installs the binary only; --yes auto-confirms; --version pins a release tag; --from-archive bypasses the network and unpacks a local tarball (used by the test harness, also handy for air- gapped installs). Tests live in internal/installer/install_test.go: they build the real scripture-mcp, pack it into a tarball, then drive install.sh through fresh-install, idempotent re-run, and uninstall against a sandboxed HOME and a stubbed PATH. Covered: --help surface, unknown-flag exit, no-agents case, --no-wire, missing archive. README's Install section is rewritten around install.sh (was 'planned'); the brew line is removed per the issue's note.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7.
Adds the
install.shone-shot installer plus an end-to-end Go testharness that exercises it against a fake release tarball — no network
required in CI.
What's in this PR
install.sh— POSIX bash. Detects OS (darwin/linux) and arch(
arm64/x86_64), downloads the matchingscripture-mcpreleasetarball from
https://github.com/MiaoDX/verse-driven/releases/download/<tag>/scripture-mcp-<tag>-<os>-<arch>.tar.gz,unpacks it, and installs to
~/.local/bin/scripture-mcp(overridablewith
--prefix). Re-running overwrites the binary in place — that'sthe upgrade path. After install, it detects
claudeandcodexon$PATHand runsscripture-mcp init --target=<agent>for each (whichis already idempotent on configs via PR fix: #4 — feat(core): stdio MCP server + CLI subcommands #14's marker-fenced splice).
--uninstallreverses both halves:init --uninstallfor eachdetected agent, then removes the binary.
--no-wireinstalls the binary only;--yes/-yauto-confirms;--version <tag>pins a release;--from-archive <path>bypasses the network and unpacks a localtarball — used by the test harness, also handy for air-gapped
installs or behind a corporate proxy. Env overrides
RELEASE_BASE_URL/LATEST_RELEASE_URLexist for advanced cases.curl | bash:prompt_yesreads from/dev/ttywhen stdin is the curl pipe, so the y/n confirmation actually reaches
the user. When neither stdin nor
/dev/ttyis a terminal (CI, fullyautomated runs), it defaults to yes —
--yesmakes that explicit.internal/installer/install_test.go— Go tests that build thereal
scripture-mcpbinary, pack it into a.tar.gz, then driveinstall.shagainst a sandboxedHOMEand a stubbedPATH.Covered:
--helpsurface lists all the documented flags.is executable, both
~/.claude/settings.jsonand~/.codex/config.tomlgain the>>> verse-drivenblock) → re-run(asserts "already up to date" for both configs and binary still
present, i.e. idempotent) →
--uninstall(asserts binary removedand snippets stripped).
claude/codexstill installs the binaryand reports "no supported agents detected".
--no-wireskips agent wiring even when both are on$PATH.--from-archivefile fails fast with a clear diagnostic.real one centered on
install.sh, drops the speculativebrewline per the issue's note.
Acceptance-criteria mapping
install.shdetects OS/arch, downloads the right binary release, places it onPATH(warns when$PREFIXisn't on$PATH)claude/codexonPATH) and offers to wire eachscripture-mcp init --target=...per detected agentTestInstallEndToEndphase 2)scripture-mcp init --uninstall --target=...removes the snippets — both surfaced directly viainitand bundled intoinstall.sh --uninstallVerification
go test ./...— green across all 9 packages, including 6 new installer testsgo vet ./...— cleanbash install.sh --help— prints flag tablebash install.sh --bogus— exits 2 with "unknown flag" diagnosticTestInstallEndToEnd):scripture-mcpand pack into/tmp/scripture-mcp.tar.gz.HOME=/tmp/h PATH=/tmp/agents:... bash install.sh --from-archive /tmp/scripture-mcp.tar.gz --prefix /tmp/bin --yes→ installs
/tmp/bin/scripture-mcp, splices the verse-driven block into both~/.claude/settings.jsonand~/.codex/config.toml.bash install.sh --prefix /tmp/bin --uninstallstrips the snippets and removes the binary.Generated by Claude Code