#!/bin/bash # omarchy:summary=Rename a Claude or Codex subscription account # omarchy:args=[claude|codex] # omarchy:examples=omarchy agent account rename primary Hey | omarchy agent account rename codex side Side project set -uo pipefail # The provider can be left out when it's your default agent: # `omarchy agent account rename primary Hey`. if [[ ${1:-} != "claude" && ${1:-} != "codex" ]]; then default=$(omarchy-default-agent) [[ $default == "claude" || $default == "codex" ]] && set -- "$default" "$@" fi if [[ ${1:-} != "claude" && ${1:-} != "codex" ]] || (( $# < 3 )); then echo "Usage: omarchy-agent-account-rename [claude|codex] " >&2 exit 1 fi account=$(omarchy-agent-account-state rename "$@") || exit 1 echo "Renamed to $(jq -r .label <<<"$account"). Switch to it with: omarchy agent account use $(jq -r .id <<<"$account")" # The panel reads account names from the usage record. omarchy-agent-usage-update --limits-only "$1" >/dev/null 2>&1 &