open-computer-use 0.1.32 → 0.1.35
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 +27 -29
- package/bin/open-codex-computer-use-mcp +178 -80
- package/bin/open-computer-use +178 -80
- package/bin/open-computer-use-mcp +178 -80
- package/dist/Open Computer Use.app/Contents/Info.plist +1 -1
- package/dist/Open Computer Use.app/Contents/MacOS/OpenComputerUse +0 -0
- package/dist/linux/amd64/open-computer-use +0 -0
- package/dist/linux/arm64/open-computer-use +0 -0
- package/dist/windows/amd64/open-computer-use.exe +0 -0
- package/dist/windows/arm64/open-computer-use.exe +0 -0
- package/package.json +9 -10
- package/plugins/open-computer-use/.codex-plugin/plugin.json +5 -5
- package/plugins/open-computer-use/scripts/launch-open-computer-use.sh +12 -1
- package/scripts/install-codex-plugin.sh +123 -18
- package/scripts/install-config-helper.mjs +190 -31
- package/scripts/install-gemini-mcp.sh +60 -0
- package/scripts/install-opencode-mcp.sh +48 -0
- package/scripts/postinstall.mjs +6 -5
package/README.md
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# open-computer-use
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Cross-platform npm distribution for the open-source **Open Computer Use** MCP server.
|
|
4
4
|
|
|
5
|
-
This package bundles
|
|
5
|
+
This package bundles native runtimes for these supported platforms and lets the Node launcher choose the current `process.platform` / `process.arch` pair:
|
|
6
|
+
|
|
7
|
+
- `darwin-arm64`
|
|
8
|
+
- `darwin-x64`
|
|
9
|
+
- `linux-arm64`
|
|
10
|
+
- `linux-x64`
|
|
11
|
+
- `win32-arm64`
|
|
12
|
+
- `win32-x64`
|
|
13
|
+
|
|
14
|
+
Global command aliases:
|
|
6
15
|
|
|
7
16
|
- `open-computer-use`
|
|
8
17
|
- `open-computer-use-mcp`
|
|
@@ -14,7 +23,7 @@ This package bundles a ready-to-run `Open Computer Use.app`, the Codex plugin me
|
|
|
14
23
|
npm install -g open-computer-use
|
|
15
24
|
```
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
The root launcher resolves the current `process.platform` / `process.arch` pair and runs the matching bundled native runtime.
|
|
18
27
|
|
|
19
28
|
## MCP config
|
|
20
29
|
|
|
@@ -31,45 +40,34 @@ If your MCP client accepts a stdio-style `mcpServers` JSON config, this is the d
|
|
|
31
40
|
}
|
|
32
41
|
```
|
|
33
42
|
|
|
34
|
-
In practice, using this package as MCP is: global install, add the JSON config, then grant macOS `Accessibility` and `Screen Recording` permission to the bundled npm-installed `Open Computer Use.app` on first use.
|
|
35
|
-
|
|
36
43
|
Package page: https://www.npmjs.com/package/open-computer-use
|
|
37
44
|
|
|
38
45
|
## Use
|
|
39
46
|
|
|
40
47
|
```bash
|
|
41
|
-
# Show global help, command help, and version
|
|
42
|
-
open-computer-use --help
|
|
43
|
-
open-computer-use help snapshot
|
|
44
48
|
open-computer-use --version
|
|
45
|
-
|
|
46
|
-
# Install into Claude Code for the current project
|
|
47
|
-
open-computer-use install-claude-mcp
|
|
48
|
-
|
|
49
|
-
# Install into Codex as a plain MCP entry in ~/.codex/config.toml
|
|
50
|
-
open-computer-use install-codex-mcp
|
|
51
|
-
|
|
52
|
-
# Check permissions first; if Accessibility / Screen Recording is missing, open the permission onboarding window
|
|
53
|
-
# If both are already granted, this just prints the status and exits
|
|
54
|
-
open-computer-use doctor
|
|
55
|
-
|
|
56
|
-
# Start the stdio MCP server for Claude Desktop, Cursor, Cline, or another MCP client
|
|
49
|
+
open-computer-use --help
|
|
57
50
|
open-computer-use mcp
|
|
58
|
-
|
|
59
|
-
# Call tools directly; the JSON-array form keeps state in one process for follow-up actions
|
|
60
51
|
open-computer-use call list_apps
|
|
61
|
-
open-computer-use call get_app_state --args '{"app":"TextEdit"}'
|
|
62
|
-
open-computer-use call --calls '[{"tool":"get_app_state","args":{"app":"TextEdit"}},{"tool":"press_key","args":{"app":"TextEdit","key":"Return"}}]'
|
|
63
52
|
|
|
64
|
-
#
|
|
53
|
+
# macOS permission check and onboarding
|
|
54
|
+
open-computer-use doctor
|
|
55
|
+
|
|
56
|
+
# Installer helpers for MCP-capable CLIs
|
|
57
|
+
open-computer-use install-claude-mcp
|
|
58
|
+
open-computer-use install-gemini-mcp
|
|
59
|
+
open-computer-use install-gemini-mcp --scope user
|
|
60
|
+
open-computer-use install-codex-mcp
|
|
61
|
+
open-computer-use install-opencode-mcp
|
|
65
62
|
open-computer-use install-codex-plugin
|
|
66
63
|
```
|
|
67
64
|
|
|
68
65
|
## Notes
|
|
69
66
|
|
|
70
|
-
- Version: `0.1.
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
67
|
+
- Version: `0.1.35`
|
|
68
|
+
- Supported npm platforms: `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, `win32-arm64`, `win32-x64`
|
|
69
|
+
- macOS still requires `Accessibility` and `Screen Recording` permissions.
|
|
70
|
+
- Linux requires a signed-in desktop session with AT-SPI2 / D-Bus accessibility available for real app control.
|
|
71
|
+
- Windows requires a signed-in desktop session for UI Automation access.
|
|
74
72
|
|
|
75
73
|
Source repository: https://github.com/iFurySt/open-codex-computer-use
|
|
@@ -1,9 +1,74 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require("node:child_process");
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
|
|
6
|
+
const platformPackages = {
|
|
7
|
+
"darwin-arm64": {
|
|
8
|
+
"executablePath": [
|
|
9
|
+
"dist",
|
|
10
|
+
"Open Computer Use.app",
|
|
11
|
+
"Contents",
|
|
12
|
+
"MacOS",
|
|
13
|
+
"OpenComputerUse"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"darwin-x64": {
|
|
17
|
+
"executablePath": [
|
|
18
|
+
"dist",
|
|
19
|
+
"Open Computer Use.app",
|
|
20
|
+
"Contents",
|
|
21
|
+
"MacOS",
|
|
22
|
+
"OpenComputerUse"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"linux-arm64": {
|
|
26
|
+
"executablePath": [
|
|
27
|
+
"dist",
|
|
28
|
+
"linux",
|
|
29
|
+
"arm64",
|
|
30
|
+
"open-computer-use"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"linux-x64": {
|
|
34
|
+
"executablePath": [
|
|
35
|
+
"dist",
|
|
36
|
+
"linux",
|
|
37
|
+
"amd64",
|
|
38
|
+
"open-computer-use"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"win32-arm64": {
|
|
42
|
+
"executablePath": [
|
|
43
|
+
"dist",
|
|
44
|
+
"windows",
|
|
45
|
+
"arm64",
|
|
46
|
+
"open-computer-use.exe"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"win32-x64": {
|
|
50
|
+
"executablePath": [
|
|
51
|
+
"dist",
|
|
52
|
+
"windows",
|
|
53
|
+
"amd64",
|
|
54
|
+
"open-computer-use.exe"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
59
|
+
const args = process.argv.slice(2);
|
|
60
|
+
const command = args[0] || "";
|
|
61
|
+
const installCommands = new Map([
|
|
62
|
+
["install-claude-mcp", "install-claude-mcp.sh"],
|
|
63
|
+
["install-clauce-mcp", "install-claude-mcp.sh"],
|
|
64
|
+
["install-gemini-mcp", "install-gemini-mcp.sh"],
|
|
65
|
+
["install-codex-mcp", "install-codex-mcp.sh"],
|
|
66
|
+
["install-opencode-mcp", "install-opencode-mcp.sh"],
|
|
67
|
+
["install-codex-plugin", "install-codex-plugin.sh"],
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
function printLauncherHelp() {
|
|
71
|
+
console.log(`Open Computer Use
|
|
7
72
|
|
|
8
73
|
Usage:
|
|
9
74
|
open-computer-use [command] [options]
|
|
@@ -11,13 +76,15 @@ Usage:
|
|
|
11
76
|
|
|
12
77
|
Commands:
|
|
13
78
|
mcp Start the stdio MCP server.
|
|
14
|
-
doctor Print permission status and launch onboarding if needed.
|
|
79
|
+
doctor Print permission status and launch onboarding if needed on macOS.
|
|
15
80
|
list-apps Print running or recently used apps.
|
|
16
81
|
snapshot <app> Print the current accessibility snapshot for an app.
|
|
17
|
-
call <tool>
|
|
82
|
+
call <tool> Call one tool, or run a JSON array of tool calls.
|
|
18
83
|
turn-ended Notify the running MCP process that the host turn ended.
|
|
19
84
|
install-claude-mcp Install the MCP server into ~/.claude.json for this project.
|
|
85
|
+
install-gemini-mcp Install the MCP server into Gemini CLI config.
|
|
20
86
|
install-codex-mcp Install the MCP server into ~/.codex/config.toml.
|
|
87
|
+
install-opencode-mcp Install the MCP server into ~/.config/opencode.
|
|
21
88
|
install-codex-plugin Install this npm package into the local Codex plugin cache.
|
|
22
89
|
help [command] Show general or command-specific help.
|
|
23
90
|
version Print the CLI version.
|
|
@@ -27,84 +94,115 @@ Global options:
|
|
|
27
94
|
-v, --version Show version.
|
|
28
95
|
|
|
29
96
|
Notes:
|
|
30
|
-
|
|
31
|
-
Use
|
|
32
|
-
EOF
|
|
97
|
+
This npm package bundles native runtimes for supported platforms and selects the current os-arch at launch.
|
|
98
|
+
Use 'open-computer-use help <command>' for command-specific help.`);
|
|
33
99
|
}
|
|
34
100
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
script_path="$(readlink "${script_path}")"
|
|
39
|
-
if [[ "${script_path}" != /* ]]; then
|
|
40
|
-
script_path="${script_dir}/${script_path}"
|
|
41
|
-
fi
|
|
42
|
-
done
|
|
43
|
-
package_root="$(cd "$(dirname "${script_path}")/.." && pwd)"
|
|
44
|
-
app_binary="${package_root}/dist/Open Computer Use.app/Contents/MacOS/OpenComputerUse"
|
|
45
|
-
install_claude_mcp_script="${package_root}/scripts/install-claude-mcp.sh"
|
|
46
|
-
install_mcp_script="${package_root}/scripts/install-codex-mcp.sh"
|
|
47
|
-
install_script="${package_root}/scripts/install-codex-plugin.sh"
|
|
48
|
-
|
|
49
|
-
if [[ "${1:-}" == "install-claude-mcp" || "${1:-}" == "install-clauce-mcp" ]]; then
|
|
50
|
-
shift
|
|
51
|
-
exec "${install_claude_mcp_script}" "$@"
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
if [[ "${1:-}" == "install-codex-mcp" ]]; then
|
|
55
|
-
shift
|
|
56
|
-
exec "${install_mcp_script}" "$@"
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
if [[ "${1:-}" == "install-codex-plugin" ]]; then
|
|
60
|
-
shift
|
|
61
|
-
exec "${install_script}" "$@"
|
|
62
|
-
fi
|
|
63
|
-
|
|
64
|
-
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
|
|
65
|
-
print_launcher_help
|
|
66
|
-
exit 0
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
if [[ "${1:-}" == "help" && $# -le 1 ]]; then
|
|
70
|
-
print_launcher_help
|
|
71
|
-
exit 0
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
if [[ "${1:-}" == "help" && "${2:-}" == "install-codex-plugin" ]]; then
|
|
75
|
-
cat <<'EOF'
|
|
76
|
-
Usage:
|
|
77
|
-
open-computer-use install-codex-plugin
|
|
101
|
+
function printInstallHelp(scriptName, usage) {
|
|
102
|
+
console.log(`Usage:
|
|
103
|
+
${usage}
|
|
78
104
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exit 0
|
|
82
|
-
fi
|
|
105
|
+
This helper updates a local MCP or plugin config to run:
|
|
106
|
+
open-computer-use mcp
|
|
83
107
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
open-computer-use install-codex-mcp
|
|
108
|
+
Script:
|
|
109
|
+
${scriptName}`);
|
|
110
|
+
}
|
|
88
111
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
exit
|
|
92
|
-
|
|
112
|
+
function fail(message) {
|
|
113
|
+
console.error(message);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
93
116
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
117
|
+
function spawnAndExit(executable, executableArgs) {
|
|
118
|
+
const child = spawn(executable, executableArgs, {
|
|
119
|
+
stdio: "inherit",
|
|
120
|
+
windowsHide: false,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
child.on("error", (error) => {
|
|
124
|
+
fail(`Failed to start ${executable}: ${error.message}`);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
128
|
+
process.on(signal, () => {
|
|
129
|
+
child.kill(signal);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
child.on("exit", (code, signal) => {
|
|
134
|
+
if (signal) {
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
process.exit(code ?? 0);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
99
140
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
141
|
+
function runInstallCommand(scriptName, scriptArgs) {
|
|
142
|
+
if (process.platform === "win32") {
|
|
143
|
+
fail(`${command} currently requires a POSIX shell. Configure your MCP client with command "open-computer-use" and args ["mcp"] on Windows.`);
|
|
144
|
+
}
|
|
104
145
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
146
|
+
const scriptPath = path.join(packageRoot, "scripts", scriptName);
|
|
147
|
+
if (!fs.existsSync(scriptPath)) {
|
|
148
|
+
fail(`Missing installer helper at ${scriptPath}.`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
spawnAndExit(scriptPath, scriptArgs);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function resolveNativeExecutable() {
|
|
155
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
156
|
+
const target = platformPackages[platformKey];
|
|
157
|
+
if (!target) {
|
|
158
|
+
const supported = Object.keys(platformPackages).sort().join(", ");
|
|
159
|
+
fail(`Unsupported platform ${platformKey}. Supported platforms: ${supported}.`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const executablePath = path.join(packageRoot, ...target.executablePath);
|
|
163
|
+
if (!fs.existsSync(executablePath)) {
|
|
164
|
+
fail(`Missing bundled native runtime for ${platformKey} at ${executablePath}.
|
|
165
|
+
|
|
166
|
+
Reinstall with:
|
|
167
|
+
npm install -g open-computer-use`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return executablePath;
|
|
171
|
+
}
|
|
109
172
|
|
|
110
|
-
|
|
173
|
+
if (command === "-h" || command === "--help" || (command === "help" && args.length <= 1)) {
|
|
174
|
+
printLauncherHelp();
|
|
175
|
+
process.exit(0);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (command === "help" && args[1] === "install-codex-plugin") {
|
|
179
|
+
printInstallHelp("install-codex-plugin.sh", "open-computer-use install-codex-plugin");
|
|
180
|
+
process.exit(0);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (command === "help" && args[1] === "install-codex-mcp") {
|
|
184
|
+
printInstallHelp("install-codex-mcp.sh", "open-computer-use install-codex-mcp");
|
|
185
|
+
process.exit(0);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (command === "help" && args[1] === "install-gemini-mcp") {
|
|
189
|
+
printInstallHelp("install-gemini-mcp.sh", "open-computer-use install-gemini-mcp [--scope project|user]");
|
|
190
|
+
process.exit(0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (command === "help" && args[1] === "install-opencode-mcp") {
|
|
194
|
+
printInstallHelp("install-opencode-mcp.sh", "open-computer-use install-opencode-mcp");
|
|
195
|
+
process.exit(0);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (command === "help" && (args[1] === "install-claude-mcp" || args[1] === "install-clauce-mcp")) {
|
|
199
|
+
printInstallHelp("install-claude-mcp.sh", "open-computer-use install-claude-mcp");
|
|
200
|
+
process.exit(0);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (installCommands.has(command)) {
|
|
204
|
+
const scriptName = installCommands.get(command);
|
|
205
|
+
runInstallCommand(scriptName, args.slice(1));
|
|
206
|
+
} else {
|
|
207
|
+
spawnAndExit(resolveNativeExecutable(), args);
|
|
208
|
+
}
|
package/bin/open-computer-use
CHANGED
|
@@ -1,9 +1,74 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require("node:child_process");
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
|
|
6
|
+
const platformPackages = {
|
|
7
|
+
"darwin-arm64": {
|
|
8
|
+
"executablePath": [
|
|
9
|
+
"dist",
|
|
10
|
+
"Open Computer Use.app",
|
|
11
|
+
"Contents",
|
|
12
|
+
"MacOS",
|
|
13
|
+
"OpenComputerUse"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"darwin-x64": {
|
|
17
|
+
"executablePath": [
|
|
18
|
+
"dist",
|
|
19
|
+
"Open Computer Use.app",
|
|
20
|
+
"Contents",
|
|
21
|
+
"MacOS",
|
|
22
|
+
"OpenComputerUse"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"linux-arm64": {
|
|
26
|
+
"executablePath": [
|
|
27
|
+
"dist",
|
|
28
|
+
"linux",
|
|
29
|
+
"arm64",
|
|
30
|
+
"open-computer-use"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"linux-x64": {
|
|
34
|
+
"executablePath": [
|
|
35
|
+
"dist",
|
|
36
|
+
"linux",
|
|
37
|
+
"amd64",
|
|
38
|
+
"open-computer-use"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"win32-arm64": {
|
|
42
|
+
"executablePath": [
|
|
43
|
+
"dist",
|
|
44
|
+
"windows",
|
|
45
|
+
"arm64",
|
|
46
|
+
"open-computer-use.exe"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"win32-x64": {
|
|
50
|
+
"executablePath": [
|
|
51
|
+
"dist",
|
|
52
|
+
"windows",
|
|
53
|
+
"amd64",
|
|
54
|
+
"open-computer-use.exe"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
59
|
+
const args = process.argv.slice(2);
|
|
60
|
+
const command = args[0] || "";
|
|
61
|
+
const installCommands = new Map([
|
|
62
|
+
["install-claude-mcp", "install-claude-mcp.sh"],
|
|
63
|
+
["install-clauce-mcp", "install-claude-mcp.sh"],
|
|
64
|
+
["install-gemini-mcp", "install-gemini-mcp.sh"],
|
|
65
|
+
["install-codex-mcp", "install-codex-mcp.sh"],
|
|
66
|
+
["install-opencode-mcp", "install-opencode-mcp.sh"],
|
|
67
|
+
["install-codex-plugin", "install-codex-plugin.sh"],
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
function printLauncherHelp() {
|
|
71
|
+
console.log(`Open Computer Use
|
|
7
72
|
|
|
8
73
|
Usage:
|
|
9
74
|
open-computer-use [command] [options]
|
|
@@ -11,13 +76,15 @@ Usage:
|
|
|
11
76
|
|
|
12
77
|
Commands:
|
|
13
78
|
mcp Start the stdio MCP server.
|
|
14
|
-
doctor Print permission status and launch onboarding if needed.
|
|
79
|
+
doctor Print permission status and launch onboarding if needed on macOS.
|
|
15
80
|
list-apps Print running or recently used apps.
|
|
16
81
|
snapshot <app> Print the current accessibility snapshot for an app.
|
|
17
|
-
call <tool>
|
|
82
|
+
call <tool> Call one tool, or run a JSON array of tool calls.
|
|
18
83
|
turn-ended Notify the running MCP process that the host turn ended.
|
|
19
84
|
install-claude-mcp Install the MCP server into ~/.claude.json for this project.
|
|
85
|
+
install-gemini-mcp Install the MCP server into Gemini CLI config.
|
|
20
86
|
install-codex-mcp Install the MCP server into ~/.codex/config.toml.
|
|
87
|
+
install-opencode-mcp Install the MCP server into ~/.config/opencode.
|
|
21
88
|
install-codex-plugin Install this npm package into the local Codex plugin cache.
|
|
22
89
|
help [command] Show general or command-specific help.
|
|
23
90
|
version Print the CLI version.
|
|
@@ -27,84 +94,115 @@ Global options:
|
|
|
27
94
|
-v, --version Show version.
|
|
28
95
|
|
|
29
96
|
Notes:
|
|
30
|
-
|
|
31
|
-
Use
|
|
32
|
-
EOF
|
|
97
|
+
This npm package bundles native runtimes for supported platforms and selects the current os-arch at launch.
|
|
98
|
+
Use 'open-computer-use help <command>' for command-specific help.`);
|
|
33
99
|
}
|
|
34
100
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
script_path="$(readlink "${script_path}")"
|
|
39
|
-
if [[ "${script_path}" != /* ]]; then
|
|
40
|
-
script_path="${script_dir}/${script_path}"
|
|
41
|
-
fi
|
|
42
|
-
done
|
|
43
|
-
package_root="$(cd "$(dirname "${script_path}")/.." && pwd)"
|
|
44
|
-
app_binary="${package_root}/dist/Open Computer Use.app/Contents/MacOS/OpenComputerUse"
|
|
45
|
-
install_claude_mcp_script="${package_root}/scripts/install-claude-mcp.sh"
|
|
46
|
-
install_mcp_script="${package_root}/scripts/install-codex-mcp.sh"
|
|
47
|
-
install_script="${package_root}/scripts/install-codex-plugin.sh"
|
|
48
|
-
|
|
49
|
-
if [[ "${1:-}" == "install-claude-mcp" || "${1:-}" == "install-clauce-mcp" ]]; then
|
|
50
|
-
shift
|
|
51
|
-
exec "${install_claude_mcp_script}" "$@"
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
if [[ "${1:-}" == "install-codex-mcp" ]]; then
|
|
55
|
-
shift
|
|
56
|
-
exec "${install_mcp_script}" "$@"
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
if [[ "${1:-}" == "install-codex-plugin" ]]; then
|
|
60
|
-
shift
|
|
61
|
-
exec "${install_script}" "$@"
|
|
62
|
-
fi
|
|
63
|
-
|
|
64
|
-
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
|
|
65
|
-
print_launcher_help
|
|
66
|
-
exit 0
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
if [[ "${1:-}" == "help" && $# -le 1 ]]; then
|
|
70
|
-
print_launcher_help
|
|
71
|
-
exit 0
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
if [[ "${1:-}" == "help" && "${2:-}" == "install-codex-plugin" ]]; then
|
|
75
|
-
cat <<'EOF'
|
|
76
|
-
Usage:
|
|
77
|
-
open-computer-use install-codex-plugin
|
|
101
|
+
function printInstallHelp(scriptName, usage) {
|
|
102
|
+
console.log(`Usage:
|
|
103
|
+
${usage}
|
|
78
104
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exit 0
|
|
82
|
-
fi
|
|
105
|
+
This helper updates a local MCP or plugin config to run:
|
|
106
|
+
open-computer-use mcp
|
|
83
107
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
open-computer-use install-codex-mcp
|
|
108
|
+
Script:
|
|
109
|
+
${scriptName}`);
|
|
110
|
+
}
|
|
88
111
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
exit
|
|
92
|
-
|
|
112
|
+
function fail(message) {
|
|
113
|
+
console.error(message);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
93
116
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
117
|
+
function spawnAndExit(executable, executableArgs) {
|
|
118
|
+
const child = spawn(executable, executableArgs, {
|
|
119
|
+
stdio: "inherit",
|
|
120
|
+
windowsHide: false,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
child.on("error", (error) => {
|
|
124
|
+
fail(`Failed to start ${executable}: ${error.message}`);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
128
|
+
process.on(signal, () => {
|
|
129
|
+
child.kill(signal);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
child.on("exit", (code, signal) => {
|
|
134
|
+
if (signal) {
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
process.exit(code ?? 0);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
99
140
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
141
|
+
function runInstallCommand(scriptName, scriptArgs) {
|
|
142
|
+
if (process.platform === "win32") {
|
|
143
|
+
fail(`${command} currently requires a POSIX shell. Configure your MCP client with command "open-computer-use" and args ["mcp"] on Windows.`);
|
|
144
|
+
}
|
|
104
145
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
146
|
+
const scriptPath = path.join(packageRoot, "scripts", scriptName);
|
|
147
|
+
if (!fs.existsSync(scriptPath)) {
|
|
148
|
+
fail(`Missing installer helper at ${scriptPath}.`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
spawnAndExit(scriptPath, scriptArgs);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function resolveNativeExecutable() {
|
|
155
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
156
|
+
const target = platformPackages[platformKey];
|
|
157
|
+
if (!target) {
|
|
158
|
+
const supported = Object.keys(platformPackages).sort().join(", ");
|
|
159
|
+
fail(`Unsupported platform ${platformKey}. Supported platforms: ${supported}.`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const executablePath = path.join(packageRoot, ...target.executablePath);
|
|
163
|
+
if (!fs.existsSync(executablePath)) {
|
|
164
|
+
fail(`Missing bundled native runtime for ${platformKey} at ${executablePath}.
|
|
165
|
+
|
|
166
|
+
Reinstall with:
|
|
167
|
+
npm install -g open-computer-use`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return executablePath;
|
|
171
|
+
}
|
|
109
172
|
|
|
110
|
-
|
|
173
|
+
if (command === "-h" || command === "--help" || (command === "help" && args.length <= 1)) {
|
|
174
|
+
printLauncherHelp();
|
|
175
|
+
process.exit(0);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (command === "help" && args[1] === "install-codex-plugin") {
|
|
179
|
+
printInstallHelp("install-codex-plugin.sh", "open-computer-use install-codex-plugin");
|
|
180
|
+
process.exit(0);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (command === "help" && args[1] === "install-codex-mcp") {
|
|
184
|
+
printInstallHelp("install-codex-mcp.sh", "open-computer-use install-codex-mcp");
|
|
185
|
+
process.exit(0);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (command === "help" && args[1] === "install-gemini-mcp") {
|
|
189
|
+
printInstallHelp("install-gemini-mcp.sh", "open-computer-use install-gemini-mcp [--scope project|user]");
|
|
190
|
+
process.exit(0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (command === "help" && args[1] === "install-opencode-mcp") {
|
|
194
|
+
printInstallHelp("install-opencode-mcp.sh", "open-computer-use install-opencode-mcp");
|
|
195
|
+
process.exit(0);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (command === "help" && (args[1] === "install-claude-mcp" || args[1] === "install-clauce-mcp")) {
|
|
199
|
+
printInstallHelp("install-claude-mcp.sh", "open-computer-use install-claude-mcp");
|
|
200
|
+
process.exit(0);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (installCommands.has(command)) {
|
|
204
|
+
const scriptName = installCommands.get(command);
|
|
205
|
+
runInstallCommand(scriptName, args.slice(1));
|
|
206
|
+
} else {
|
|
207
|
+
spawnAndExit(resolveNativeExecutable(), args);
|
|
208
|
+
}
|