Skip to content
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
20 changes: 20 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,23 @@ jobs:
- name: install / check / uninstall
shell: bash
run: ./scripts/smoke-install.sh

smoke-windows:
name: Windows smoke (${{ matrix.shell }})
runs-on: windows-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
shell: [powershell, pwsh]
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: install / check / uninstall
run: ./scripts/smoke-install.ps1
- name: Native memory compaction
run: ./scripts/test-memory-compact.ps1
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ npm run docs:dev # http://localhost:5173/opencode-team/

`install.sh` never edits `opencode.json`. Set `default_agent` and `instructions` yourself (see README).

On native Windows, use `install.ps1` instead of `install.sh`, with `-Check`, `-Uninstall`, or `-InstallOpenCode` as needed. Run in Administrator PowerShell (Windows PowerShell 5.1 or PowerShell 7), or use PowerShell 7 with Developer Mode enabled. If local execution policy blocks scripts, invoke `powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1`. Neither installer changes your JSON configuration or machine policy. See [Windows installation](docs/install.md#windows).

## What you can change

| Area | Path | Frontmatter |
Expand Down Expand Up @@ -81,6 +83,15 @@ The validator checks frontmatter, filename/name matches, agent and command refer

CI also runs `shellcheck --severity=error`. It is preinstalled on `ubuntu-latest`; locally, install it with your package manager if you want the same result.

Native Windows tests need symbolic-link privileges and run offline against temporary directories, with fake OpenCode/npm commands:

```powershell
.\scripts\smoke-install.ps1
.\scripts\test-memory-compact.ps1
```

Run both under Windows PowerShell 5.1 and PowerShell 7 when changing native scripts. The `windows-latest` job tests both shells. Ruby is still needed for manifest validation/reference generation, and Node 22+ for the docs build; these are contributor tools, not dependencies of the team installer.

Build the docs before opening a PR that touches `docs/`:

```bash
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,26 @@ The orchestrator is the **default agent**. Open `opencode` anywhere, describe an

Requires OpenCode 1.x (tested on 1.19.0). OpenCode 2 support is planned as a separate release. There is no tagged release yet; `main` is the development branch.

Supported on macOS and Linux. Native Windows is **not supported yet**: `install.sh` is Bash and uses symlinks. WSL is untested.
Supported on macOS, Linux, and native Windows (Windows PowerShell 5.1 or PowerShell 7; verified with OpenCode 1.19.4). WSL is untested.

On macOS or Linux:

```bash
git clone https://github.com/sametcelikbicak/opencode-team.git
cd opencode-team
./install.sh
```

On Windows, clone the repository and run the PowerShell installer from an **Administrator PowerShell**:

```powershell
git clone https://github.com/sametcelikbicak/opencode-team.git
cd opencode-team
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
```

PowerShell 7 with Windows Developer Mode enabled can create the symlinks without elevation. The process-scoped `-ExecutionPolicy Bypass` does not change your machine policy. See the [Windows installation guide](docs/install.md#windows) for checks, optional OpenCode installation, and troubleshooting.

If OpenCode is not on your PATH, install it first, or let the installer run the official OpenCode 1.x installer:

```bash
Expand All @@ -100,7 +112,7 @@ Restart opencode. That's it — the setup is global, so it works in every projec

The repo stays in git; the config directory holds symlinks. Edit a file in the repo and it takes effect immediately.

The installer never modifies `opencode.json`. If `default_agent` is not set to `orchestrator`, it prints the recommended snippet and leaves the file alone.
Neither installer modifies `opencode.json`. If `default_agent` is not set to `orchestrator`, it prints the recommended snippet and leaves the file alone. On Windows the default directory is `%USERPROFILE%\.config\opencode`; both installers honor `OPENCODE_CONFIG_DIR`.

Check or remove the install:

Expand All @@ -109,6 +121,13 @@ Check or remove the install:
./install.sh --uninstall
```

Windows equivalents (use the same elevated shell or Developer Mode setup):

```powershell
.\install.ps1 -Check
.\install.ps1 -Uninstall
```

`--check` exits non-zero when a symlink is missing. A missing `default_agent` setting is shown as a hint, not a failure. `--uninstall` removes only symlinks that point into this repo.

### Manual setup
Expand Down
23 changes: 21 additions & 2 deletions README.tr.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,26 @@ Orkestratör **varsayılan ajandır**. Herhangi bir dizinde `opencode` açın, f

OpenCode 1.x gerektirir (1.19.0 ile test edildi). OpenCode 2 desteği ayrı bir sürüm olarak planlanıyor. Henüz etiketli sürüm yok; geliştirme `main` üzerinde devam ediyor.

macOS ve Linux desteklenir. Yerel Windows **henüz desteklenmiyor**: `install.sh` Bash kullanır ve symlink oluşturur. WSL test edilmedi.
macOS, Linux ve yerel Windows desteklenir (Windows PowerShell 5.1 veya PowerShell 7; OpenCode 1.19.4 ile doğrulandı). WSL test edilmedi.

macOS veya Linux:

```bash
git clone https://github.com/sametcelikbicak/opencode-team
cd opencode-team
./install.sh
```

Windows'ta repoyu klonlayın ve kurucuyu **yönetici PowerShell** üzerinden çalıştırın:

```powershell
git clone https://github.com/sametcelikbicak/opencode-team.git
cd opencode-team
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
```

Windows Geliştirici Modu açıkken PowerShell 7 ile yönetici yetkisi olmadan da symlink oluşturulabilir. `-ExecutionPolicy Bypass` yalnızca bu işlem için geçerlidir; makinenin kalıcı politikasını değiştirmez. Kontrol, isteğe bağlı OpenCode kurulumu ve sorun giderme için [Windows kurulum kılavuzuna](docs/install.md#windows) bakın.

OpenCode PATH'te yoksa önce kurun veya kurulum betiğinin resmî OpenCode 1.x kurucusunu çalıştırmasına izin verin:

```bash
Expand All @@ -100,7 +112,7 @@ opencode'u yeniden başlatın. Hepsi bu — kurulum global'dir, her proje dizini

Repo git'te kalır, yapılandırma dizininde symlink bulunur. Repoda bir dosyayı düzenlediğinizde etkisi anında olur.

Kurulum betiği `opencode.json` dosyasını hiçbir zaman değiştirmez. `default_agent` `orchestrator` olarak ayarlı değilse önerilen snippet'i yazdırır, dosyayı olduğu gibi bırakır.
İki kurucu da `opencode.json` dosyasını hiçbir zaman değiştirmez. `default_agent` `orchestrator` olarak ayarlı değilse önerilen snippet'i yazdırır, dosyayı olduğu gibi bırakır. Windows'ta varsayılan dizin `%USERPROFILE%\.config\opencode` yoludur; iki kurucu da `OPENCODE_CONFIG_DIR` değişkenini kullanabilir.

Kurulumu kontrol etmek veya kaldırmak için:

Expand All @@ -109,6 +121,13 @@ Kurulumu kontrol etmek veya kaldırmak için:
./install.sh --uninstall
```

Windows karşılıkları (aynı yönetici veya Geliştirici Modu oturumunda):

```powershell
.\install.ps1 -Check
.\install.ps1 -Uninstall
```

`--check`, bir symlink eksikse sıfır dışı kodla çıkar. Eksik `default_agent` ayarı hata değil, öneri olarak gösterilir. `--uninstall` yalnızca bu repoya işaret eden symlink'leri kaldırır.

### Manuel kurulum
Expand Down
40 changes: 40 additions & 0 deletions TESTING-WINDOWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Native Windows verification

Date: 2026-10-27 (Europe/Istanbul)

Issue: #42

## Automated checks

| Check | Result |
| --- | --- |
| `scripts/smoke-install.ps1`, Windows PowerShell 5.1 | Passed, 102 assertions |
| `scripts/smoke-install.ps1`, PowerShell 7.6.5 | Passed, 102 assertions |
| `scripts/test-memory-compact.ps1`, Windows PowerShell 5.1 | Passed, 38 assertions |
| `scripts/test-memory-compact.ps1`, PowerShell 7.6.5 | Passed, 38 assertions |
| `ruby scripts/validate.rb` | Passed, 47 files |
| `ruby scripts/generate-reference.rb` | Passed; generated reference unchanged |
| `bash -n install.sh scripts/*.sh skills/team-memory/*.sh` | Passed |
| Existing `scripts/smoke-install.sh` | Passed under elevated Git Bash with `MSYS=winsymlinks:nativestrict` |
| Existing `scripts/test-memory-compact.sh` | Passed |
| `npm run docs:build` | Passed |

Native tests ran elevated because Developer Mode was disabled. They use disposable directories and fake OpenCode/npm commands; they never install packages or modify actual user configuration. Existing Unix scripts were also checked, but this is a Windows run, not a new macOS/Linux run. A Windows GitHub Actions job for both shells is configured; remote CI has not been run during this work.

## Actual OpenCode 1.19.4

An isolated config/data environment using the real installed binary discovered all 14 team agents, 19 commands, and 13 local skills. A disposable `opencode.json` resolved `orchestrator` as the default and both team instruction paths. The PowerShell install/check succeeded. No provider/model calls were made.

Installation into the actual user config also passed `-Check`. The preexisting `opencode.json` SHA256 was identical before/after. The installer printed the recommended settings instead of changing provider/model/default-agent settings.

The existing user database had a v2 schema (`session_v2` and `session_message`, no `session`) and caused OpenCode 1.19.4 to fail before agent discovery. A process-local `XDG_DATA_HOME` pointing at a separate v1 data directory allowed the real user configuration to discover all 14 team agents. The original database was not reset or migrated. See [Windows database troubleshooting](docs/install.md#windows-database-is-not-empty-and-has-no-session-table).

Provider authentication, model responses, and a full idea-to-launch pipeline were not exercised. Those depend on the user's configured provider and may incur usage.

## Independent review

A fresh reviewer found one important issue: relative `OPENCODE_CONFIG_DIR`/`MEMORY_DIR` values were resolved against the process-start directory instead of PowerShell's current location after `Set-Location`. Both regressions failed before the fix. Both helpers now resolve through the PowerShell filesystem provider before normalizing with .NET; the complete native suites passed after the fix.

Review scope decisions: memory compaction still requires no concurrent writers; the existing single-line log format remains the contract; v2 session migration remains outside this Windows installer change. The separate-data-directory workaround preserves those v2 sessions rather than converting them.

The process-only `OPENCODE_CONFIG_CONTENT` startup alternative was also verified with the user's actual config: `orchestrator` resolved as the default, both team instruction paths were present, and all 14 team agents were discovered, without editing `opencode.json`.
2 changes: 1 addition & 1 deletion agents/orchestrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Read `skills/team-memory/SKILL.md` before seeding, dispatching or compacting mem
1. Confirm no subagents are running.
2. Read the logs changed during the stage.
3. Promote durable facts to `INDEX.md`; create a decision file when the stage made a real decision.
4. Run the installed `~/.config/opencode/skills/team-memory/memory-compact.sh` from the project root to archive old log entries (over 40) and compact `INDEX.md` (over 60 lines). It reads `$PWD/.team/memory` by default.
4. Run the installed memory compactor from the project root to archive old log entries (over 40) and compact `INDEX.md` (over 60 lines). Resolve the global config root from `OPENCODE_CONFIG_DIR`, otherwise `~/.config/opencode`. On native Windows invoke `powershell.exe -NoProfile -ExecutionPolicy Bypass -File "<config-root>/skills/team-memory/memory-compact.ps1"`; on macOS/Linux invoke `<config-root>/skills/team-memory/memory-compact.sh`. Both default to the current project's `.team/memory`; when `memory_dir` is customized, set `MEMORY_DIR` to that project-resolved path for the helper. See the memory skill for shell-specific examples.
5. Write the stage transition to `log/orchestrator.md`.
6. Update `stage` in `INDEX.md` when the user approves the gate and the next stage starts.

Expand Down
6 changes: 5 additions & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ cd opencode-team

Restart opencode after installation.

On native Windows, use an Administrator PowerShell and run `powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1` instead of `./install.sh`. See the [Windows guide](install.md#windows).

### Does it work on Windows?

Not natively yet. macOS and Linux are supported. `install.sh` is Bash and creates symlinks; native Windows needs a separate installer and CI coverage. WSL is untested, so treat it as experimental.
Yes. Use `install.ps1` with Windows PowerShell 5.1 or PowerShell 7. Symbolic links require an Administrator PowerShell, or PowerShell 7 with Windows Developer Mode enabled. Configuration defaults to `%USERPROFILE%\.config\opencode` and supports `OPENCODE_CONFIG_DIR`. Installation and memory maintenance have native PowerShell tests and Windows CI coverage. WSL is untested. See [Windows installation](install.md#windows).

### Do I need OpenCode 1.x or 2.x?

Expand All @@ -28,6 +30,8 @@ OpenCode Team is tested on OpenCode 1.x (1.19.0). OpenCode 2 support is planned

This removes only symlinks that point into this repo. `opencode.json` is never modified.

On Windows, use `.\install.ps1 -Uninstall`; `.\install.ps1 -Check` verifies the installation.

## Memory

### Where is memory stored?
Expand Down
77 changes: 72 additions & 5 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Install OpenCode Team into your OpenCode configuration so you can use it in any

## Requirements

- [OpenCode](https://opencode.ai) 1.x (tested on 1.19.0)
- [OpenCode](https://opencode.ai) 1.x (tested on 1.19.0; native Windows verified on 1.19.4)
- An OpenCode Zen account or any provider configured in opencode — the defaults use free-tier models

## Platform support
Expand All @@ -13,13 +13,15 @@ Install OpenCode Team into your OpenCode configuration so you can use it in any
|----------|--------|
| macOS | Supported |
| Linux | Supported |
| Windows (native) | Not supported yet |
| Windows (native) | Supported: Windows PowerShell 5.1 and PowerShell 7 |
| Windows (WSL) | Untested |

`install.sh` is Bash and creates symlinks. Native Windows needs a separate installer and CI coverage; neither exists yet.
Use `install.sh` on macOS/Linux and `install.ps1` on native Windows. Both create symbolic links to the repository.

## Install

### macOS and Linux

Clone the repository and run the installer:

```bash
Expand All @@ -38,9 +40,61 @@ If OpenCode is not on your PATH, install it first:

Restart opencode after installation. The setup is global, so it works in every project directory.

### Windows

Open an **Administrator PowerShell**, then run:

```powershell
git clone https://github.com/sametcelikbicak/opencode-team.git
cd opencode-team
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
```

Windows PowerShell 5.1 is included with Windows. PowerShell 7 (`pwsh`) is also supported; with Windows Developer Mode enabled, it can create symbolic links without elevation. The installer never elevates itself or changes Developer Mode. Without link privileges, it stops before changing installation links and explains how to proceed.

`-ExecutionPolicy Bypass` applies only to the new PowerShell process. It does not change the machine's execution policy; an organization policy can still restrict script execution. In a shell that already permits scripts, `.\install.ps1` is sufficient.

OpenCode 1.x must already be on PATH. To explicitly install it when missing or incompatible, use:

```powershell
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -InstallOpenCode
```

This optional mode requires npm and runs `npm install --global opencode-ai@1`, then verifies the executable. It reuses an existing working 1.x installation. Without the switch, the installer never changes OpenCode. OpenCode 2 is rejected.

The default config directory is `%USERPROFILE%\.config\opencode`. To use a different directory, set the same environment variable for installation **and** subsequent OpenCode sessions:

```powershell
$env:OPENCODE_CONFIG_DIR = 'D:\my config\opencode'
.\install.ps1
opencode
```

The installer prints a JSON snippet containing paths for that actual directory. Merge it into your existing `opencode.json` to enable the orchestrator and global instructions; preserve provider/model settings. The installer does not edit JSON or JSONC.

Alternatively, for the default config directory, you can supply the team settings only to the current terminal without editing your configuration file:

```powershell
$env:OPENCODE_CONFIG_CONTENT = '{"default_agent":"orchestrator","instructions":["~/.config/opencode/team/AGENTS.md","~/.config/opencode/team.yaml"]}'
opencode
```

For a custom config directory, use the instruction paths printed by the installer. If you already use `OPENCODE_CONFIG_CONTENT`, merge these settings into its existing value instead of replacing it.

Verify or uninstall from the same elevated shell (or PowerShell 7 with Developer Mode):

```powershell
.\install.ps1 -Check
.\install.ps1 -Uninstall
```

Repeat installation is safe. Local/external skills are preserved; conflicting core entries are reported and preserved. Check fails for missing/wrong core links, missing skills, or an unavailable/incompatible OpenCode. A missing `default_agent` is a hint. Uninstall removes only this repository's links, without deleting their targets, ordinary files, or your configuration. Linked config containers are rejected to avoid modifying another directory through a parent link.

Native Windows memory maintenance uses `memory-compact.ps1`, so the team's memory helper does not require Bash. See [Memory](memory.md#native-windows).

## What the installer does

`install.sh` symlinks the repo into your OpenCode config:
The platform's installer symlinks the repo into your OpenCode config:

| Path | Target |
|-------------------------------------|--------------------------------|
Expand Down Expand Up @@ -87,7 +141,7 @@ Remove only symlinks that point into this repo:
./install.sh --uninstall
```

`opencode.json` is never modified by the installer.
`opencode.json` is never modified by either installer. For Windows commands, see [Windows](#windows).

## First run

Expand All @@ -101,6 +155,19 @@ The orchestrator will start the pipeline and ask for your approval at each gate.

## Troubleshooting

### Windows: `Database is not empty and has no session table`

This can occur when OpenCode 1.x opens a data directory previously migrated by OpenCode 2. It is separate from the team installer: a v2 database has `session_v2` instead of the v1 `session` table. See the [upstream report](https://github.com/anomalyco/opencode/issues/56764).

Keep that database and use a separate data directory for your 1.x session:

```powershell
$env:XDG_DATA_HOME = Join-Path $env:USERPROFILE '.local/share/opencode-v1'
opencode --agent orchestrator
```

This environment setting applies to the current terminal and its child processes. It preserves the original database and uses fresh v1 session/authentication data; connect your provider in the new environment if needed. The global team configuration remains in `%USERPROFILE%\.config\opencode` (or `OPENCODE_CONFIG_DIR`). It does not migrate v2 sessions. Do not delete the old database to fix this error.

### `opencode: command not found`

The installer only links files when OpenCode is already on your PATH. To install OpenCode 1.x first:
Expand Down
Loading
Loading