@inboxapi/cli 0.2.0 → 0.2.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/README.md +4 -0
- package/index.js +51 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -81,7 +81,11 @@ InboxAPI CLI works as an MCP STDIO transport. Point your MCP client at the `inbo
|
|
|
81
81
|
**Claude Code:**
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
+
# Add to current project
|
|
84
85
|
claude mcp add inboxapi inboxapi
|
|
86
|
+
|
|
87
|
+
# Add globally (available in all projects)
|
|
88
|
+
claude mcp add inboxapi inboxapi -s user
|
|
85
89
|
```
|
|
86
90
|
|
|
87
91
|
**Gemini CLI:**
|
package/index.js
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
3
3
|
const { spawn } = require('child_process');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
|
+
const https = require('https');
|
|
7
|
+
|
|
8
|
+
function compareVersions(a, b) {
|
|
9
|
+
const pa = a.split('.').map(Number);
|
|
10
|
+
const pb = b.split('.').map(Number);
|
|
11
|
+
for (let i = 0; i < 3; i++) {
|
|
12
|
+
const na = pa[i] || 0;
|
|
13
|
+
const nb = pb[i] || 0;
|
|
14
|
+
if (na < nb) return -1;
|
|
15
|
+
if (na > nb) return 1;
|
|
16
|
+
}
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function checkForUpdates() {
|
|
21
|
+
try {
|
|
22
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
|
|
23
|
+
const localVersion = pkg.version;
|
|
24
|
+
if (!localVersion) return;
|
|
25
|
+
|
|
26
|
+
const req = https.get('https://registry.npmjs.org/@inboxapi/cli/latest', { timeout: 3000 }, (res) => {
|
|
27
|
+
let data = '';
|
|
28
|
+
res.on('data', (chunk) => { data += chunk; });
|
|
29
|
+
res.on('end', () => {
|
|
30
|
+
try {
|
|
31
|
+
const remote = JSON.parse(data);
|
|
32
|
+
const remoteVersion = remote.version;
|
|
33
|
+
if (remoteVersion && compareVersions(localVersion, remoteVersion) < 0) {
|
|
34
|
+
process.stderr.write(`[inboxapi] Update available: ${localVersion} → ${remoteVersion}. Updating...\n`);
|
|
35
|
+
const child = spawn('npm', ['install', '-g', `@inboxapi/cli@${remoteVersion}`], {
|
|
36
|
+
stdio: 'ignore',
|
|
37
|
+
detached: true,
|
|
38
|
+
shell: process.platform === 'win32',
|
|
39
|
+
});
|
|
40
|
+
child.unref();
|
|
41
|
+
process.stderr.write(`[inboxapi] Update installing in background. Restart to use new version.\n`);
|
|
42
|
+
}
|
|
43
|
+
} catch {}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
req.on('error', () => {});
|
|
47
|
+
req.on('timeout', () => { req.destroy(); });
|
|
48
|
+
} catch {}
|
|
49
|
+
}
|
|
6
50
|
|
|
7
51
|
const PLATFORM_PACKAGES = {
|
|
8
52
|
'darwin-arm64': '@inboxapi/cli-darwin-arm64',
|
|
@@ -40,6 +84,13 @@ function findBinary() {
|
|
|
40
84
|
const binPath = findBinary();
|
|
41
85
|
const args = process.argv.slice(2);
|
|
42
86
|
|
|
87
|
+
// Auto-update check for proxy mode only (default, no subcommand, or explicit "proxy")
|
|
88
|
+
const firstArg = args[0];
|
|
89
|
+
const isProxyMode = !firstArg || firstArg === 'proxy' || firstArg.startsWith('--endpoint');
|
|
90
|
+
if (isProxyMode) {
|
|
91
|
+
checkForUpdates();
|
|
92
|
+
}
|
|
93
|
+
|
|
43
94
|
if (binPath) {
|
|
44
95
|
const child = spawn(binPath, args, { stdio: 'inherit' });
|
|
45
96
|
child.on('exit', (code, signal) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inboxapi/cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "📧 Email for your AI 🤖",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"inboxapi": "index.js"
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"test": "cargo test"
|
|
28
28
|
},
|
|
29
29
|
"optionalDependencies": {
|
|
30
|
-
"@inboxapi/cli-darwin-arm64": "0.2.
|
|
31
|
-
"@inboxapi/cli-darwin-x64": "0.2.
|
|
32
|
-
"@inboxapi/cli-linux-x64": "0.2.
|
|
33
|
-
"@inboxapi/cli-linux-arm64": "0.2.
|
|
34
|
-
"@inboxapi/cli-win32-x64": "0.2.
|
|
30
|
+
"@inboxapi/cli-darwin-arm64": "0.2.2",
|
|
31
|
+
"@inboxapi/cli-darwin-x64": "0.2.2",
|
|
32
|
+
"@inboxapi/cli-linux-x64": "0.2.2",
|
|
33
|
+
"@inboxapi/cli-linux-arm64": "0.2.2",
|
|
34
|
+
"@inboxapi/cli-win32-x64": "0.2.2"
|
|
35
35
|
}
|
|
36
36
|
}
|