#!/bin/sh
# summary: List the accounts that AI usage tracks.
# Compatibility for existing installations and external callers.
# The original per-account default is a read-only listing.
case "${1:-}" in
    -h|--help|help)
        cat <<'HELP'
usage: starchaser ai usage accounts [-h] [--json] [--force]
                                   [{refresh,show,signin}] [{claude,codex,hermes}]
                                   [account]

Show saved usage readings for AI accounts. With no arguments, show saved readings
as text without refreshing.

  show       show saved readings without refreshing
  refresh    check usage and save the readings
  signin     sign in to the named tool and account
  --json     print JSON instead of text
  --force    with refresh, check again even if checked in the last five minutes
  -h, --help show this help

Examples:
  starchaser ai usage accounts
  starchaser ai usage accounts refresh --json
  starchaser ai usage accounts show codex "Work"
HELP
        exit 0
        ;;
esac
if [ "$#" -eq 0 ]; then
    set -- show
fi
STARCHASER_AI_USAGE_PROG="starchaser ai usage accounts" exec "$(dirname "$(readlink -f "$0")")/starchaser-ai-usage" "$@"
