@wangxt0223/codex-switcher 0.5.0 → 0.5.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1 - 2026-04-12
4
+
5
+ - Added `version: <semver>` output in `codex-sw check` for quick runtime version verification.
6
+ - Added smoke-test assertion to verify `check` includes the version line.
7
+
3
8
  ## 0.5.0 - 2026-04-12
4
9
 
5
10
  - Added automatic Codex CLI launch behavior for `use/switch` in interactive shells (`--launch=auto`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangxt0223/codex-switcher",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Profile-based account switcher for Codex CLI and Codex App using isolated CODEX_HOME directories.",
5
5
  "license": "MIT",
6
6
  "author": "wangxt",
@@ -76,6 +76,18 @@ now_utc() {
76
76
  date -u +"%Y-%m-%dT%H:%M:%SZ"
77
77
  }
78
78
 
79
+ switcher_version() {
80
+ local script_dir package_json version
81
+ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
82
+ package_json="$(cd "$script_dir/../../.." && pwd)/package.json"
83
+
84
+ if [[ -f "$package_json" ]]; then
85
+ version="$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "$package_json" | head -n 1)"
86
+ fi
87
+
88
+ echo "${version:-unknown}"
89
+ }
90
+
79
91
  redact() {
80
92
  sed -E \
81
93
  -e 's/sk-[A-Za-z0-9_-]{8,}/sk-***REDACTED***/g' \
@@ -874,6 +886,7 @@ cmd_check() {
874
886
  err "log redaction check failed"
875
887
  fi
876
888
 
889
+ echo "version: $(switcher_version)"
877
890
  echo "check: ok"
878
891
  }
879
892
 
@@ -74,6 +74,7 @@ echo '{"projects":["demo"]}' > "$CODEX_SWITCHER_DEFAULT_HOME/state_5.sqlite"
74
74
  echo '{"memo":"persist"}' > "$CODEX_SWITCHER_DEFAULT_HOME/memories/demo.json"
75
75
 
76
76
  check_out="$("$SW" check)"
77
+ echo "$check_out" | grep -Eq '^version: [0-9]+\.[0-9]+\.[0-9]+$'
77
78
  echo "$check_out" | grep -q "check: ok"
78
79
  init_out="$("$SW" init --dry-run)"
79
80
  echo "$init_out" | grep -q "\[dry-run\]"