You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Area: Installer script. Impact: add scripts/install.sh as the one-command entrypoint for installing wtk. Source: README.md:12-16; cmd/wtk/main.go:11-15; https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh
Area: Documentation. Impact: update README install section to show the one-click curl command as the install path and keep completion instructions aligned with the installed binary. Source: README.md:12-16,45-52
Area: Release boundary. Impact: this iteration installs through go install; release artifact download/checksum can be added when release assets are produced in CI. Source: README.md:12-16; .github/workflows/ci.yml:7-15; https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh
Design Decisions
Decision: Implement scripts/install.sh as a POSIX sh script using set -eu, explicit fail() diagnostics, and command preflight checks. Source: https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh; README.md:54-56
Decision: Use go install github.com/nettee/worktree-kit/cmd/wtk@latest as the initial install mechanism inside the one-click script. Source: README.md:12-16; go.mod:1-3
Decision: Require go and validate that the available Go version satisfies module Go 1.25.0 before installing. Source: go.mod:3; README.md:12-16
Decision: Install into ${WTK_INSTALL_DIR:-$HOME/.local/bin} by setting GOBIN for the go install invocation, mirroring looper's user-local install directory default. Source: https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh; README.md:12-16
Decision: Support installer environment overrides: WTK_INSTALL_DIR, WTK_MODULE, WTK_VERSION, and WTK_SKIP_PATH_UPDATE. Source: README.md:12-16; https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh
Decision: After installation, run the installed wtk --help to verify the binary is executable and wired through Cobra. Source: cmd/wtk/main.go:11-15; internal/cli/root.go:23-32
Decision: Check whether the install directory is in PATH; in an interactive terminal, offer to append export PATH="$HOME/.local/bin:$PATH" to the detected profile, and in script output always print the manual export command. Source: https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh
Decision: Print shell completion guidance after successful install rather than installing completions automatically. Source: internal/cli/root.go:113-134; README.md:45-52
Decision: Keep release artifact download/checksum support as a follow-up design seam, because current CI only runs tests and does not publish artifacts or checksum files. Source: .github/workflows/ci.yml:7-15; https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh
Why this design
A go install wrapper gives a one-command installer that matches the current repository state and avoids inventing a release pipeline ahead of CI support.
The script still copies looper's useful installer UX: explicit preflight checks, local bin install, PATH guidance, interactive profile update, and clear next steps.
GOBIN keeps installation deterministic and avoids depending on the user's existing Go bin directory setup.
Verifying wtk --help catches broken installs immediately and preserves the project's fail-fast behavior.
Test Strategy
Script checks: run sh -n scripts/install.sh for syntax validation. Source: https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh
Installer behavior tests: execute the script in a temporary HOME and WTK_INSTALL_DIR, using a temporary GOBIN, then assert wtk exists and wtk --help succeeds. Source: cmd/wtk/main.go:11-15; internal/cli/root.go:23-32
Failure tests: run with PATH configured to hide go and assert a non-zero exit with a clear missing-command message. Source: go.mod:3; README.md:54-56
Documentation check: README install command points to scripts/install.sh as the install path. Source: README.md:12-16
Existing Go tests: continue running go test ./... in CI. Source: .github/workflows/ci.yml:7-15
Pseudocode
main:
set -eu
require commands: go, grep, mkdir
module = WTK_MODULE or github.com/nettee/worktree-kit/cmd/wtk
version = WTK_VERSION or latest
install_dir = WTK_INSTALL_DIR or $HOME/.local/bin
verify go version >= 1.25
mkdir -p install_dir
GOBIN=install_dir go install module@version
install_path = install_dir/wtk
require install_path exists and executable
run install_path --help >/dev/null
if install_dir missing from PATH:
if interactive and WTK_SKIP_PATH_UPDATE unset:
ask before appending PATH export to detected profile
print manual PATH export command
print installed path and completion examples
Non-interactive execution: skip prompt and print manual PATH guidance.
Plan
Step 1: Installer foundation
Substep 1.1 Implement: add scripts/install.sh with fail-fast helpers, environment parsing, dependency checks, Go version validation, and install-dir resolution.
Substep 1.2 Implement: run GOBIN=$install_dir go install github.com/nettee/worktree-kit/cmd/wtk@latest and verify the resulting wtk binary.
Substep 1.3 Verify: run sh -n scripts/install.sh and a local temporary install smoke test.
Substep 2.2 Implement: print post-install completion examples and next-step usage.
Substep 2.3 Verify: test PATH-present, PATH-missing interactive-skip, and non-interactive guidance paths.
Step 3: Docs and CI coverage
Substep 3.1 Implement: update README install section with the one-click curl command.
Substep 3.2 Implement: add installer test script or CI step for shell syntax and hermetic smoke install.
Substep 3.3 Verify: run go test ./..., installer checks, and a manual install command with temporary WTK_INSTALL_DIR.
Notes
Implementation
scripts/install.sh - added a fail-fast one-click installer that validates commands and Go version, installs wtk with GOBIN, verifies wtk --help, handles PATH guidance, optionally updates an interactive shell profile, and prints completion examples.
scripts/test-install.sh - added shell installer coverage for syntax, temporary local install, PATH-present output, PATH-missing guidance, completion output, and missing-Go failure.
.github/workflows/ci.yml - added the installer test script to CI before go test ./....
README.md - documented the curl-based one-click installer, requirements, install directory, and retained go install as a supported path.
Implementation seam: WTK_VERSION="" lets installer tests use a local WTK_MODULE=./cmd/wtk; default user installs still use @latest.
Verification
sh -n scripts/install.sh - passed.
sh scripts/test-install.sh - passed; includes a temporary install smoke test with WTK_INSTALL_DIR and local module override.
id: 20260510-one-click-install-script
name: One Click Install Script
status: implemented
created: '2026-05-10'
Overview
Problem Statement
https://github.com/nexu-io/looper项目,为当前项目规划一个一键安装脚本。Goals
nexu-io/looper的安装脚本方案和用户体验。Scope
nexu-io/looper的安装方式。Success Criteria
Research
Existing System
wtkCLI,覆盖create、remove、send-out、bring-in四类 Git worktree 工作流。Source:README.md:3-8go install github.com/nettee/worktree-kit/cmd/wtk@latest。Source:README.md:12-16cmd/wtk/main.go,调用cli.Execute(context.Background(), os.Args[1:]),错误输出到 stderr 并以非零状态退出。Source:cmd/wtk/main.go:11-15github.com/nettee/worktree-kit,Go 版本是1.25.0。Source:go.mod:1-3create、remove、send-out、bring-in、completion命令。Source:internal/cli/root.go:23-32README.md:45-52README.md:54-561.25.x并运行go test ./...。Source:.github/workflows/ci.yml:7-15go build ./cmd/wtk验证。Source:specs/change/20260510-worktree-kit-cli/spec.md:331-336,350-356Available Approaches
go install github.com/nettee/worktree-kit/cmd/wtk@latest作为安装路径。Source:README.md:12-16curl -fsSL https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh | sh作为快速安装入口。Source:https://github.com/nexu-io/looper/blob/main/README.md#quick-startscripts/install.sh支持下载 tar.gz 或 raw binary,并用 sha256 文件校验后安装。Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh~/.local/bin,在交互式 TTY 中可追加export PATH="$HOME/.local/bin:$PATH"到 profile。Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shinstall.sh和uninstall.sh。Source:https://github.com/nexu-io/looper/tree/main/scriptswtk completion <shell>,脚本可以安装二进制后输出 completion 配置提示。Source:internal/cli/root.go:113-134;README.md:45-52Constraints & Dependencies
wtk二进制。Source:cmd/wtk/main.go:11-15;go.mod:1-3go install,需要检测go命令和 Go 版本。Source:README.md:12-16;go.mod:3.github/workflows/ci.yml:7-15set -eu、fail()、依赖检查、平台检测、checksum mismatch 失败等 fail-fast 行为。Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shdarwin-arm64。Source:https://github.com/nexu-io/looper/blob/main/docs/installation.md#requirementscurl、grep、tar,checksum 工具使用shasum、sha256sum或openssl。Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shhttps://github.com/nexu-io/looper/blob/main/docs/installation.md#requirements;README.md:3-8Key References
README.md:12-16- 当前安装命令。README.md:45-56- completion 和失败行为文档。go.mod:1-3- module 路径和 Go 版本。cmd/wtk/main.go:11-15-wtk二进制入口和退出行为。internal/cli/root.go:23-32,113-134- Cobra 命令注册和 completion 生成。.github/workflows/ci.yml:7-15- 当前 CI 覆盖范围。https://github.com/nexu-io/looper/blob/main/README.md#quick-start- looper 快速安装入口。https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh- looper installer 参考实现。https://github.com/nexu-io/looper/blob/main/docs/installation.md#requirements- looper 平台和依赖要求。Design
Architecture Overview
Change Scope
scripts/install.shas the one-command entrypoint for installingwtk. Source:README.md:12-16;cmd/wtk/main.go:11-15;https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shREADME.md:12-16,45-52.github/workflows/ci.yml:7-15;README.md:54-56go install; release artifact download/checksum can be added when release assets are produced in CI. Source:README.md:12-16;.github/workflows/ci.yml:7-15;https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shDesign Decisions
scripts/install.shas a POSIXshscript usingset -eu, explicitfail()diagnostics, and command preflight checks. Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh;README.md:54-56go install github.com/nettee/worktree-kit/cmd/wtk@latestas the initial install mechanism inside the one-click script. Source:README.md:12-16;go.mod:1-3goand validate that the available Go version satisfies module Go1.25.0before installing. Source:go.mod:3;README.md:12-16${WTK_INSTALL_DIR:-$HOME/.local/bin}by settingGOBINfor thego installinvocation, mirroring looper's user-local install directory default. Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.sh;README.md:12-16WTK_INSTALL_DIR,WTK_MODULE,WTK_VERSION, andWTK_SKIP_PATH_UPDATE. Source:README.md:12-16;https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shwtk --helpto verify the binary is executable and wired through Cobra. Source:cmd/wtk/main.go:11-15;internal/cli/root.go:23-32PATH; in an interactive terminal, offer to appendexport PATH="$HOME/.local/bin:$PATH"to the detected profile, and in script output always print the manual export command. Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shinternal/cli/root.go:113-134;README.md:45-52.github/workflows/ci.yml:7-15;https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shWhy this design
go installwrapper gives a one-command installer that matches the current repository state and avoids inventing a release pipeline ahead of CI support.GOBINkeeps installation deterministic and avoids depending on the user's existing Go bin directory setup.wtk --helpcatches broken installs immediately and preserves the project's fail-fast behavior.Test Strategy
sh -n scripts/install.shfor syntax validation. Source:https://raw.githubusercontent.com/nexu-io/looper/main/scripts/install.shHOMEandWTK_INSTALL_DIR, using a temporaryGOBIN, then assertwtkexists andwtk --helpsucceeds. Source:cmd/wtk/main.go:11-15;internal/cli/root.go:23-32PATHconfigured to hidegoand assert a non-zero exit with a clear missing-command message. Source:go.mod:3;README.md:54-56scripts/install.shas the install path. Source:README.md:12-16go test ./...in CI. Source:.github/workflows/ci.yml:7-15Pseudocode
File Structure
scripts/install.sh- one-click installer entrypoint.README.md- updated install section with curl command and installer notes.test/installer/install_test.shorscripts/test-install.sh- shell-level installer verification..github/workflows/ci.yml- add installer syntax/behavior check alongsidego test ./...when the test can run hermetically.Interfaces / APIs
Installer environment variables:
Published user commands:
curl -fsSL https://raw.githubusercontent.com/nettee/worktree-kit/main/scripts/install.sh | shEdge Cases
gocommand missing: fail before install with an explicit dependency error.1.25: fail before install with the required version.$HOMEunavailable andWTK_INSTALL_DIRunset: fail with an install-dir error.go installfails: surface the failed install command and exit non-zero.wtk --helpfails: fail before success output.PATH: print export guidance and optionally update profile in an interactive terminal.Plan
scripts/install.shwith fail-fast helpers, environment parsing, dependency checks, Go version validation, and install-dir resolution.GOBIN=$install_dir go install github.com/nettee/worktree-kit/cmd/wtk@latestand verify the resultingwtkbinary.sh -n scripts/install.shand a local temporary install smoke test.go test ./..., installer checks, and a manual install command with temporaryWTK_INSTALL_DIR.Notes
Implementation
scripts/install.sh- added a fail-fast one-click installer that validates commands and Go version, installswtkwithGOBIN, verifieswtk --help, handles PATH guidance, optionally updates an interactive shell profile, and prints completion examples.scripts/test-install.sh- added shell installer coverage for syntax, temporary local install, PATH-present output, PATH-missing guidance, completion output, and missing-Go failure..github/workflows/ci.yml- added the installer test script to CI beforego test ./....README.md- documented the curl-based one-click installer, requirements, install directory, and retainedgo installas a supported path.WTK_VERSION=""lets installer tests use a localWTK_MODULE=./cmd/wtk; default user installs still use@latest.Verification
sh -n scripts/install.sh- passed.sh scripts/test-install.sh- passed; includes a temporary install smoke test withWTK_INSTALL_DIRand local module override.go test ./...- passed.