slug: poeusage version: 0.5.0
A ClawHub skill for monitoring Poe API point balance and usage history via the poeusage CLI.
Install
brew tap rgstephens/tap
brew install poeusage
Description
poeusage is a terminal utility to monitor your Poe API quota, usage history, and spend summaries. It supports JSON/csv/table output modes, pagination, filtering, and shell completion generation.
CLI Commands
Global flags
--api-keystring (default from$POE_API_KEY)--jsonbool--plainbool--no-colorbool--quiet/-qbool--verbose/-vbool--timeoutint (default 30)--help/-hbool--versionbool
Subcommands
poeusage balance
Fetch and display current point balance.
Usage:
poeusage balance [--json] [--plain]
- TTY example:
Current balance: 1,500 pts --plainexample:1500--jsonexample:{"current_point_balance":1500}
poeusage history
Fetch usage history. Auto-paginates by default until all records are retrieved (or until --limit).
Usage:
poeusage history [flags]
Flags:
--limit/-nint (0 == all)--page-sizeint (default 100, max 100)--no-paginatebool--cursorstring--bot/-bstring--type/-tstring (chat,api,canvas)--sincestring (YYYY-MM-DDor unix timestamp)--untilstring (YYYY-MM-DDor unix timestamp)--output/-ostring--format/-fstring (table,csv,json)
Notes:
--jsonis alias for--format json--plainis alias for--format csv- date filters are applied client-side
- with
--no-paginate, printsnext-cursor: <query_id>to stderr if more pages exist
Default table output columns:
TIME, BOT, TYPE, POINTS, COST (USD)
CSV output columns:
time,bot_name,usage_type,cost_points,cost_usd,query_id,chat_name,input_pts,output_pts,cache_write_pts,cache_discount_pts
JSON output example:
[
{
"bot_name": "Claude-3.5-Sonnet",
"time": "2024-01-09T14:00:00Z",
"query_id": "2Nhd9xBFbLcXEwmNj",
"cost_usd": "0.00075",
"cost_points": 339,
"usage_type": "API",
"chat_name": null,
"cost_breakdown": {
"input": 120,
"output": 219,
"cache_write": 0,
"cache_discount": 0,
"total": 339
}
}
]
poeusage summary
Aggregate usage and display cost breakdown. Same filters as history plus grouping.
Usage:
poeusage summary [flags]
Flags:
--bot/-bstring--type/-tstring--sincestring--untilstring--group-by/-gstring (bot,type,day,bot,type)--format/-fstring (table,csv,json)
Default table output columns (group-by bot):
BOT, QUERIES, POINTS, COST (USD)
poeusage completion <shell>
Generate shell completion script.
Usage:
poeusage completion <bash|zsh|fish>
Example:
poeusage completion zsh > ~/.zsh/completions/_poeusage
I/O contract
- stdout: primary command output
- stderr: diagnostics, progress, warnings, next-cursor hints
- TTY detection controls color and formatting
Exit codes
0: success1: runtime error (network/API error)2: invalid usage3: auth error (401)
Configuration
Priority: flags > env > config file > defaults
Env vars:
POE_API_KEYNO_COLORPOEUSAGE_TIMEOUTPOEUSAGE_PAGE_SIZE
Config file: ~/.config/poeusage/config.toml
# api_key = "..." # not recommended
timeout = 30
page_size = 100
Release
make release TAG=v1.0.0