weixin-mcp 1.4.1 → 1.4.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/dist/cli.js +19 -0
- package/package.json +1 -1
- package/src/cli.ts +17 -0
package/dist/cli.js
CHANGED
|
@@ -74,6 +74,24 @@ else if (command === "update") {
|
|
|
74
74
|
console.log("✅ Updated! Run: npx weixin-mcp --version");
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
else if (command === "contacts") {
|
|
78
|
+
const { loadContacts } = await import("./contacts.js");
|
|
79
|
+
const contacts = Object.values(loadContacts());
|
|
80
|
+
if (contacts.length === 0) {
|
|
81
|
+
console.log("No contacts yet. Run: npx weixin-mcp poll --reset");
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
console.log(`Contacts (${contacts.length}):\n`);
|
|
85
|
+
for (const c of contacts) {
|
|
86
|
+
console.log(` ${c.userId}`);
|
|
87
|
+
console.log(` Last: ${c.lastText ?? "(no text)"}`);
|
|
88
|
+
console.log(` Seen: ${new Date(c.lastSeen).toLocaleString()}`);
|
|
89
|
+
console.log(` Msgs: ${c.msgCount}`);
|
|
90
|
+
if (c.contextToken)
|
|
91
|
+
console.log(` Token: ${c.contextToken.slice(0, 20)}...`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
77
95
|
else if (command === "send") {
|
|
78
96
|
const { cliSend } = await import("./messaging.js");
|
|
79
97
|
await cliSend(process.argv.slice(3)); // <userId> <text...>
|
|
@@ -99,6 +117,7 @@ Commands:
|
|
|
99
117
|
stop Stop daemon
|
|
100
118
|
restart Restart daemon
|
|
101
119
|
logs [-f] Show daemon logs (-f to follow)
|
|
120
|
+
contacts Show contact book (users who messaged the bot)
|
|
102
121
|
update Check and install latest version
|
|
103
122
|
--version / -v Print version
|
|
104
123
|
send <userId> <text> Send a message from CLI
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -78,6 +78,22 @@ if (command === "login") {
|
|
|
78
78
|
console.log("✅ Updated! Run: npx weixin-mcp --version");
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
} else if (command === "contacts") {
|
|
82
|
+
const { loadContacts } = await import("./contacts.js");
|
|
83
|
+
const contacts = Object.values(loadContacts());
|
|
84
|
+
if (contacts.length === 0) {
|
|
85
|
+
console.log("No contacts yet. Run: npx weixin-mcp poll --reset");
|
|
86
|
+
} else {
|
|
87
|
+
console.log(`Contacts (${contacts.length}):\n`);
|
|
88
|
+
for (const c of contacts) {
|
|
89
|
+
console.log(` ${c.userId}`);
|
|
90
|
+
console.log(` Last: ${c.lastText ?? "(no text)"}`);
|
|
91
|
+
console.log(` Seen: ${new Date(c.lastSeen).toLocaleString()}`);
|
|
92
|
+
console.log(` Msgs: ${c.msgCount}`);
|
|
93
|
+
if (c.contextToken) console.log(` Token: ${c.contextToken.slice(0, 20)}...`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
81
97
|
} else if (command === "send") {
|
|
82
98
|
const { cliSend } = await import("./messaging.js");
|
|
83
99
|
await cliSend(process.argv.slice(3)); // <userId> <text...>
|
|
@@ -103,6 +119,7 @@ Commands:
|
|
|
103
119
|
stop Stop daemon
|
|
104
120
|
restart Restart daemon
|
|
105
121
|
logs [-f] Show daemon logs (-f to follow)
|
|
122
|
+
contacts Show contact book (users who messaged the bot)
|
|
106
123
|
update Check and install latest version
|
|
107
124
|
--version / -v Print version
|
|
108
125
|
send <userId> <text> Send a message from CLI
|