Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,252 changes: 0 additions & 1,252 deletions .opencode/PAIOpenCodeWizard.ts

This file was deleted.

2 changes: 1 addition & 1 deletion .opencode/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
}
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "_deprecated", "PAIOpenCodeWizard.ts", "observability-server", "voice-server", "skills/**/Tools"]
"exclude": ["node_modules", "_deprecated", "observability-server", "voice-server", "skills/**/Tools"]
}
78 changes: 78 additions & 0 deletions .prd/PRD-20260327-install-docs-cleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
prd: true
id: PRD-20260327-install-docs-cleanup
status: COMPLETE
mode: interactive
effort_level: Extended
created: 2026-03-27
updated: 2026-03-27
iteration: 0
maxIterations: 128
loopStatus: null
last_phase: VERIFY
failing_criteria: []
verification_summary: "13/13"
parent: null
children: []
---

# pai-opencode install + docs cleanup (v3)

Delete retired install artifacts (wizard + GUI), make CLI installer canonical, and update all docs accordingly.

## STATUS

| What | State |
|---|---|
| Progress | 13/13 criteria passing |
| Phase | COMPLETE |
| Next action | None |
| Blocked by | Nothing |

## CONTEXT

### Problem Space
The repo currently documents multiple install paths (wizard vs PAI-Install) and includes GUI components that are not desired. The goal is a single CLI-only install flow and docs that match reality.

### Key Files
- `PAI-Install/install.sh` - Installer bootstrap entrypoint
- `PAI-Install/cli/quick-install.ts` - Headless installer implementation
- `README.md` - Project overview + quick start
- `INSTALL.md` - Canonical installation guide
- `docs/` - Supporting documentation

### Constraints
- Remove GUI installer (Electron/web/public).
- Remove `.opencode/PAIOpenCodeWizard.ts` wizard.
- Documentation must not reference removed entrypoints.

## PLAN

- Make `PAI-Install/install.sh` CLI-only (no GUI path).
- Delete GUI directories and broken GUI entrypoint (`PAI-Install/main.ts`).
- Delete wizard (`.opencode/PAIOpenCodeWizard.ts`).
- Update `README.md`, `INSTALL.md`, and `docs/` to reference `PAI-Install/install.sh --cli`.
- Verify via grep checks + running installer help paths.

## IDEAL STATE CRITERIA (Verification Criteria)

- [x] ISC-C1: GUI installer directories are removed from PAI-Install | Verify: CLI: test ! -d PAI-Install/electron
- [x] ISC-C2: Web/GUI assets are removed from PAI-Install | Verify: CLI: test ! -d PAI-Install/web
- [x] ISC-C3: PAI-Install entrypoint no longer references electron | Verify: Grep: "electron" has 0 matches in PAI-Install/install.sh
- [x] ISC-C4: Wizard file is removed from .opencode | Verify: CLI: test ! -f .opencode/PAIOpenCodeWizard.ts
- [x] ISC-C5: README quick start uses PAI-Install/install.sh CLI flow | Verify: Read: README.md install commands updated
- [x] ISC-C6: INSTALL.md uses only PAI-Install/install.sh CLI flow | Verify: Read: INSTALL.md contains no wizard invocation
- [x] ISC-C7: docs/ contain no references to removed wizard path | Verify: Grep: PAIOpenCodeWizard has 0 matches in docs/
- [x] ISC-C8: docs/ contain no instructions to run removed GUI mode | Verify: Grep: "--mode gui" has 0 matches in docs/
- [x] ISC-C12: Root docs exclude wizard/GUI installer instructions | Verify: Grep: patterns have 0 matches in *.md excluding .prd/
- [x] ISC-C9: PAI-Install/README.md matches actual directory structure | Verify: Read: PAI-Install/README.md list is accurate
- [x] ISC-C10: CLI installer help runs without throwing | Verify: CLI: bun PAI-Install/cli/quick-install.ts --help
- [x] ISC-C11: install.sh CLI mode works and forwards args | Verify: CLI: bash PAI-Install/install.sh --cli --help
- [x] ISC-A1: Docs never recommend bun run .opencode/PAIOpenCodeWizard.ts | Verify: Grep: pattern has 0 matches

## LOG

