Skip to content

Commit d28c214

Browse files
committed
feat: add Windows support with PowerShell CLI
- Add bin/dk.ps1: PowerShell CLI compatible with OpenSSL encryption - Add install.ps1/uninstall.ps1: Windows installation scripts - Refactor keyManager.ts: built-in crypto, no CLI dependency - Update README: Windows installation instructions - Add CI smoke test for dk.ps1 on Windows Ref #1
1 parent 74ea8f4 commit d28c214

7 files changed

Lines changed: 988 additions & 27 deletions

File tree

.github/workflows/build-electron.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ jobs:
3232
with:
3333
node-version: '20'
3434

35+
- name: Smoke test dk.ps1 (Windows)
36+
if: matrix.platform == 'win'
37+
shell: pwsh
38+
env:
39+
USERPROFILE: '${{ runner.temp }}\oroio-test'
40+
LOCALAPPDATA: '${{ runner.temp }}\oroio-test\AppData\Local'
41+
run: |
42+
New-Item -ItemType Directory -Path $env:LOCALAPPDATA -Force | Out-Null
43+
./bin/dk.ps1 add "sk-ci-1"
44+
./bin/dk.ps1 add "sk-ci-2"
45+
./bin/dk.ps1 use 2
46+
$out = ./bin/dk.ps1 run pwsh -NoLogo -NoProfile -Command 'Write-Output $env:FACTORY_API_KEY'
47+
if ($out.Trim() -ne 'sk-ci-2') { Write-Error "dk run failed: $out" }
48+
3549
- name: Install web dependencies
3650
working-directory: web
3751
run: npm ci

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@ dk manages multiple Factory Droid API keys in one place. It tracks usage limits
1818

1919
### Install
2020

21+
**macOS / Linux:**
22+
2123
```bash
2224
curl -fsSL https://raw.githubusercontent.com/notdp/oroio/main/install.sh | bash
2325
```
2426

25-
The installer adds a `droid` alias to your shell. Restart your terminal, then just run `droid`.
27+
**Windows (PowerShell):**
28+
29+
```powershell
30+
irm https://raw.githubusercontent.com/notdp/oroio/main/install.ps1 | iex
31+
```
32+
33+
The installer adds a `droid` function to your shell. Restart your terminal, then just run `droid`.
2634

2735
### Basic Workflow
2836

@@ -79,28 +87,42 @@ Download from [Releases](https://github.com/notdp/oroio/releases/tag/electron-di
7987

8088
> **macOS**: After installing, run `xattr -cr /Applications/oroio.app` to bypass Gatekeeper (app is unsigned).
8189
>
82-
> **Note**: The desktop app requires the `dk` CLI to be installed first.
90+
> **Note**: The desktop app works standalone for key management. To use `droid` in terminal, install the CLI separately.
8391
8492
![alt text](assets/imgs/desktop.png)
8593

8694
## Installation Details
8795

8896
### What Gets Installed
8997

98+
**macOS / Linux:**
9099
- Binary: `~/.local/bin/dk`
91100
- Data: `~/.oroio/`
92101
- Shell alias: `droid``dk run droid`
93102

103+
**Windows:**
104+
- Script: `%LOCALAPPDATA%\oroio\bin\dk.ps1`
105+
- Data: `%USERPROFILE%\.oroio\`
106+
- PowerShell function: `droid``dk run droid`
107+
94108
### Updating
95109

96110
```bash
97-
dk reinstall
111+
dk reinstall # macOS/Linux
112+
```
113+
114+
```powershell
115+
irm https://raw.githubusercontent.com/notdp/oroio/main/install.ps1 | iex # Windows
98116
```
99117

100118
### Uninstalling
101119

102120
```bash
103-
dk uninstall
121+
dk uninstall # macOS/Linux
122+
```
123+
124+
```powershell
125+
irm https://raw.githubusercontent.com/notdp/oroio/main/uninstall.ps1 | iex # Windows
104126
```
105127

106128
---

README.zh-CN.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@ dk 集中管理多个 Factory Droid API 密钥,实时追踪用量和到期时
1818

1919
### 安装
2020

21+
**macOS / Linux:**
22+
2123
```bash
2224
curl -fsSL https://raw.githubusercontent.com/notdp/oroio/main/install.sh | bash
2325
```
2426

25-
安装程序会在 shell 中添加 `droid` 别名。重启终端后直接运行 `droid` 即可。
27+
**Windows (PowerShell):**
28+
29+
```powershell
30+
irm https://raw.githubusercontent.com/notdp/oroio/main/install.ps1 | iex
31+
```
32+
33+
安装程序会在 shell 中添加 `droid` 函数。重启终端后直接运行 `droid` 即可。
2634

2735
### 基本用法
2836

@@ -79,28 +87,42 @@ dk serve status # 检查运行状态
7987

8088
> **macOS**:安装后运行 `xattr -cr /Applications/oroio.app` 以绕过 Gatekeeper(应用未签名)。
8189
>
82-
> **注意**桌面应用需要先安装 `dk` CLI。
90+
> **注意**桌面应用可独立管理密钥。如需在终端使用 `droid`,请单独安装 CLI。
8391
8492
![alt text](assets/imgs/desktop.png)
8593

8694
## 安装详情
8795

8896
### 安装内容
8997

98+
**macOS / Linux:**
9099
- 可执行文件:`~/.local/bin/dk`
91100
- 数据目录:`~/.oroio/`
92101
- Shell 别名:`droid``dk run droid`
93102

103+
**Windows:**
104+
- 脚本:`%LOCALAPPDATA%\oroio\bin\dk.ps1`
105+
- 数据目录:`%USERPROFILE%\.oroio\`
106+
- PowerShell 函数:`droid``dk run droid`
107+
94108
### 更新
95109

96110
```bash
97-
dk reinstall
111+
dk reinstall # macOS/Linux
112+
```
113+
114+
```powershell
115+
irm https://raw.githubusercontent.com/notdp/oroio/main/install.ps1 | iex # Windows
98116
```
99117

100118
### 卸载
101119

102120
```bash
103-
dk uninstall
121+
dk uninstall # macOS/Linux
122+
```
123+
124+
```powershell
125+
irm https://raw.githubusercontent.com/notdp/oroio/main/uninstall.ps1 | iex # Windows
104126
```
105127

106128
---

0 commit comments

Comments
 (0)