forked from Wechat-ggGitHub/wechat-claude-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset.sh
More file actions
executable file
·31 lines (24 loc) · 808 Bytes
/
reset.sh
File metadata and controls
executable file
·31 lines (24 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
DATA_DIR="${WOC_DATA_DIR:-${HOME}/.wechat-opencode}"
YES="${1:-}"
echo "== WeChat OpenCode login reset =="
echo "This will stop the bridge and remove WeChat account bindings."
echo "Kept: ${DATA_DIR}/config.env"
echo "Removed: accounts, sessions, sync buffer, QR image"
echo ""
if [ "$YES" != "--yes" ]; then
printf "Continue? [y/N] "
read -r answer
case "$answer" in
y|Y|yes|YES) ;;
*) echo "Cancelled."; exit 0 ;;
esac
fi
if command -v npm >/dev/null 2>&1 && [ -f "dist/daemon.js" ]; then
npm run daemon -- stop || true
fi
rm -rf "${DATA_DIR}/accounts" "${DATA_DIR}/sessions"
rm -f "${DATA_DIR}/get_updates_buf" "${DATA_DIR}/qrcode.png"
echo "Reset complete. Run ./start.sh or npm run setup to scan a new WeChat account."