### Iteration 0 — 2026-03-27
- Phase reached: VERIFY
- Criteria progress: 13/13
- Work done: CLI-only installer enforced, GUI/wizard artifacts deleted, docs updated repo-wide
6 changes: 3 additions & 3 deletions ANNOUNCEMENT-v2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Pay exactly what the task requires.
git clone https://github.com/Steffen025/pai-opencode
cd pai-opencode
bun install
bun run .opencode/PAIOpenCodeWizard.ts
bash PAI-Install/install.sh --preset zen --name "Your Name" --ai-name "Jeremy"
opencode
```

Choose a provider preset (`zen-paid`, `openrouter`, `local-ollama`), configure your API keys, and you're running.
Choose a provider preset (`zen`, `openrouter`, `openai`, `anthropic`), configure your API keys, and you're running.

## What Didn't Change

Expand All @@ -66,4 +66,4 @@ The Algorithm v1.8.0 represents 14 upstream commits ported from Daniel Miessler'

---

**Credits**: [Daniel Miessler](https://github.com/danielmiessler) (PAI design), [Anomaly](https://github.com/anomalyco/opencode) (OpenCode platform), [Steffen025](https://github.com/Steffen025) (PAI-OpenCode port).
**Credits**: [Daniel Miessler](https://github.com/danielmiessler) (PAI design), [Anomaly](https://github.com/anomalyco/opencode) (OpenCode platform), [Steffen025](https://github.com/Steffen025) (PAI-OpenCode port).
34 changes: 17 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,31 +148,31 @@ Porting 14 upstream commits spanning Algorithm v1.3.0 through v1.8.0:

---

## v2.0.1 — Wizard Build Process Fix (2026-02-20)
## v2.0.1 — Legacy Installer Build Process Fix (2026-02-20)

### Fixed

#### Critical: Wizard Build-from-Source Completely Broken
- **Symptom:** `git clone` succeeds but wizard reports "Failed to clone repository" and aborts
#### Critical: Legacy Installer Build-from-Source Completely Broken
- **Symptom:** `git clone` succeeds but legacy installer reports "Failed to clone repository" and aborts
- **Root cause:** `execCommand()` with `stdio: 'inherit'` returns `null` from `execSync()`. Calling `.trim()` on `null` throws TypeError, caught as failure. **Every non-silent command falsely reports failure.**
- **Fix:** Null-safe guard: `output.trim()` → `(output ?? '').trim()`

#### Go Prerequisite Removed (No Longer Needed)
- **Context:** OpenCode was historically a Go project (BubbleTea TUI). It has been completely rewritten to Bun/TypeScript. The build now uses `Bun.build({ compile: true })` to produce native binaries — no Go toolchain needed.
- **Fix:** Removed Go prerequisite check from wizard and all documentation
- **Fix:** Removed Go prerequisite check from the legacy installer and all documentation
- **Fix:** Strengthened Bun version check from 1.3+ to 1.3.9+ (matches OpenCode monorepo `packageManager` field)

#### Binary Detection After Build
- **Symptom:** After successful build, wizard couldn't find the binary
- **Symptom:** After successful build, legacy installer couldn't find the binary
- **Root cause:** Generic filename search didn't match `Bun.build()` output structure (`dist/opencode-{os}-{arch}/bin/opencode`)
- **Fix:** Deterministic platform-based binary lookup using `process.platform` + `process.arch` with baseline fallback

### Changed
- **Wizard messaging** updated to reflect Bun-based build (not Go)
- **Legacy installer messaging** updated to reflect Bun-based build (not Go)
- **INSTALL.md** — Prerequisites: removed Go, added Bun 1.3.9+ note. Manual install: complete rewrite with `bun run ./packages/opencode/script/build.ts --single`. WSL section: removed `golang-go` package.
- **README.md** — Quick Start: added prerequisites line, updated wizard step description
- **docs/MIGRATION.md** — Replaced `go install` with wizard command, replaced `$(go env GOPATH)/bin` with `~/.local/bin` in PATH troubleshooting
- **EXPLORATION-SUMMARY.md** — Updated wizard flow description
- **README.md** — Quick Start: added prerequisites line, updated installer step description
- **docs/MIGRATION.md** — Replaced `go install` with installer command, replaced `$(go env GOPATH)/bin` with `~/.local/bin` in PATH troubleshooting
- **EXPLORATION-SUMMARY.md (since removed)** — Updated wizard flow description

---

Expand Down Expand Up @@ -328,7 +328,7 @@ agents:
- **3 presets** ready to use

### Migration Guide
1. Re-run the wizard: `bun run .opencode/PAIOpenCodeWizard.ts`
1. Re-run the installer update flow: `bash PAI-Install/install.sh --update`
2. Or switch profile manually: `bun run .opencode/tools/switch-provider.ts zen-paid`
3. Custom agent models → Edit `opencode.json` agent section directly

Expand Down Expand Up @@ -541,7 +541,7 @@ This release brings full PAI 2.5 Algorithm compatibility and adds 5 new handlers
| `agent-capture.ts` | Captures agent outputs |

#### Installation
- `PAIOpenCodeWizard.ts` - Interactive setup wizard
- Legacy interactive installer (removed; CLI installer is canonical)
- 8 AI providers supported (Anthropic, OpenAI, Google, Groq, AWS Bedrock, Azure, ZEN, Ollama)
- TELOS personalization framework

Expand Down Expand Up @@ -582,7 +582,7 @@ This release brings full PAI 2.5 Algorithm compatibility and adds 5 new handlers
| Verify Completion Gate | No | No | No | No | No | **Yes** | Yes |
| Effort-Scaled Gates | No | No | No | No | No | **Yes** | Yes |
| **DB Health Tooling** | No | No | No | No | No | No | **Yes** |
| **Electron GUI Installer** | No | No | No | No | No | No | **Yes** |
| **Installer (CLI-only)** | No | No | No | No | No | No | **Yes** |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistency: line 74 contradicts this CLI-only installer entry.

Line 585 correctly shows "Installer (CLI-only)" as a v3.0.0 feature, but line 74 (in the v3.0.0 "Changed" section) still reads:

Installer: CLI-only → CLI + Electron GUI

This suggests the installer gained Electron GUI, which contradicts the PR's goal of removing GUI. Consider updating line 74 to:

-- Installer: CLI-only → CLI + Electron GUI
+- Installer: Electron GUI removed, CLI-only is canonical

Or remove the installer line from the v3.0.0 "Changed" section entirely if GUI was never released.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 585, Update the v3.0.0 "Changed" section entry that
currently reads "Installer: CLI-only → CLI + Electron GUI" so it matches the
release matrix which shows "Installer (CLI-only)"; either change that line to
reflect "Installer: remains CLI-only" (or similar wording consistent with the
matrix) or remove the installer bullet entirely if the GUI was never released;
locate the entry by searching for the exact string "Installer: CLI-only → CLI +
Electron GUI" in the v3.0.0 "Changed" section and make the consistent edit.

| **v2→v3 Migration** | No | No | No | No | No | No | **Yes** |
| **Security Hardening** | No | No | No | No | No | No | **Full** |

Expand All @@ -596,7 +596,7 @@ This release brings full PAI 2.5 Algorithm compatibility and adds 5 new handlers
- Skills structure: flat → hierarchical (Category/Skill)
- Config: single-file → dual-file (opencode.json + settings.json)
- Paths: `.claude/` → `.opencode/`
- New Electron GUI installer
- New CLI-only installer

**Recommended upgrade process:**

Expand All @@ -615,9 +615,9 @@ This release brings full PAI 2.5 Algorithm compatibility and adds 5 new handlers
bun Tools/migration-v2-to-v3.ts
```

