@dst-justin/relay 2.1.2 → 2.1.3

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 +9 -0
  2. package/package.json +1 -1
  3. package/relay +26 -13
package/README.md CHANGED
@@ -229,6 +229,15 @@ Sessions live in `~/.claude/projects/` and are shared across all accounts — af
229
229
  - `relay update` now detects original install method: uses `npm install -g` for npm installs, `git pull` for git clones, and direct GitHub download for bare script copies
230
230
  - `npm install -g` post-install script automatically patches `~/.bashrc`, `~/.zshrc`, `~/.profile`, and fish `config.fish` if the npm bin dir is missing from PATH
231
231
 
232
+ ### v2.1.3 — 2026-06-24
233
+ - `relay autoswitch` with no subcommand: auto-routes to config wizard (first time) or status panel (already configured)
234
+ - Autoswitch status and log panels now show version info and update notice at the bottom
235
+ - Status panel shows available commands inline
236
+
237
+ ### v2.1.2 — 2026-06-24
238
+ - Improve autoswitch config wizard: 3-step flow with numbered account list, space-separated number input for order, visual chain preview (`work → personal → (cycle)`), and summary after save
239
+ - `relay update` now writes the live-fetched version to cache immediately, so display commands reflect the latest version without waiting 24h
240
+
232
241
  ### v2.1.0 — 2026-06-24
233
242
  - Upgraded GitHub Actions workflow to `actions/checkout@v6` and `actions/setup-node@v6` (Node 24 runtime, removes Node 20 deprecation warning)
234
243
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dst-justin/relay",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
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
@@ -986,7 +986,7 @@ print(' → '.join(names) + ' → (cycle)')")
986
986
  echo ""
987
987
  ok "Config saved to ${cfg_file}"
988
988
  echo ""
989
- "${PY}" -c "
989
+ "${PY}" - "${cfg_file}" <<'PYEOF'
990
990
  import json, sys
991
991
  cfg = json.load(open(sys.argv[1]))
992
992
  R='\033[0m'; B='\033[1m'; D='\033[2m'; CY='\033[36m'
@@ -994,8 +994,9 @@ for i, name in enumerate(cfg['order'], 1):
994
994
  thr = cfg['thresholds'].get(name, '?')
995
995
  print(f' {D}{i}.{R} {name:<14} → switch at {CY}{thr}%{R}')
996
996
  p = cfg['poll']
997
- print(f\"\n {D}polling: {p[\"low_minutes\"]}min normal / {p[\"high_minutes\"]}min fast (fast above {p[\"high_threshold\"]}%){R}\")
998
- " "${cfg_file}"
997
+ lo, hi, thr = p['low_minutes'], p['high_minutes'], p['high_threshold']
998
+ print(f'\n {D}polling: {lo}min normal / {hi}min fast (fast above {thr}%){R}')
999
+ PYEOF
999
1000
  echo ""
1000
1001
  log "Run ${CY}relay autoswitch start${R} to activate"
1001
1002
  }
@@ -1094,6 +1095,7 @@ cmd_autoswitch_stop() {
1094
1095
  }
1095
1096
 
1096
1097
  cmd_autoswitch_status() {
1098
+ _check_update_bg
1097
1099
  hdr "autoswitch — status"
1098
1100
 
1099
1101
  local pid; pid=$(cat "${RELAY_DIR}/autoswitch.lock" 2>/dev/null || echo "")
@@ -1106,6 +1108,7 @@ cmd_autoswitch_status() {
1106
1108
  local cfg="${RELAY_DIR}/autoswitch.json"
1107
1109
  if [[ ! -f "${cfg}" ]]; then
1108
1110
  warn "No config. Run: relay autoswitch config"
1111
+ _show_update_notice
1109
1112
  return 0
1110
1113
  fi
1111
1114
 
@@ -1173,12 +1176,18 @@ except: pass
1173
1176
  EOF
1174
1177
 
1175
1178
  echo ""
1176
- log "Run ${CY}relay autoswitch log${R} to see full history"
1179
+ printf " ${D}────────────────────────────────────────${R}\n"
1180
+ printf " %-34s %s\n" " ${CY}relay autoswitch start${R}" "start daemon"
1181
+ printf " %-34s %s\n" " ${CY}relay autoswitch stop${R}" "stop daemon"
1182
+ printf " %-34s %s\n" " ${CY}relay autoswitch config${R}" "edit settings"
1183
+ printf " %-34s %s\n" " ${CY}relay autoswitch log${R}" "switch history"
1184
+ _show_update_notice
1177
1185
  }
1178
1186
 
1179
1187
  cmd_autoswitch_log() {
1188
+ _check_update_bg
1180
1189
  local log_file="${RELAY_DIR}/autoswitch.log"
1181
- [[ -f "${log_file}" ]] || { warn "No log yet"; return 0; }
1190
+ [[ -f "${log_file}" ]] || { warn "No log yet"; _show_update_notice; return 0; }
1182
1191
 
1183
1192
  hdr "autoswitch — log (last 20 events)"
1184
1193
  "${PY}" - "${log_file}" <<'EOF'
@@ -1201,6 +1210,7 @@ for line in lines[-20:]:
1201
1210
  print(f' {D}{ts}{R} {D}daemon start{R}')
1202
1211
  except: pass
1203
1212
  EOF
1213
+ _show_update_notice
1204
1214
  }
1205
1215
 
1206
1216
  cmd_autoswitch() {
@@ -1212,13 +1222,11 @@ cmd_autoswitch() {
1212
1222
  status) cmd_autoswitch_status ;;
1213
1223
  log) cmd_autoswitch_log ;;
1214
1224
  *)
1215
- hdr "autoswitch"
1216
- printf " %-32s %s\n" " relay autoswitch config" "interactive setup wizard"
1217
- printf " %-32s %s\n" " relay autoswitch start" "install and start daemon"
1218
- printf " %-32s %s\n" " relay autoswitch stop" "stop and remove daemon"
1219
- printf " %-32s %s\n" " relay autoswitch status" "show daemon state + config"
1220
- printf " %-32s %s\n" " relay autoswitch log" "show recent switch history"
1221
- echo ""
1225
+ if [[ ! -f "${RELAY_DIR}/autoswitch.json" ]]; then
1226
+ cmd_autoswitch_config
1227
+ else
1228
+ cmd_autoswitch_status
1229
+ fi
1222
1230
  ;;
1223
1231
  esac
1224
1232
  }
@@ -1335,7 +1343,12 @@ PYEOF
1335
1343
  warn "Could not determine latest version — check your network"
1336
1344
  log "To update manually: ${CY}npm install -g @dst-justin/relay@latest${R}"
1337
1345
  return 1
1338
- elif [[ "${current}" == "${latest}" ]]; then
1346
+ fi
1347
+
1348
+ # Refresh cache with this live result so display commands reflect it immediately
1349
+ printf '%s:%s' "$(date +%s)" "${latest}" > "${UPDATE_CACHE}" 2>/dev/null || true
1350
+
1351
+ if [[ "${current}" == "${latest}" ]]; then
1339
1352
  ok "Already up to date (${current})"; return 0
1340
1353
  else
1341
1354
  log "Latest available: ${B}${latest}${R}"