Skip to content

[BUG] auth.json not found on Windows — wrong path in getAuthFilePath #39

@weissfl

Description

@weissfl

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

  1. Install opencode-glm-quota on Windows
  2. Authenticate via /connect with Z.AI Coding Plan
  3. Run /glm_quota
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions