Skip to main content

CLI that displays OpenCode Go workspace usage from the web dashboard

Project description

opencode-go-usage-analyzer

CLI tool to display OpenCode Go workspace usage limits from the web dashboard.

Features

  • Shows Rolling/Weekly/Monthly usage with a colorized terminal table.
  • Interactive authentication prompt (workspace ID + auth token).
  • Local session persistence by default.
  • --no-remember mode for one-off runs without touching local session storage.
  • --logout to clear the saved local session quickly.

Requirements

  • Python 3.10+
  • uv (recommended) or pip

Install

With uv (recommended)

uv tool install opencode-go-usage-analyzer

From source

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

With Nix (flake)

Run directly without installing:

nix run github:henriqueSFernandes/opencode-go-usage-analyzer -- --help

Install imperatively to your user profile:

nix profile install github:henriqueSFernandes/opencode-go-usage-analyzer

Add to a NixOS or Home Manager flake (declarative):

# flake.nix
{
  inputs.opencode-go-usage-analyzer.url = "github:henriqueSFernandes/opencode-go-usage-analyzer";

  outputs = { self, nixpkgs, home-manager, opencode-go-usage-analyzer, ... }@inputs: {
    # ...
  };
}

Then in your Home Manager configuration:

{ config, pkgs, inputs, ... }:

{
  home.packages = [
    inputs.opencode-go-usage-analyzer.packages.${pkgs.system}.default
  ];
}

Usage

opencode-usage

On first run, the CLI prompts for:

  • Workspace ID
  • Auth token (auth cookie value)

By default, credentials are saved to .opencode/session.json and reused automatically.

Command options

opencode-usage --no-remember
opencode-usage --logout
  • --no-remember: do not read or write the local session file.
  • --logout: delete the local saved session and exit.

Development

uv sync --extra dev
uv run opencode-usage --help
uv build

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencode_go_usage_analyzer-0.3.1.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencode_go_usage_analyzer-0.3.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file opencode_go_usage_analyzer-0.3.1.tar.gz.

File metadata

  • Download URL: opencode_go_usage_analyzer-0.3.1.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for opencode_go_usage_analyzer-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5e94645b2779b8a6031c2315000e4901a171c49f6c489c632696c47238af0214
MD5 7a1ebc0ffe3284d578a6ec8ba80bab9d
BLAKE2b-256 2b06067c4ba30d87c75fe14df60f199cde599d44861413b43b4a66befc97a581

See more details on using hashes here.

File details

Details for the file opencode_go_usage_analyzer-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: opencode_go_usage_analyzer-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for opencode_go_usage_analyzer-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca8d4f82c58d0cc30e0b3f553f1e6ffccb70c582b3bba53daf88537dfe581d73
MD5 35f59649e76eae0fcf4a75fdf769d47a
BLAKE2b-256 fb4ce370c35bae33760dbe404de142ef5ff461b5d63d763c7fa84d7d2b14d3b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page