omp packages

omp-usage-widgets2.0.0

Claude/Codex/tokscale usage status-line widgets + subagent status widget for omp (oh-my-pi coding agent). Installs itself into ~/.omp/agent/extensions.

akasai Published 6 days ago MIT ~104 downloads/mo

Built for omp

The author tagged this package oh-my-pi.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

omp-usage-widgets

Claude/Codex/tokscale usage status-line widgets + subagent status widget for omp (oh-my-pi coding agent).

  • agent-model-widget.ts — shows active subagents and recently-read skills above the editor.
  • usage-widget/ — shows Claude/Codex OAuth usage percentages plus a right-aligned tokscale ($ cost) segment, matching the native status line's powerline/box-drawing style.

Install

npm install -g omp-usage-widgets

For a local dev build instead of the published registry version:

npm pack && npm install -g ./omp-usage-widgets-*.tgz

The postinstall script (runs via bun) copies both widgets and their shared helpers into ~/.omp/agent/extensions/. Native extension discovery loads them without an extensions: setting or CLI flag.

For a different installation target, set PI_CODING_AGENT_DIR when running npm:

PI_CODING_AGENT_DIR="$HOME/.omp/profiles/work/agent" npm install -g omp-usage-widgets

The installer does not interpret omp --profile. At runtime the widgets use OMP's active agent directory to read settings, with <cwd>/.omp/config.yml overriding user values. They read persisted YAML, not runtime or --config overlays.

Default usageWidget: settings are appended only when the key is absent. Existing keys, including inline or quoted YAML keys, are left byte-for-byte unchanged. Invalid YAML or an append that would make it invalid aborts installation before copying files. Defaults also live in code; the config block is optional.

Requirements

  • OMP 19.2.1 APIs. Older Theme APIs are not supported by this source revision. Version 2.0.0 targets the current Theme and width APIs; installations on older OMP versions should stay on omp-usage-widgets@1.3.2.
  • bun on PATH: npm executes bun postinstall.ts. OMP's embedded Bun does not supply a standalone bun executable for npm lifecycle scripts.
  • tokscale CLI for the cost segment: npm i -g @tokscale/cli. Without it, the segment shows an install prompt instead of numbers (no crash).
  • Claude/Codex credentials are per-machine (Keychain / ~/.claude/.credentials.json / ~/.codex/auth.json) — not bundled here, log in separately on each machine.

Updating

npm update -g omp-usage-widgets

To explicitly install the latest published release:

npm install -g omp-usage-widgets@latest

The installer overwrites this package's widget files and shared helpers. It also removes the obsolete usage-widget/config.ts copied by earlier releases. An existing usageWidget: key leaves config.yml untouched.

This means: edit widget behavior (bar width, colors, etc.) upstream in this package's source, publish a new version, and update — hand edits made directly under ~/.omp/agent/extensions/ are lost on the next update. Config values (leftInset, showCodex, ...) live in config.yml and always survive.

Config options (usageWidget: in config.yml)

Key Default Description
leftInset 2 Dashes between the left corner and the first pill
rightInset 2 Dashes between the last pill and the right corner
refreshMs 60000 Usage/cost refresh interval
showClaude true Show the Claude usage pill
showCodex true Show the Codex usage pill
showCost true Show the right-aligned tokscale cost segment

usageWidget.transparent can override native statusLine.transparent; statusLine.separator is shared by both widgets.

Why keep postinstall?

OMP 19.2.1 supports loading installed plugins directly from a root package.json#omp.extensions manifest. Copying files is not a requirement of the widget UI API. However, this package's existing distribution is npm install -g plus copying, and its root manifest does not declare native plugin entries. This cleanup preserves that installation contract.

A native-plugin migration would need all of these changes together:

  1. Declare both widget entry points in the root omp.extensions.
  2. Stop the copying postinstall and switch installation to omp plugin install.
  3. Remove the previously copied widget files and helpers after backing up local edits.

OMP deduplicates extensions by path, not package name. Keeping the copied and plugin-managed entries would load two instances. Do not use omp plugin install with this source revision expecting the widgets to register.

Development

Use Bun 1.4.4+ for the pinned OMP SDK development dependencies. Skip lifecycle scripts when installing dependencies so development does not overwrite live widgets:

bun install --ignore-scripts
bun run check
bun test tests

If only OMP's embedded Bun meets that version, prefix these commands with BUN_BE_BUN=1 omp in place of bun.

Settings and separator selection are shared under extensions/shared/. The widgets use the public Theme symbol and text-width APIs; animation is local rather than importing OMP's internal shimmer implementation.