Skip to content

feat: add one-line install.sh installer script#11

Merged
justin-carper merged 2 commits into
mainfrom
feat/install-script
Jun 10, 2026
Merged

feat: add one-line install.sh installer script#11
justin-carper merged 2 commits into
mainfrom
feat/install-script

Conversation

@justin-carper

Copy link
Copy Markdown
Collaborator

Summary

Adds a one-line installer matching the common opencode-plugin convention:

curl -fsSL https://raw.githubusercontent.com/stablekernel/opencode-cursor/main/install.sh | bash

What it does

  • Registers @stablekernel/opencode-cursor in opencode.jsonglobal (~/.config/opencode/) by default, --project for ./opencode.json. opencode auto-installs the npm package at startup, so no separate npm install is required.
  • Checks for Node.js 22+ on PATH (required for the Cursor SDK Node sidecar) — warns, does not hard-fail.
  • Offers to set CURSOR_API_KEY in the shell profile. Reads prompts from /dev/tty so it works under curl | bash; --yes/-y skips all prompts for CI.

Safety

  • Backs up an existing config before editing.
  • Idempotent (plugin array deduped — safe to re-run).
  • Preserves existing plugins/providers.
  • jq preferred with a Node fallback; refuses to write invalid JSON and leaves the original untouched on parse error.

Verification

  • shellcheck clean, bash -n clean.
  • 5 isolated temp-dir tests pass: fresh config, existing config + provider, idempotency, Node-only fallback (no jq), malformed-JSON safe-fail.

Docs

  • README gains a "Quick install (one line)" section alongside the existing manual install.

Mirrors the common opencode-plugin installer pattern: a curl|bash
script that registers @stablekernel/opencode-cursor in opencode.json
(global by default, --project for local), checks for Node 22+ on PATH
(required for the Cursor SDK Node sidecar), and offers to set
CURSOR_API_KEY.

- Idempotent; backs up existing config before editing
- jq preferred, Node fallback for JSON edits; refuses to write invalid JSON
- Reads prompts from /dev/tty so it works under curl|bash; --yes for CI
- Documents quick + manual install in README
@justin-carper justin-carper merged commit 22f8f8c into main Jun 10, 2026
6 checks passed
@justin-carper justin-carper deleted the feat/install-script branch June 10, 2026 22:51
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