npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reaatech/agent-budget-cli

v0.1.1

Published

CLI for agent-budget-controller

Downloads

45

Readme

@reaatech/agent-budget-cli

npm version License: MIT CI

Status: Pre-1.0 — APIs may change in minor versions. Pin to a specific version in production.

Command-line interface for managing agent budgets — define budgets, check remaining spend, list active scopes, generate spend reports, simulate pre-flight checks, and manually reset budgets. Installs a global agent-budget binary.

Installation

npm install -g @reaatech/agent-budget-cli
# or
pnpm add -g @reaatech/agent-budget-cli

For project-local usage:

npm install @reaatech/agent-budget-cli
pnpm add @reaatech/agent-budget-cli

Commands

agent-budget check

Check remaining budget for a scope.

agent-budget check --scope user:42
# → User user:42 — $7.50 remaining of $10.00 (active)

agent-budget check --scope org:acme --json
# → {"scopeType":"org","scopeKey":"acme","spent":45.00,"remaining":5.00,...}

| Option | Description | | -------------------- | ---------------------------------------------------------- | | --scope <type:key> | Scope identifier (e.g., user:42, org:acme, task:abc) | | --json | Output as JSON instead of human-readable text |

agent-budget list

List all active budgets.

agent-budget list
agent-budget list --scope-type user
agent-budget list --json

| Option | Description | | --------------------- | ------------------------------------------------------- | | --scope-type <type> | Filter by scope type (task, user, session, org) | | --json | Output as JSON |

agent-budget report

Generate a spend breakdown report.

agent-budget report --scope user:42
agent-budget report --scope user:42 --hours 24
agent-budget report --scope user:42 --json

| Option | Description | | -------------------- | --------------------------------- | | --scope <type:key> | Scope to report on | | --hours <n> | Time window in hours (default: 1) | | --json | Output as JSON |

agent-budget set

Create or update a budget.

agent-budget set --scope user:42 --limit 10.00 --soft-cap 0.8 --hard-cap 0.95
agent-budget set --scope org:acme --limit 100.00 --downgrade "claude-opus-4-1:claude-sonnet-4"

| Option | Description | | ----------------------- | ------------------------------------------------- | | --scope <type:key> | Scope identifier | | --limit <dollars> | Budget limit in dollars | | --soft-cap <0-1> | Soft cap threshold (default: 0.8) | | --hard-cap <0-1> | Hard cap threshold (default: 1.0) | | --downgrade <from:to> | Auto-downgrade rule (repeatable) | | --disable-tool <name> | Tool to disable when budget tightens (repeatable) |

agent-budget reset

Manually reset a budget (clears spend, resets state to Active).

agent-budget reset --scope user:42
agent-budget reset --scope user:42 --all

| Option | Description | | -------------------- | ---------------- | | --scope <type:key> | Scope to reset | | --all | Reset all scopes |

agent-budget simulate

Estimate whether a proposed request fits within the remaining budget.

agent-budget simulate --scope user:42 --model claude-opus-4-1 --tokens 2000
agent-budget simulate --scope user:42 --model claude-sonnet-4 --tokens 500 --json

| Option | Description | | -------------------- | ----------------------------- | | --scope <type:key> | Scope to check against | | --model <id> | Model ID to estimate cost for | | --tokens <n> | Estimated input tokens | | --json | Output as JSON |

agent-budget validate-config

Validate a budget configuration file.

agent-budget validate-config --file ./budgets.json
agent-budget validate-config --file ./budgets.yaml

| Option | Description | | --------------- | ------------------------------------------------ | | --file <path> | Path to budget configuration file (JSON or YAML) |

Library Exports

The CLI package also exports utility functions for programmatic use:

import { parseScope, formatBudgetState, formatSnapshotTable } from '@reaatech/agent-budget-cli';

parseScope(input: string): ParsedScope

Parse a "type:key" string into a structured scope identifier.

parseScope('user:42');
// → { scopeType: BudgetScope.User, scopeKey: "42" }

parseScope('org:acme-corp');
// → { scopeType: BudgetScope.Org, scopeKey: "acme-corp" }

formatBudgetState(state: BudgetState): string

Format a budget state into human-readable text or JSON.

formatSnapshotTable(snapshots: BudgetSnapshot[]): string

Format an array of budget snapshots into a fixed-width ASCII table.

SCOPE          LIMIT  SPENT  REMAINING  STATE
user:42        10.00  2.50   7.50       active
user:99        5.00   4.80   0.20       degraded
org:acme       100.00 95.00  5.00       warned

Related Packages

License

MIT