-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-desktop-toolbox.ps1
More file actions
79 lines (63 loc) · 2 KB
/
Copy pathcreate-desktop-toolbox.ps1
File metadata and controls
79 lines (63 loc) · 2 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
param(
[string]$ToolboxName = "Codex登录刷新工具"
)
$ErrorActionPreference = "Stop"
$root = $PSScriptRoot
$desktop = [Environment]::GetFolderPath("Desktop")
$toolbox = Join-Path $desktop $ToolboxName
New-Item -ItemType Directory -Force -Path $toolbox | Out-Null
function Write-Cmd($name, $body) {
$path = Join-Path $toolbox $name
[System.IO.File]::WriteAllText($path, $body, (New-Object System.Text.UTF8Encoding $false))
}
Write-Cmd "1_一键刷新Codex登录.cmd" @"
@echo off
title Codex Auth Refresh
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$root\run-refresh.ps1"
echo.
echo Done. You can close this window.
pause
"@
Write-Cmd "2_登录失效时重新登录.cmd" @"
@echo off
title Codex Auth Re-Login
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$root\login-profile.ps1"
echo.
echo Done. You can close this window.
pause
"@
Write-Cmd "3_查看刷新状态.cmd" @"
@echo off
title Codex Auth Status
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$root\status.ps1"
echo.
pause
"@
Write-Cmd "4_打开日志和工具目录.cmd" @"
@echo off
title Codex Auth Folders
start "" "$root"
start "" "$root\logs"
start "" "$root\backups"
exit /b 0
"@
Write-Cmd "README.txt" @"
Codex login refresh toolbox
Real tool location:
$root
Use these desktop entries:
1_一键刷新Codex登录.cmd
Run a manual refresh now.
2_登录失效时重新登录.cmd
Use this when ChatGPT login state expires. A browser window opens. Log in, return to the terminal, and press Enter.
3_查看刷新状态.cmd
Show scheduled task status, last run result, auth.json status, and recent logs.
4_打开日志和工具目录.cmd
Open the tool, logs, and backups folders.
Notes:
- Tokens are not stored on the desktop.
- Logs mask token values.
- The scheduled task name is CodexAuthSessionRefresh.
- The workaround updates the Codex auth.json file because Codex reads it by default.
"@
Write-Host "[OK] Desktop toolbox created: $toolbox"