Description
On Windows, getAuthFilePath() in src/index.ts looks for auth.json at:
%LOCALAPPDATA%\opencode\auth.json
But OpenCode stores it at:
~/.local/share/opencode/auth.json
Steps to Reproduce
- Install opencode-glm-quota on Windows
- Authenticate via
/connect with Z.AI Coding Plan
- Run
/glm_quota
- See: "Credentials Not Found"
Root Cause
getAuthFilePath() only checks the Windows-specific path (LOCALAPPDATA), but OpenCode uses the XDG-compatible path (~/.local/share/opencode/auth.json) on all platforms including Windows. The function should check both paths.
Workaround
Copy-Item "$env:USERPROFILE\.local\share\opencode\auth.json" "$env:LOCALAPPDATA\opencode\auth.json"
Environment
- OS: Windows 11
- opencode-glm-quota: 1.8.0
Description
On Windows,
getAuthFilePath()insrc/index.tslooks forauth.jsonat:But OpenCode stores it at:
Steps to Reproduce
/connectwith Z.AI Coding Plan/glm_quotaRoot Cause
getAuthFilePath()only checks the Windows-specific path (LOCALAPPDATA), but OpenCode uses the XDG-compatible path (~/.local/share/opencode/auth.json) on all platforms including Windows. The function should check both paths.Workaround
Environment