Skip to content

[feature]: Opencode Go without workspace ID and auth cookie #70

@ak-specto

Description

@ak-specto

Pre-flight checks

  • I searched existing issues and did not find a duplicate request.
  • I reviewed current behavior on the production released OpenCode version.

OpenCode version reviewed

1.14.29

Problem statement

Currently to setup Opencode Go quota information in this plugin, we need to add certain env values:

export OPENCODE_GO_WORKSPACE_ID="your-workspace-id"
export OPENCODE_GO_AUTH_COOKIE="your-auth-cookie"

Proposed change

Is there a way to query the local DB and configurations, without these values. The Openusage application doesn't require this, yet it shows the up to date information about the Opencode Go usage, I found the source file which queries this information: https://github.com/robinebers/openusage/blob/main/plugins/opencode-go/plugin.js

...
  const AUTH_PATH = "~/.local/share/opencode/auth.json";
  const DB_PATH = "~/.local/share/opencode/opencode.db";
...

Looks like it queries the information automatically.
Is there an option for this plugin to do the same?

Alternatives considered

No response

Acceptance criteria

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions