#!/bin/sh # llm-usage live dashboard as a herdr pane process. # # Resolves the tool in this order: # 1. $LLM_USAGE_BIN (explicit override: path to llm-usage or llm-usage.py) # 2. repo checkout next to the plugin dir (linked-plugin development) # 3. `llm-usage` on PATH (installed tool, e.g. ~/.local/bin/llm-usage) set -eu if [ -n "${LLM_USAGE_BIN:-}" ]; then exec "$LLM_USAGE_BIN" --watch "${LLM_USAGE_INTERVAL:-60}" fi root="${HERDR_PLUGIN_ROOT:-}" if [ -n "$root" ]; then for c in "$root/../llm-usage.py" "$root/llm-usage.py"; do if [ -f "$c" ]; then exec "$c" --watch "${LLM_USAGE_INTERVAL:-60}" fi done fi if command -v llm-usage >/dev/null 2>&1; then exec llm-usage --watch "${LLM_USAGE_INTERVAL:-60}" fi echo "llm-usage not found: no LLM_USAGE_BIN, no llm-usage.py beside the plugin," >&2 echo "and no llm-usage on PATH (install: cp llm-usage.py ~/.local/bin/llm-usage)" >&2 exit 1