Skip to content

Hemilt0n/opencode-go-usage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-go-usage

Check your OpenCode Go subscription usage from the CLI.

$ opencode-go-usage
OpenCode Go Usage:
  Rolling (5h)  :  10%  [██░░░░░░░░░░░░░░░░░░]  resets in 2h 20m
  Weekly        :  11%  [██░░░░░░░░░░░░░░░░░░]  resets in 3d 12h
  Monthly       :  19%  [███░░░░░░░░░░░░░░░░░]  resets in 21d 21h

Install

uvx --from git+https://github.com/Hemilt0n/opencode-go-usage opencode-go-usage

Or run from source:

git clone https://github.com/Hemilt0n/opencode-go-usage
cd opencode-go-usage
uv sync
uv run opencode-go-usage

Setup

Create .env.private in the directory you run the command from:

OPENCODE_GO_WORKSPACE_ID=wrk_...
OPENCODE_GO_AUTH_COOKIE=Fe26.2**...

Getting credentials

Workspace ID — from https://opencode.ai/workspace/<ID>/go.

Auth cookie — open DevTools (F12) in your browser while logged into opencode.ai:

  1. Application tab → Cookies → https://opencode.ai
  2. Copy the auth cookie value (starts with Fe26.2**)

You can also use environment variables instead of .env.private:

export OPENCODE_GO_WORKSPACE_ID=wrk_...
export OPENCODE_GO_AUTH_COOKIE=Fe26.2**...

API key (future)

A PR is open to add GET /zen/go/v1/usage. Once merged, you'll be able to use the Go API key directly:

OPENCODE_GO_API_KEY=sk-...

Usage

opencode-go-usage [--json]

--json outputs machine-readable JSON.

Colors: green (<50%), yellow (50–80%), red (>80%).


OpenCode — the AI coding agent.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages