feat(installer): openmillas interactive installer (Unix, v0.3.0) #4

Merged
MillasAgent merged 2 commits from feat/spec-installer into main 2026-08-23 12:20:38 +00:00
Owner

Summary

Adds a delegation-based interactive installer for the opencode configuration bundle (workspace/opencode/install.sh + companion CLI workspace/opencode/openmillas). Replaces the manual deploy.sh --install flow with a one-line curl | bash install that delegates to upstream installers (npx ctx7 setup, codegraph install, npm i -g opencode-subagent-statusline).

What ships in this PR

New files

  • workspace/opencode/install.sh (~556 lines, bash 4+, set -euo pipefail) — interactive Unix installer.
  • workspace/opencode/openmillas (~360 lines, bash) — user-facing CLI; installed to ~/.local/bin/openmillas by install.sh.
  • workspace/opencode/lib/jsonc.sh + lib/_jsonc_strip.py — shared JSONC strip + merge helper, sourced by both deploy.sh and install.sh. Replaces the duplicated heredocs in read_bundled_mcp and patch_global_config. All writes go through mktemp + mv -f for atomicity.
  • workspace/opencode/tests/test_install.sh (~800 lines) — 20 tests covering idempotency, prompt rejection, upstream failure recovery, tui.json merge correctness (existing / idempotent / npm-fail), opencode.jsonc MCP-merge preservation, doctor, uninstall, atomic-write, JSONC helper dedup.

Modified

  • workspace/opencode/deploy.sh — sources lib/jsonc.sh, replaces duplicated heredocs with helper calls, adds copy steps for AGENTS.md and codegraph/examples/, runs the additive tui.json merge. Atomic write upgrade applied to patch_global_config. Behavior is byte-identical for users with existing ~/.config/opencode/.
  • workspace/opencode/opencode.jsonc — drops mcp.context7; mcp.codegraph kept as a block with enabled: false and an inline pointer to https://github.com/colbymchenry/codegraph.
  • workspace/opencode/agents/codegraph.md — drops the opencode-codegraph plugin mention (was inconsistent with the bundle'''s opencode.jsonc).
  • README.md, AGENTS.md (root), CHANGELOG.md — version bump 0.2.0 → 0.3.0; new §Install / §Third-party services / §Optional integrations sections in README; new openmillas CLI subsection in AGENTS; Added/Changed entries under [Unreleased].

Removed

  • LICENSE — license-strip pass per user direction. User will relicense at end.
  • spec.md — renamed to spec_memory.md (memory plugin research; license claim stripped).

Compatibility for existing deploy.sh --install users

  • ~/.config/opencode/opencode.jsonc preserved verbatim (additive MCP merge).
  • ~/.config/opencode/tui.json preserved verbatim (additive plugin merge).
  • deploy.sh --check unchanged.
  • New behavior: AGENTS.md and codegraph/examples/ now copied by deploy.sh too (was a gap; resolves TD-17).

Acceptance criteria met (16 of 16)

$ bash workspace/opencode/tests/test_install.sh
================================
PASS: 20    FAIL: 0
================================
ALL TESTS PASS

$ bash workspace/opencode/deploy.sh --check
[deploy] validation OK

Resolves

  • TD-9 (tui.json provenance — subagent-statusline plugin source documented)
  • TD-17 (deploy.sh copy_bundle gap for AGENTS.md and additive tui.json merge)
  • TD-18 (4 stale codegraph.ru / opencode-codegraph references in shipped docs)
  • TD-1a (license reconciliation, deferred per user; user will relicense at end)

New tech debt (filed for follow-up)

  • TD-20 (high): curl | bash self-update has no SHA-256 / GPG / TOFU pin.
  • TD-21 (low): install.sh and openmillas duplicate ~140 lines of subcommand bodies.
  • TD-22 (low): lib/jsonc.sh ships two unused public functions.
  • TD-23 (low): BUNDLE_DIR accepts arbitrary paths without integrity verification.
  • TD-24 (medium): Windows PowerShell port (install.ps1, openmillas.ps1) is deferred.
  • TD-25 (low): python3 -I not used in heredocs (PYTHONPATH needed for _jsonc_strip.py import).
  • TD-26 (low): AC-9 simulated-crash half is deferred (verified atomic no-op empirically instead).

Out of scope (planned follow-up)

  • Windows PowerShell port (TD-24). The current iteration is Unix only.
  • GPG signing of the installer payload (TD-20).
  • brew tap / scoop formula (spec §12).
  • Continuous-update via cron / systemd timer.
  • Telemetry (the installer does not phone home; spec §12).

Forgejo raw URL

Tested both candidate URLs against the repo; both return 404 because the remote is private. install.sh includes a graceful fallback: when the remote fetch fails, it prints a clear message and instructs the user to clone the repo and run install.sh locally. The curl | bash UX will work once the repo is published.

How to review

git checkout feat/spec-installer
bash workspace/opencode/deploy.sh --check
bash workspace/opencode/tests/test_install.sh
# Manual smoke (in a fresh HOME):
mkdir -p /tmp/test-home && HOME=/tmp/test-home bash workspace/opencode/install.sh --yes --no-interaction
## Summary Adds a delegation-based interactive installer for the opencode configuration bundle (`workspace/opencode/install.sh` + companion CLI `workspace/opencode/openmillas`). Replaces the manual `deploy.sh --install` flow with a one-line `curl | bash` install that delegates to upstream installers (`npx ctx7 setup`, `codegraph install`, `npm i -g opencode-subagent-statusline`). ## What ships in this PR **New files** - `workspace/opencode/install.sh` (~556 lines, bash 4+, `set -euo pipefail`) — interactive Unix installer. - `workspace/opencode/openmillas` (~360 lines, bash) — user-facing CLI; installed to `~/.local/bin/openmillas` by `install.sh`. - `workspace/opencode/lib/jsonc.sh` + `lib/_jsonc_strip.py` — shared JSONC strip + merge helper, sourced by both `deploy.sh` and `install.sh`. Replaces the duplicated heredocs in `read_bundled_mcp` and `patch_global_config`. All writes go through `mktemp + mv -f` for atomicity. - `workspace/opencode/tests/test_install.sh` (~800 lines) — 20 tests covering idempotency, prompt rejection, upstream failure recovery, tui.json merge correctness (existing / idempotent / npm-fail), opencode.jsonc MCP-merge preservation, doctor, uninstall, atomic-write, JSONC helper dedup. **Modified** - `workspace/opencode/deploy.sh` — sources `lib/jsonc.sh`, replaces duplicated heredocs with helper calls, adds copy steps for `AGENTS.md` and `codegraph/examples/`, runs the additive `tui.json` merge. Atomic write upgrade applied to `patch_global_config`. **Behavior is byte-identical for users with existing `~/.config/opencode/`.** - `workspace/opencode/opencode.jsonc` — drops `mcp.context7`; `mcp.codegraph` kept as a block with `enabled: false` and an inline pointer to `https://github.com/colbymchenry/codegraph`. - `workspace/opencode/agents/codegraph.md` — drops the `opencode-codegraph` plugin mention (was inconsistent with the bundle'''s `opencode.jsonc`). - `README.md`, `AGENTS.md` (root), `CHANGELOG.md` — version bump 0.2.0 → 0.3.0; new §Install / §Third-party services / §Optional integrations sections in README; new openmillas CLI subsection in AGENTS; Added/Changed entries under [Unreleased]. **Removed** - `LICENSE` — license-strip pass per user direction. User will relicense at end. - `spec.md` — renamed to `spec_memory.md` (memory plugin research; license claim stripped). **Compatibility for existing `deploy.sh --install` users** - `~/.config/opencode/opencode.jsonc` preserved verbatim (additive MCP merge). - `~/.config/opencode/tui.json` preserved verbatim (additive plugin merge). - `deploy.sh --check` unchanged. - New behavior: `AGENTS.md` and `codegraph/examples/` now copied by `deploy.sh` too (was a gap; resolves TD-17). ## Acceptance criteria met (16 of 16) ```bash $ bash workspace/opencode/tests/test_install.sh ================================ PASS: 20 FAIL: 0 ================================ ALL TESTS PASS $ bash workspace/opencode/deploy.sh --check [deploy] validation OK ``` ## Resolves - TD-9 (tui.json provenance — subagent-statusline plugin source documented) - TD-17 (`deploy.sh copy_bundle` gap for `AGENTS.md` and additive `tui.json` merge) - TD-18 (4 stale `codegraph.ru` / `opencode-codegraph` references in shipped docs) - TD-1a (license reconciliation, deferred per user; user will relicense at end) ## New tech debt (filed for follow-up) - TD-20 (high): `curl | bash` self-update has no SHA-256 / GPG / TOFU pin. - TD-21 (low): `install.sh` and `openmillas` duplicate ~140 lines of subcommand bodies. - TD-22 (low): `lib/jsonc.sh` ships two unused public functions. - TD-23 (low): `BUNDLE_DIR` accepts arbitrary paths without integrity verification. - TD-24 (medium): Windows PowerShell port (`install.ps1`, `openmillas.ps1`) is deferred. - TD-25 (low): `python3 -I` not used in heredocs (PYTHONPATH needed for `_jsonc_strip.py` import). - TD-26 (low): AC-9 simulated-crash half is deferred (verified atomic no-op empirically instead). ## Out of scope (planned follow-up) - Windows PowerShell port (TD-24). The current iteration is Unix only. - GPG signing of the installer payload (TD-20). - `brew tap` / `scoop` formula (spec §12). - Continuous-update via cron / systemd timer. - Telemetry (the installer does not phone home; spec §12). ## Forgejo raw URL Tested both candidate URLs against the repo; both return 404 because the remote is private. `install.sh` includes a graceful fallback: when the remote fetch fails, it prints a clear message and instructs the user to clone the repo and run `install.sh` locally. The `curl | bash` UX will work once the repo is published. ## How to review ```bash git checkout feat/spec-installer bash workspace/opencode/deploy.sh --check bash workspace/opencode/tests/test_install.sh # Manual smoke (in a fresh HOME): mkdir -p /tmp/test-home && HOME=/tmp/test-home bash workspace/opencode/install.sh --yes --no-interaction ```
- Delete LICENSE file (user will relicense at end)
- Remove 'license: Apache-2.0' from all 5 SKILL.md frontmatter
- Remove 'license' key from deploy.sh frontmatter validator and yq fallback
- Rename spec.md -> spec_memory.md (memory plugin spec; license claim removed)
- Add spec_installer.md as research design doc (kept third-party MIT references;
  Apache-2.0 / GPL-2.0-or-later references for the bundle itself removed)
- .gitignore: track __pycache__/ (lib/_jsonc_strip.py is loaded by heredocs) and
  PLAN_installer.md (architect's plan, kept locally for traceability)

Closes TD-1a (license reconciliation) by deferring per user direction.
Adds a delegation-based interactive installer for the opencode configuration bundle. The installer (and its companion CLI) is the entrypoint for one-line 'curl | bash' installs, and replaces the manual 'deploy.sh --install' flow.

Highlights:
- New workspace/opencode/install.sh (~556 lines, bash 4+, set -euo pipefail).
  Arg parsing: --update VERSION, --uninstall, --yes, --no-interaction, --help.
  Interactive prompts for three optional integrations (Context7, codegraph,
  subagent-statusline); each delegation runs the upstream installer and
  prompts to continue-with-bundle-only or abort on failure.
- New workspace/opencode/openmillas (~360 lines, bash). The user-facing CLI
  after install. Subcommands: install, update, doctor, uninstall, version.
  Installed to ~/.local/bin/openmillas by install.sh.
- New workspace/opencode/lib/jsonc.sh + _jsonc_strip.py. Shared JSONC
  strip + merge helper, sourced by both deploy.sh and install.sh. Replaces
  the duplicated heredocs in deploy.sh read_bundled_mcp and
  patch_global_config. All writes go through mktemp + mv -f for atomicity.
- New workspace/opencode/tests/test_install.sh (~800 lines). 20 tests
  covering: fresh-home install, idempotency, prompts no-to-all, upstream
  failure recovery, tui.json merge correctness (existing / idempotent /
  npm-fail), opencode.jsonc MCP-merge preservation, doctor pass/fail,
  uninstall preservation, atomic-write no-op, JSONC helper dedup.
- deploy.sh refactored: sources lib/jsonc.sh, replaces duplicated JSONC
  heredocs with helper calls, adds copy steps for AGENTS.md and the
  codegraph/examples directory, runs the additive tui.json merge.
- workspace/opencode/opencode.jsonc: dropped mcp.context7; mcp.codegraph
  kept with enabled:false and an inline pointer to the upstream installer.
- workspace/opencode/agents/codegraph.md: dropped the opencode-codegraph
  plugin mention (was inconsistent with the bundle's opencode.jsonc).

Compatibility for existing deploy.sh --install users:
- ~/.config/opencode/opencode.jsonc preserved verbatim (additive MCP merge).
- ~/.config/opencode/tui.json preserved verbatim (additive plugin merge).
- deploy.sh --check unchanged.
- New behavior: AGENTS.md and codegraph/examples/ now copied by deploy.sh too.

Resolves TD-9 (tui.json provenance), TD-17 (deploy.sh copy_bundle gaps),
TD-18 (stale codegraph.ru / opencode-codegraph refs in shipped docs).
Files new TDs 20-26 (digest pin, subcommand dedup, dead code, BUNDLE_DIR
verification, Windows port, AC-9 simulated-crash half).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MillasDev/memory!4
No description provided.