What this file does: Bootstraps the entire SIN-Code Tool Suite (7 Go tools + Python bundle + opencode MCP config) in a single invocation.
Docs: install.sh (source of truth — this file is the "what and why")
-
Platform detection — validates macOS/Linux and amd64/arm64. Sets
PLATFORM="{os}/{arch}"(e.g.darwin/arm64). Exits 1 if unsupported. -
Prereq checks — verifies
python3 >= 3.11,go >= 1.21,git,curlviacommand -v. Usessort -Vfor semver-ish comparison. Exits 1 on any missing or too-old prerequisite. -
Python bundle install — prefers
uv(fast, lockfile-correct) if on PATH:uv pip install --python "$BUNDLE_DIR/.venv/bin/python" -e "$BUNDLE_DIR[mcp,dev]"if a project-local.venvexists, otherwiseuv pip install --system -e .... Falls back topython3 -m pip install -e ...(or.venv/bin/pip) ifuvis absent. -
Go tool build & install — compiles all 7 tools from sibling repos into
~/.local/bin(default). Resume-aware: skips a tool if its binary mtime is newer than the newest.gosource incmd/<binary>.--forcebypasses this. -
Smoke test — for each binary, pipes a JSON-RPC
initializerequest{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}into<bin> --mcp. Green if the response contains"serverInfo". Exits 1 on first failure. -
opencode.json patch (idempotent) — adds
mcp.sin-{tool}entries under themcpblock (not the deprecatedmcpServers). Uses python3 for safe JSON manipulation; backs up toopencode.json.bak-<timestamp>before mutating. -
sin status + PATH hint — runs
sin statusif available, warns if$BIN_DIRis not on PATH.
| Variable | Purpose | Default |
|---|---|---|
SIN_CODE_BIN_DIR |
Go binary install dir | ~/.local/bin |
SIN_CODE_REPOS_DIR |
Parent dir of the 7 Go tool repos | ~/dev |
SIN_CODE_OPENCODE_CONFIG |
Path to opencode.json | ~/.config/opencode/opencode.json |
| Flag | Behaviour |
|---|---|
--help / -h |
Show usage text, exit 2 |
--dry-run |
Print all actions, skip all mutations |
--verbose |
Echo every command via set -x-style logging |
--force |
Rebuild all Go tools even if up-to-date |
--skip-go / --bundle-only |
Skip Go build; only install Python bundle + register MCP |
--skip-external |
Skip gitnexus, simone-mcp, and SIN-Brain checks entirely |
--with-externals |
Auto-install external bridges (GitNexus, MarkItDown, RTK, Simone-MCP) instead of just verifying them. Default is verify-only — the user is expected to run sin gitnexus setup / sin markitdown setup / sin rtk setup manually. With this flag, auto_install_externals runs after step 8 and best-effort installs: npm install -g @abhigyanpatwari/gitnexus / pipx install markitdown (pip fallback) / brew install rtk / npm install in $REPOS_DIR/Simone-MCP. Each step warns on failure and continues — never aborts the whole install over an optional external. |
- Go binaries: skipped if
bin_mtime >= newest_src_mtime(unless--force). - opencode.json: only adds missing
sin-*keys; existing entries untouched. - Python bundle:
pip install -eis naturally idempotent. - Re-running
bash install.shis safe at any point.
binary name repo dir name installs as
discover SIN-Code-Discover-Tool discover
execute SIN-Code-Execute-Tool execute
map SIN-Code-Map-Tool map
grasp SIN-Code-Grasp-Tool grasp
scout SIN-Code-Scout-Tool scout
harvest SIN-Code-Harvest-Tool harvest
orchestrate SIN-Code-Orchestrate-Tool orchestrate
Each binary implements a --mcp flag that starts a JSON-RPC MCP server
on stdin/stdout. No special build tags required — vanilla go build.
~/dev/
SIN-Code-Discover-Tool/ cmd/discover/
SIN-Code-Execute-Tool/ cmd/execute/
SIN-Code-Map-Tool/ cmd/map/
SIN-Code-Grasp-Tool/ cmd/grasp/
SIN-Code-Scout-Tool/ cmd/scout/
SIN-Code-Harvest-Tool/ cmd/harvest/
SIN-Code-Orchestrate-Tool/ cmd/orchestrate/
install.sh ← this file
install.sh.doc.md ← you are here
pyproject.toml
src/
| Scenario | Behaviour |
|---|---|
| Repo dir missing | err "Repo not found: $REPOS_DIR/SIN-Code-X-Tool" → exit 1 |
cmd/<binary> missing in repo |
err "Expected cmd/<binary>/ in $repo" → exit 1 |
go build fails |
bubbles up from run → exit 1 |
| Smoke test fails | err "$binary --mcp failed: <response>" → exit 1 |
| Prereq too old | err "<tool> X.Y.Z is too old. Need >= N.M" → exit 1 |
| opencode.json mutated | backup written as opencode.json.bak-<YYYYmmdd-HHMMSS> first |
| Code | Meaning |
|---|---|
| 0 | Success (or everything already installed and healthy) |
| 1 | Prerequisite missing, build failure, smoke-test failure |
| 2 | --help requested |