zcode-switch README

The project's README from github.com/pjpv/zcode-switch. As one markdown file: README.md.

Z·SWITCH (zcode-switch)

简体中文 | English

Tauri 2 桌面工具:在多个 ZCode 账号之间一键切换,自动显示额度。只换登录身份——项目、会话、设置全部共用不动。

screenshot

功能

安全设计

CLI

zcode-switch.exe --cli state|list
zcode-switch.exe --cli quota [--id <账号id>]
zcode-switch.exe --cli claim-preview [--id <账号id>]
zcode-switch.exe --cli capture [--name 名称]
zcode-switch.exe --cli switch --id <id> [--force] [--restart|--no-restart] [--hot <bool>|--no-hot]
zcode-switch.exe --cli kill
zcode-switch.exe --cli export --id <id> --out <a.zsb>
zcode-switch.exe --cli export-all --out <all.zsb>
zcode-switch.exe --cli import --file <file.zsb>
zcode-switch.exe --cli rename|delete|update|behavior|setpath|launch
zcode-switch.exe --cli --lang en state              # 英文输出(--lang 空格传值、可置于任意位置;默认跟 GUI 语言/系统语言)

CLI 密码(export / import):优先环境变量 ZSW_PASSWORD(不出现在进程列表和命令历史),也可 --password <密码>。

常见问题

macOS 弹出「麦克风 / 辅助功能 / 录屏」权限询问?

全部拒绝即可,不影响任何功能,验证码照常通过。 应用内嵌的登录/验证码网页由系统 WebView 渲染,网页发起的请求会被透传为应用的系统权限询问;应用本体与其内嵌网页均未使用这三项能力。

构建

npm install
npm run tauri dev      # 开发(HMR)
npm run tauri build    # NSIS 安装包
cd src-tauri && cargo test   # 单元测试(含 node↔Rust 跨语言加密向量)

Windows 优先(路径探测 / 进程管理 / 托盘均为 Win32 语义)。

License

MIT

zcode-switch (pjpv/zcode-switch)

account-manager
Searching Database…

What is this?Z·SWITCH is a Tauri 2 desktop tool that lets you one-click switch between multiple ZCode (BigModel / z.ai) accounts, showing each account's quota inline, without touching your current project, session, or settings.
Is this a GUI app, or does it also work from scripts?It is primarily a Tauri desktop app with a tray icon and main window, but it also ships a CLI for automated export/import operations.
How do I add and switch accounts?Inside the app you add a new account via OAuth (BigModel or z.ai entry points) without disturbing the currently logged-in account, then switch between saved accounts with one click; switching snapshots the credentials and config files and swaps them atomically.
Do I need existing BigModel or z.ai accounts?Yes, this tool only manages switching between accounts you already have; you log into each one through the app's built-in OAuth flow for BigModel or z.ai.
Is support equally solid on Windows and macOS?The app is built Windows-first, with path detection, process management, and tray behavior all using Win32 semantics; on macOS, the embedded login/captcha WebView may trigger harmless microphone, accessibility, or screen-recording permission prompts that you can simply deny.
What's inside a .zsb backup file?.zsb is an encrypted account bundle protected with PBKDF2-HMAC-SHA256 (100k iterations) and AES-256-GCM with random salt/nonce, so a wrong password simply fails to decrypt, leaving no plaintext trace.
How does the quota display work?Each saved account row shows its plan quota and reset time inline, with multiple plans grouped and polled on a staggered schedule to avoid rate limits.
Can I run exports/imports without typing a password on screen?Yes, the CLI accepts the password via the ZSWPASSWORD environment variable so it never shows up in the process list or shell history, or you can pass --password directly.
What does 'claiming activities' mean in this app?For plans with claimable promotions, you can one-click claim them (with GUI captcha verification) or use a 'refresh eligibility' button to manually re-check each account's claim eligibility under a rate-limited cooldown.
Creator
pjpv
Size
1 MB
Stars
413
Age
1mo
Commits · 90 Days