@dst-justin/relay 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +3 -0
  2. package/package.json +1 -1
  3. package/relay +34 -2
package/README.md CHANGED
@@ -288,6 +288,9 @@ Sessions live in `~/.claude/projects/` and are shared across all accounts — af
288
288
 
289
289
  ## Changelog
290
290
 
291
+ ### v2.6.0 — 2026-09-04
292
+ - Add `relay run -c`/`--continue`/`-r`/`--resume` — replays the last account/provider `relay run` used in the current directory, so a crashed or Ctrl-C'd one-off provider session can resume without retyping the provider name.
293
+
291
294
  ### v2.5.0 — 2026-08-12
292
295
  - Add `--subagent-model` to `relay provider add`, storing a `subagent_model` field that `relay provider use`/`relay run` inject as `CLAUDE_CODE_SUBAGENT_MODEL` — lets a LiteLLM provider pin the subagent model independently of the main `ANTHROPIC_MODEL`.
293
296
  - `relay provider list` now also shows `subagent_model` when set.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dst-justin/relay",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "Multi-account switcher for Claude Code — instant credential swap across macOS, Linux, and Windows",
5
5
  "bin": {
6
6
  "relay": "./relay.js"
package/relay CHANGED
@@ -1103,18 +1103,49 @@ cmd_provider_remove() {
1103
1103
  ok "Deleted provider '${name}'"
1104
1104
  }
1105
1105
 
1106
+ _run_history_dir() { printf '%s/run-history' "${RELAY_DIR}"; }
1107
+
1108
+ # Per-directory "last name run here" pointer so `relay run -c`/`--resume` can
1109
+ # replay the same account/provider without retyping it — a crashed or
1110
+ # Ctrl-C'd `relay run <provider>` has no other record of what backend that
1111
+ # session used, since exec replaces the process before any trap could fire.
1112
+ _run_history_key() { printf '%s' "${PWD}" | cksum | awk '{print $1}'; }
1113
+
1114
+ _run_record_last() {
1115
+ mkdir -p "$(_run_history_dir)"
1116
+ printf '%s' "$1" > "$(_run_history_dir)/$(_run_history_key)"
1117
+ }
1118
+
1119
+ _run_last_name_for_cwd() {
1120
+ local f; f="$(_run_history_dir)/$(_run_history_key)"
1121
+ [[ -f "${f}" ]] && cat "${f}"
1122
+ }
1123
+
1106
1124
  cmd_run() {
1107
1125
  local name="${1:-}"
1108
1126
  [[ -z "${name}" ]] && { err "usage: relay run <name> [-- <claude args...>]"; exit 1; }
1109
- shift
1110
- [[ "${1:-}" == "--" ]] && shift
1111
1127
 
1112
1128
  require_claude
1113
1129
 
1130
+ case "${name}" in
1131
+ -c|--continue|-r|--resume)
1132
+ # Reuse the last account/provider run from this directory; leave "$@"
1133
+ # untouched so -c/--resume (and any session id after it) still reach claude.
1134
+ name=$(_run_last_name_for_cwd)
1135
+ [[ -z "${name}" ]] && { err "No previous 'relay run <name>' recorded for this directory — run 'relay run <name>' once first"; exit 1; }
1136
+ ;;
1137
+ *)
1138
+ shift
1139
+ [[ "${1:-}" == "--" ]] && shift
1140
+ ;;
1141
+ esac
1142
+
1114
1143
  if account_exists "${name}"; then
1144
+ _run_record_last "${name}"
1115
1145
  do_switch "${name}"
1116
1146
  exec "${REAL_CLAUDE}" "$@"
1117
1147
  elif provider_exists "${name}"; then
1148
+ _run_record_last "${name}"
1118
1149
  local base_url token model subagent_model discover settings_file
1119
1150
  base_url=$(_provider_field "${name}" base_url)
1120
1151
  token=$(_provider_field "${name}" auth_token)
@@ -2771,6 +2802,7 @@ cmd_help() {
2771
2802
  printf " ${B}One-off runs${R}\n"
2772
2803
  printf " %-42s %s\n" " relay run <name>" "one-off session on an account or provider, then exec claude"
2773
2804
  printf " %-42s %s\n" " relay run <name> -- <args>" "forward extra args to claude itself, e.g. -- --resume"
2805
+ printf " %-42s %s\n" " relay run -c|--resume" "replay last account/provider used by 'relay run' in this dir"
2774
2806
  printf " %-42s %s\n" " (leaves global switch/provider state untouched — safe for concurrent sessions)"
2775
2807
  echo ""
2776
2808