-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup-FirstRun.ps1
More file actions
44 lines (34 loc) · 1.46 KB
/
Copy pathSetup-FirstRun.ps1
File metadata and controls
44 lines (34 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[CmdletBinding()]
param()
$Root = Split-Path -Parent $PSCommandPath
$ConfigDir = Join-Path $Root "config"
$SecretsDir = Join-Path $Root "secrets"
if (-not (Test-Path $ConfigDir)) { New-Item -ItemType Directory -Path $ConfigDir | Out-Null }
if (-not (Test-Path $SecretsDir)) { New-Item -ItemType Directory -Path $SecretsDir | Out-Null }
$KeyFile = Join-Path $SecretsDir "opencode-zen-api-key.txt"
$ProjectFile = Join-Path $ConfigDir "project-path.txt"
$PermissionFile = Join-Path $ConfigDir "permission-mode.txt"
Write-Host ""
Write-Host "Claude Code + OpenCode Zen first-time setup" -ForegroundColor Cyan
Write-Host ""
$key = Read-Host "Paste your OpenCode Zen API key"
Set-Content -LiteralPath $KeyFile -Value $key -Encoding UTF8
Write-Host "Saved API key." -ForegroundColor Green
$project = Read-Host "Paste your project folder path"
Set-Content -LiteralPath $ProjectFile -Value $project -Encoding UTF8
Write-Host "Saved project path." -ForegroundColor Green
Write-Host ""
Write-Host "Permission mode:"
Write-Host "1. default"
Write-Host "2. auto"
Write-Host "3. bypassPermissions"
$choice = Read-Host "Choose permission mode"
switch ($choice) {
"2" { $mode = "auto" }
"3" { $mode = "bypassPermissions" }
default { $mode = "default" }
}
Set-Content -LiteralPath $PermissionFile -Value $mode -Encoding UTF8
Write-Host "Saved permission mode: $mode" -ForegroundColor Green
Write-Host ""
Write-Host "Setup complete. Run ClaudeCode-OpenCodeZen-Menu.cmd" -ForegroundColor Green