@cloverhound/webex-cli 0.0.0-stage → 0.17.0-rc.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 +20 -2
- package/bin/webex.js +67 -0
- package/package.json +33 -4
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @cloverhound/webex-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The [Webex CLI](https://github.com/Cloverhound/webex-cli) packaged for npm. It manages Webex Admin, Calling, Contact Center, Devices, Meetings, and Messaging APIs from the command line, and runs as an MCP server for AI agents.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx -y @cloverhound/webex-cli login --device
|
|
7
|
+
npx -y @cloverhound/webex-cli calling people list
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Or install it globally:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g @cloverhound/webex-cli
|
|
14
|
+
webex --version
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
npm installs only the prebuilt binary for your platform (macOS, Linux, or Windows on x64 or arm64) through an optional dependency. No install script runs and nothing is downloaded from GitHub, so the package works in sandboxes that allow the npm registry but block other hosts.
|
|
18
|
+
|
|
19
|
+
To run it as an MCP server, use `npx -y @cloverhound/webex-cli@<version> mcp serve` as the server command.
|
|
20
|
+
|
|
21
|
+
See the [documentation](https://cloverhound.github.io/webex-cli/) for login options, including device login for machines without a browser.
|
package/bin/webex.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Runs the webex binary from the platform package npm installed alongside this
|
|
5
|
+
// one (an optionalDependency selected by its os/cpu fields).
|
|
6
|
+
|
|
7
|
+
const { spawn } = require("node:child_process");
|
|
8
|
+
const fs = require("node:fs");
|
|
9
|
+
|
|
10
|
+
const SUPPORTED = new Set([
|
|
11
|
+
"darwin-arm64",
|
|
12
|
+
"darwin-x64",
|
|
13
|
+
"linux-arm64",
|
|
14
|
+
"linux-x64",
|
|
15
|
+
"win32-arm64",
|
|
16
|
+
"win32-x64",
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
function fail(message) {
|
|
20
|
+
process.stderr.write(`webex-cli: ${message}\n`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function binaryPath() {
|
|
25
|
+
const key = `${process.platform}-${process.arch}`;
|
|
26
|
+
if (!SUPPORTED.has(key)) {
|
|
27
|
+
fail(`no build for ${key}. See https://github.com/Cloverhound/webex-cli#install for other install methods.`);
|
|
28
|
+
}
|
|
29
|
+
const pkg = `@cloverhound/webex-cli-${key}`;
|
|
30
|
+
const exe = process.platform === "win32" ? "webex.exe" : "webex";
|
|
31
|
+
let bin;
|
|
32
|
+
try {
|
|
33
|
+
bin = require.resolve(`${pkg}/bin/${exe}`);
|
|
34
|
+
} catch {
|
|
35
|
+
fail(`${pkg} is not installed. Reinstall without --omit=optional or --no-optional.`);
|
|
36
|
+
}
|
|
37
|
+
if (process.platform !== "win32") {
|
|
38
|
+
try {
|
|
39
|
+
fs.accessSync(bin, fs.constants.X_OK);
|
|
40
|
+
} catch {
|
|
41
|
+
// Some package managers drop the executable bit when unpacking.
|
|
42
|
+
try {
|
|
43
|
+
fs.chmodSync(bin, 0o755);
|
|
44
|
+
} catch {}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return bin;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const child = spawn(binaryPath(), process.argv.slice(2), { stdio: "inherit" });
|
|
51
|
+
|
|
52
|
+
// MCP hosts stop servers with a signal; pass it on so the binary is not orphaned.
|
|
53
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
54
|
+
process.on(signal, () => {
|
|
55
|
+
if (!child.killed) child.kill(signal);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
child.on("error", (err) => fail(err.message));
|
|
60
|
+
child.on("exit", (code, signal) => {
|
|
61
|
+
if (signal) {
|
|
62
|
+
process.removeAllListeners(signal);
|
|
63
|
+
process.kill(process.pid, signal);
|
|
64
|
+
} else {
|
|
65
|
+
process.exit(code ?? 1);
|
|
66
|
+
}
|
|
67
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloverhound/webex-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.17.0-rc.2",
|
|
4
|
+
"description": "CLI and MCP server for Webex Admin, Calling, Contact Center, Devices, Meetings, and Messaging APIs",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/Cloverhound/webex-cli",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Cloverhound/webex-cli.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"webex",
|
|
13
|
+
"cli",
|
|
14
|
+
"mcp",
|
|
15
|
+
"cisco",
|
|
16
|
+
"contact-center"
|
|
17
|
+
],
|
|
18
|
+
"bin": {
|
|
19
|
+
"webex": "bin/webex.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"bin"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"optionalDependencies": {
|
|
28
|
+
"@cloverhound/webex-cli-darwin-arm64": "0.17.0-rc.2",
|
|
29
|
+
"@cloverhound/webex-cli-darwin-x64": "0.17.0-rc.2",
|
|
30
|
+
"@cloverhound/webex-cli-linux-arm64": "0.17.0-rc.2",
|
|
31
|
+
"@cloverhound/webex-cli-linux-x64": "0.17.0-rc.2",
|
|
32
|
+
"@cloverhound/webex-cli-win32-arm64": "0.17.0-rc.2",
|
|
33
|
+
"@cloverhound/webex-cli-win32-x64": "0.17.0-rc.2"
|
|
34
|
+
}
|
|
35
|
+
}
|