feat(opencode): Windows PowerShell installer and Desktop key file
CLI and Desktop share %USERPROFILE%\.config\opencode. Persist the API key in .arka-api-key so GUI apps do not need a login-shell export.
This commit is contained in:
1 parent
3e440b9365
commit
cb17ce8d2a
6 files changed
+531
-12
No files matched your search
+109
-1
@@ -56,6 +56,58 @@ curl -fsSL https://git.arka-ai.ru/arka/public/raw/branch/main/opencode/install-a
|
||||
|
||||
Пока сессия не перезапущена, разговор идёт на старой модели. Это нормально: установщик не требует Arka.
|
||||
|
||||
### Windows (CLI и Desktop)
|
||||
|
||||
Официальный каталог конфига OpenCode на Windows — **`%USERPROFILE%\.config\opencode`** (то же, что `C:\Users\<имя>\.config\opencode`). Туда же смотрит **OpenCode Desktop**. Не кладите плагин только в `%APPDATA%\opencode` — Desktop его оттуда не читает, если этого каталога ещё нет.
|
||||
|
||||
PowerShell:
|
||||
|
||||
```powershell
|
||||
irm https://git.arka-ai.ru/arka/public/raw/branch/main/opencode/install-arka-provider.ps1 | iex
|
||||
```
|
||||
|
||||
С ключом и моделью по умолчанию:
|
||||
|
||||
```powershell
|
||||
iwr -useb https://git.arka-ai.ru/arka/public/raw/branch/main/opencode/install-arka-provider.ps1 `
|
||||
-OutFile $env:TEMP\install-arka.ps1
|
||||
powershell -ExecutionPolicy Bypass -File $env:TEMP\install-arka.ps1 `
|
||||
-Key $env:ARKA_API_KEY -SetDefault DeepSeek-V4-Pro
|
||||
```
|
||||
|
||||
cmd.exe:
|
||||
|
||||
```bat
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://git.arka-ai.ru/arka/public/raw/branch/main/opencode/install-arka-provider.ps1 | iex"
|
||||
```
|
||||
|
||||
Git Bash / WSL — linux-скрипт, как обычно. Это **другой** OpenCode (домашний каталог WSL), не native Windows Desktop.
|
||||
|
||||
Скрипт пишет:
|
||||
|
||||
- `%USERPROFILE%\.config\opencode\plugins\arka-ai.ts`
|
||||
- `%USERPROFILE%\.config\opencode\skills\arka-provider\SKILL.md`
|
||||
- `%USERPROFILE%\.config\opencode\.arka-api-key` (Desktop читает ключ отсюда, login-shell не нужен)
|
||||
- пользовательскую переменную среды `ARKA_API_KEY` (подхватится после полного перезапуска GUI)
|
||||
- если уже есть `%APPDATA%\opencode` — копия туда же, на всякий случай
|
||||
|
||||
Затем **полностью закройте** OpenCode Desktop (иконка в трее тоже) и CLI, откройте снова, `/models`.
|
||||
|
||||
### OpenCode Desktop (все ОС)
|
||||
|
||||
Desktop — это окно + тот же sidecar CLI. Плагины те же файлы, что и у терминала.
|
||||
|
||||
| ОС | Плагин / skill / ключ |
|
||||
|----|------------------------|
|
||||
| Windows | `%USERPROFILE%\.config\opencode\` |
|
||||
| macOS / Linux | `~/.config/opencode/` |
|
||||
|
||||
1. Поставьте провайдер скриптом выше (bash или `.ps1`).
|
||||
2. **Quit** приложения, не только закрытие окна. На Windows проверьте трей.
|
||||
3. Запустите Desktop снова. `/models` → **Arka-AI**.
|
||||
|
||||
`~/.bashrc` Desktop **не читает**. Поэтому установщик кладёт ключ в `.arka-api-key` и (на Windows) в User environment. Если модели есть в списке, но запросы 401 — ключ не попал в процесс: проверьте файл ключа и перезапуск.
|
||||
|
||||
### Что ставится
|
||||
|
||||
| Куда | Что |
|
||||
@@ -168,6 +220,61 @@ What happens:
|
||||
|
||||
Until you restart, this session keeps the old model. That is expected: the installer does not need Arka.
|
||||
|
||||
### Windows (CLI and Desktop)
|
||||
|
||||
OpenCode’s real config dir on Windows is **`%USERPROFILE%\.config\opencode`**
|
||||
(`C:\Users\<name>\.config\opencode`). **OpenCode Desktop uses that same folder.**
|
||||
Putting the plugin only in `%APPDATA%\opencode` is a common miss — Desktop will not
|
||||
load it unless that directory already exists and happens to be in use.
|
||||
|
||||
PowerShell:
|
||||
|
||||
```powershell
|
||||
irm https://git.arka-ai.ru/arka/public/raw/branch/main/opencode/install-arka-provider.ps1 | iex
|
||||
```
|
||||
|
||||
With a key and default model:
|
||||
|
||||
```powershell
|
||||
iwr -useb https://git.arka-ai.ru/arka/public/raw/branch/main/opencode/install-arka-provider.ps1 `
|
||||
-OutFile $env:TEMP\install-arka.ps1
|
||||
powershell -ExecutionPolicy Bypass -File $env:TEMP\install-arka.ps1 `
|
||||
-Key $env:ARKA_API_KEY -SetDefault DeepSeek-V4-Pro
|
||||
```
|
||||
|
||||
cmd.exe:
|
||||
|
||||
```bat
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://git.arka-ai.ru/arka/public/raw/branch/main/opencode/install-arka-provider.ps1 | iex"
|
||||
```
|
||||
|
||||
Git Bash / WSL use the Linux installer. That OpenCode is **not** the native Windows Desktop app (different home directory).
|
||||
|
||||
The script writes:
|
||||
|
||||
- `%USERPROFILE%\.config\opencode\plugins\arka-ai.ts`
|
||||
- `%USERPROFILE%\.config\opencode\skills\arka-provider\SKILL.md`
|
||||
- `%USERPROFILE%\.config\opencode\.arka-api-key` (Desktop reads the key here; no login shell needed)
|
||||
- User environment variable `ARKA_API_KEY` (GUI apps pick this up after a full restart)
|
||||
- a copy under `%APPDATA%\opencode` only if that directory already exists
|
||||
|
||||
Then **fully quit** OpenCode Desktop (tray icon too) and the CLI, start again, `/models`.
|
||||
|
||||
### OpenCode Desktop (all platforms)
|
||||
|
||||
Desktop is a window plus the same sidecar CLI. Plugins are the same files as the terminal.
|
||||
|
||||
| OS | Plugin / skill / key |
|
||||
|----|----------------------|
|
||||
| Windows | `%USERPROFILE%\.config\opencode\` |
|
||||
| macOS / Linux | `~/.config/opencode/` |
|
||||
|
||||
1. Run the installer above (bash or `.ps1`).
|
||||
2. **Quit** the app, not just the window. On Windows, check the tray.
|
||||
3. Start Desktop again. `/models` → **Arka-AI**.
|
||||
|
||||
Desktop does **not** read `~/.bashrc`. That is why the installer writes `.arka-api-key` and (on Windows) a User env var. If models show up but requests return 401, the key never reached the process: check the key file and restart.
|
||||
|
||||
### What the installer writes
|
||||
|
||||
| Path | Role |
|
||||
@@ -228,7 +335,8 @@ Inference still uses `ARKA_API_KEY` against `https://api.arka-ai.ru/v1`.
|
||||
|
||||
| File | Role |
|
||||
|------|------|
|
||||
| `install-arka-provider.sh` | Self-contained installer (the one-liner) |
|
||||
| `install-arka-provider.sh` | POSIX installer (macOS/Linux/WSL/Git Bash) |
|
||||
| `install-arka-provider.ps1` | Windows installer (CLI + Desktop) |
|
||||
| `plugins/arka-ai.ts` | Plugin source (embedded in the installer) |
|
||||
| `skills/arka-provider/SKILL.md` | Skill source (embedded in the installer) |
|
||||
| `catalog.json` | Filtered chat catalog, refreshed daily at 05:00 Europe/Moscow |
|
||||
|
||||
Reference in new issue
Block a user