4. **Alternative: Fresh install with the new GUI:**
4. **Alternative: Fresh install (recommended for a clean setup):**
```bash
bash PAI-Install/install.sh
bash PAI-Install/install.sh
```
Comment on lines +618 to 621

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove leading whitespace from command lines in code blocks.

The commands at lines 620 and 631 have leading whitespace that could cause issues when copy-pasting:

 4. **Alternative: Fresh install (recommended for a clean setup):**
    ```bash
-    bash PAI-Install/install.sh
+   bash PAI-Install/install.sh
    ```
-  bash PAI-Install/install.sh --update
+ bash PAI-Install/install.sh --update

Also applies to: 631-631

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 618 - 621, Remove the leading spaces before the
command lines inside the code blocks that contain "bash PAI-Install/install.sh"
(the two occurrences shown in the diff), so the command lines start at column 1;
update the code blocks containing "bash PAI-Install/install.sh" to have no
leading indentation on the command lines to avoid copy-paste issues.


**See [UPGRADE.md](/UPGRADE.md) for detailed step-by-step instructions.**
Expand All @@ -628,10 +628,10 @@ This release brings full PAI 2.5 Algorithm compatibility and adds 5 new handlers
git fetch origin
git checkout main
git pull origin main
bun run .opencode/PAIOpenCodeWizard.ts
bash PAI-Install/install.sh --update
```

Re-running the wizard is recommended — it generates the new profile format with dynamic tier routing.
Re-running the installer is recommended — it generates the new profile format with dynamic tier routing.

**Manual alternative:** `bun run .opencode/tools/switch-provider.ts zen-paid`

Expand Down
37 changes: 20 additions & 17 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Installation Guide

This guide will help you install PAI-OpenCode in under 5 minutes.
This guide will help you install PAI OpenCode in under 5 minutes.

![Installation Flow](docs/images/installation-flow.jpg)

---

## Prerequisites

Before running the wizard, ensure you have:
Before running the installer, ensure you have:

1. **Git** — For cloning the repository
- macOS: `brew install git`
Expand All @@ -30,14 +30,17 @@ Before running the wizard, ensure you have:
git clone https://github.com/Steffen025/pai-opencode.git
cd pai-opencode

# 2. Run the Installation Wizard
bun run .opencode/PAIOpenCodeWizard.ts
# 2. Run the installer
bash PAI-Install/install.sh --help

# Example: fresh install (Zen)
bash PAI-Install/install.sh --preset zen --name "Your Name" --ai-name "Jeremy"

# 3. Start OpenCode
opencode
```

