nervepay 1.1.0 → 1.1.1
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/bin/nervepay-cli.js +15 -2
- package/package.json +1 -1
package/bin/nervepay-cli.js
CHANGED
|
@@ -39,14 +39,27 @@ program
|
|
|
39
39
|
try {
|
|
40
40
|
// Read OpenClaw config
|
|
41
41
|
const openclawConfig = JSON.parse(await readFile(OPENCLAW_CONFIG_PATH, 'utf-8'));
|
|
42
|
-
const gatewayConfig = openclawConfig.gateway?.remote;
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
// Support both local and remote gateway modes
|
|
44
|
+
let gatewayUrl, gatewayToken;
|
|
45
|
+
if (openclawConfig.gateway?.remote?.url) {
|
|
46
|
+
// Remote mode
|
|
47
|
+
gatewayUrl = openclawConfig.gateway.remote.url;
|
|
48
|
+
gatewayToken = openclawConfig.gateway.remote.token;
|
|
49
|
+
} else if (openclawConfig.gateway?.auth?.token) {
|
|
50
|
+
// Local mode - construct URL from port (default 18789)
|
|
51
|
+
const port = openclawConfig.gateway?.port || 18789;
|
|
52
|
+
gatewayUrl = `http://127.0.0.1:${port}`;
|
|
53
|
+
gatewayToken = openclawConfig.gateway.auth.token;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (!gatewayUrl || !gatewayToken) {
|
|
45
57
|
console.error(chalk.red('❌ No OpenClaw gateway configured'));
|
|
46
58
|
console.error(chalk.yellow(' Run: openclaw configure'));
|
|
47
59
|
process.exit(1);
|
|
48
60
|
}
|
|
49
61
|
|
|
62
|
+
const gatewayConfig = { url: gatewayUrl, token: gatewayToken };
|
|
50
63
|
console.log(chalk.green('✓ Found OpenClaw gateway:'), gatewayConfig.url);
|
|
51
64
|
|
|
52
65
|
// Ask for agent details
|