codex-model-change 1.0.1 → 1.0.2
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/cx.py +5 -0
- package/package.json +1 -1
package/cx.py
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"""
|
|
15
15
|
import json, os, re, glob, sqlite3, subprocess, sys, shutil, time, urllib.request, urllib.error
|
|
16
16
|
|
|
17
|
+
CX_VERSION = "1.0.2"
|
|
18
|
+
|
|
17
19
|
CODEX_HOME = os.environ.get("CODEX_HOME", os.path.expanduser("~/.codex"))
|
|
18
20
|
CONFIG = os.path.join(CODEX_HOME, "config.toml")
|
|
19
21
|
CX_DIR = os.path.expanduser("~/.cx")
|
|
@@ -48,6 +50,7 @@ HELP = """cx — Codex 模型直连切换器
|
|
|
48
50
|
fix-all <目标> 批量把所有老会话切换到目标模型(需退 App)
|
|
49
51
|
用法: cx fix-all deepseek|gpt [--limit N]
|
|
50
52
|
migrate-sessions 旧代理会话迁移(遗留命令,一般用 fix-all 即可)
|
|
53
|
+
version 显示 cx 版本
|
|
51
54
|
help 显示本帮助
|
|
52
55
|
|
|
53
56
|
要点:
|
|
@@ -207,6 +210,7 @@ def app_running():
|
|
|
207
210
|
return subprocess.run(["pgrep", "-f", APP_PGREP], capture_output=True).returncode == 0
|
|
208
211
|
|
|
209
212
|
def cmd_status():
|
|
213
|
+
print(f"cx 版本 : {CX_VERSION}")
|
|
210
214
|
text = read_cfg()
|
|
211
215
|
m = re.search(r'(?m)^model\s*=\s*"([^"]+)"', text)
|
|
212
216
|
p = re.search(r'(?m)^model_provider\s*=\s*"([^"]+)"', text)
|
|
@@ -404,6 +408,7 @@ def main():
|
|
|
404
408
|
elif c == "fix": cmd_fix()
|
|
405
409
|
elif c == "fix-all": cmd_fix_all()
|
|
406
410
|
elif c == "migrate-sessions": cmd_migrate()
|
|
411
|
+
elif c in ("version", "-V", "--version"): print(f"cx {CX_VERSION}")
|
|
407
412
|
elif c in ("-h", "--help", "help"): print(HELP)
|
|
408
413
|
else: err(f"未知命令: {c}(cx help 查看用法)")
|
|
409
414
|
|
package/package.json
CHANGED