The wizard will:
The installer will:
1. ✅ Check prerequisites (git, bun 1.3.9+)
2. ✅ **Build OpenCode from dev source** using Bun's native compiler (required for model tiers feature)
3. ✅ Ask you to choose a preset:
Expand Down Expand Up @@ -68,8 +71,8 @@ mv ~/.opencode ~/.opencode.backup
# 3. Symlink PAI-OpenCode to your home directory
ln -s $(pwd)/.opencode ~/.opencode

# 4. Run the wizard (copies nothing — works in place)
bun run .opencode/PAIOpenCodeWizard.ts
# 4. Run the installer (works in place)
bash PAI-Install/install.sh --preset zen --name "Your Name" --ai-name "Jeremy"

# 5. Start OpenCode
opencode
Expand Down Expand Up @@ -134,8 +137,8 @@ cd ~
git clone https://github.com/Steffen025/pai-opencode.git
cd pai-opencode

# Run the Installation Wizard
bun run .opencode/PAIOpenCodeWizard.ts
# Run the installer
bash PAI-Install/install.sh --preset zen --name "Your Name" --ai-name "Jeremy"

# Start OpenCode
opencode
Expand Down Expand Up @@ -174,7 +177,7 @@ After installation, see [ADVANCED-SETUP.md](docs/ADVANCED-SETUP.md) for:

## Manual Installation

If you prefer to install manually without the wizard:
If you prefer to run the headless installer directly:

**Step 1:** Build OpenCode from dev source (required for model tiers)
```bash
Expand Down Expand Up @@ -263,7 +266,7 @@ After installation, verify everything works:

### "Command not found: opencode"

The wizard installs OpenCode to `~/.local/bin/opencode` (preferred) or `/usr/local/bin/opencode` (fallback).
The installer builds/installs OpenCode depending on your selected preset and platform.

**Check where it was installed:**
```bash
Expand Down Expand Up @@ -325,11 +328,11 @@ This means you have the **stable OpenCode installed** instead of the PAI-OpenCod
# Remove the stable version
rm $(which opencode)

# Re-run the wizard which builds from our fork using Bun's native compiler
bun run .opencode/PAIOpenCodeWizard.ts
# Re-run the installer which builds from our fork using Bun's native compiler
bash PAI-Install/install.sh --preset anthropic --name "Your Name" --ai-name "Jeremy"
```

> **Note:** The wizard builds OpenCode from our fork (`Steffen025/opencode`, branch `feature/model-tiers`) using `Bun.build({ compile: true })`. This produces a standalone native binary — no Go, no runtime dependencies.
> **Note:** The installer can build OpenCode from our fork (`Steffen025/opencode`, branch `feature/model-tiers`) using `Bun.build({ compile: true })`. This produces a standalone native binary — no Go, no runtime dependencies.

---

Expand Down Expand Up @@ -366,8 +369,8 @@ PAI-OpenCode uses a **preset system** for simplicity:
### Switching Presets

```bash
# Re-run the wizard to change preset
bun run .opencode/PAIOpenCodeWizard.ts
# Re-run the installer to change preset
bash PAI-Install/install.sh --preset openai --name "Your Name" --ai-name "Jeremy"
```

### Advanced Provider Setup
Expand Down Expand Up @@ -480,4 +483,4 @@ See [.opencode/observability-server/README.md](.opencode/observability-server/RE

---

**Installed successfully?** Give us a star on GitHub!
**Installed successfully?** Give us a star on GitHub!
Loading
Loading