@oked/openclaw-cli 0.6.26 → 0.6.27
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 +16 -8
- package/bin/oked-openclaw.mjs +45 -15
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,21 +3,29 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@oked/openclaw-cli)
|
|
4
4
|
[](./LICENSE)
|
|
5
5
|
|
|
6
|
-
Pairing CLI for the [`@oked/openclaw`](../openclaw) plugin.
|
|
6
|
+
Pairing CLI for the [`@oked/openclaw`](../openclaw) plugin. Approvals are decided in Telegram and on the [web dashboard](https://oked.ai/dashboard). The plugin requires OpenClaw 2026.5.4 or newer.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
```bash
|
|
9
|
+
openclaw plugins install clawhub:@oked/openclaw
|
|
10
|
+
npx @oked/openclaw-cli init
|
|
11
|
+
```
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
A non-interactive install needs `--accept-capabilities` so OpenClaw can record the capability consent:
|
|
11
14
|
|
|
12
15
|
```bash
|
|
13
|
-
openclaw plugins install clawhub:@oked/openclaw
|
|
14
|
-
|
|
15
|
-
oked-openclaw init
|
|
16
|
+
openclaw plugins install clawhub:@oked/openclaw --accept-capabilities
|
|
17
|
+
npx @oked/openclaw-cli init
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
The install asks you to allow the Prompt injection capability. The plugin asks for it because a denial returns the reason to the agent. That text is how the agent learns the action was blocked and should stop.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
The two commands above install from [ClawHub](https://clawhub.ai/plugins/@oked/openclaw) and pair this machine. `openclaw` must already be on your PATH. You can also install this CLI globally with `npm install -g @oked/openclaw-cli` and run `oked-openclaw init`.
|
|
25
|
+
|
|
26
|
+
On OpenClaw 2026.10.9 a package name with no source locator is an npm install. To install the plugin straight from npm instead, use `openclaw plugins install npm:@oked/openclaw`.
|
|
19
27
|
|
|
20
|
-
`
|
|
28
|
+
`init` then:
|
|
21
29
|
|
|
22
30
|
1. If a local checkout or a global npm copy of `@oked/openclaw` is present, runs `openclaw plugins install --link <path>`. If the plugin is already installed and no local copy is present, skips install. Otherwise it tries `openclaw plugins install clawhub:@oked/openclaw` ([ClawHub](https://clawhub.ai/plugins/@oked/openclaw)). If that fails, it retries `openclaw plugins install npm:@oked/openclaw`.
|
|
23
31
|
2. Reuses `OKED_API_KEY` or an existing `plugins.entries.oked.apiKey`. Otherwise it pairs this device in the browser and saves the key to `~/.oked/config.json`. It does not ask you to paste a key.
|
package/bin/oked-openclaw.mjs
CHANGED
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { readFile, writeFile, mkdir, access, chmod } from 'node:fs/promises';
|
|
17
|
+
import { realpathSync } from 'node:fs';
|
|
17
18
|
import { homedir, hostname, platform } from 'node:os';
|
|
18
19
|
import path from 'node:path';
|
|
19
|
-
import { fileURLToPath
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
20
21
|
import readline from 'node:readline/promises';
|
|
21
22
|
import { stdin as input, stdout as output } from 'node:process';
|
|
22
23
|
import { spawn, spawnSync } from 'node:child_process';
|
|
@@ -427,20 +428,14 @@ async function cmdInit() {
|
|
|
427
428
|
|
|
428
429
|
// 4. Update openclaw.json - apiKey/minTier are now declared in the plugin's
|
|
429
430
|
// configSchema, so OpenClaw 2026.5+ will accept them under entries.oked.
|
|
431
|
+
// plugins.allow is the host allowlist. An install that leaves oked off
|
|
432
|
+
// that list shows "Plugin allowed: no" and the gateway will not load it.
|
|
430
433
|
process.stdout.write('4. Updating ~/.openclaw/openclaw.json... ');
|
|
431
|
-
const cfg = existing
|
|
432
|
-
cfg.plugins = cfg.plugins || {};
|
|
433
|
-
const allow = Array.isArray(cfg.plugins.allow) ? cfg.plugins.allow : [];
|
|
434
|
-
if (!allow.includes('oked')) allow.push('oked');
|
|
435
|
-
cfg.plugins.allow = allow;
|
|
436
|
-
cfg.plugins.entries = cfg.plugins.entries || {};
|
|
437
|
-
cfg.plugins.entries.oked = {
|
|
438
|
-
...(cfg.plugins.entries.oked || {}),
|
|
439
|
-
enabled: true,
|
|
434
|
+
const cfg = applyPluginConfig(existing, {
|
|
440
435
|
apiKey,
|
|
441
|
-
backendUrl: DEFAULT_BACKEND_URL,
|
|
442
436
|
minTier,
|
|
443
|
-
|
|
437
|
+
backendUrl: DEFAULT_BACKEND_URL,
|
|
438
|
+
});
|
|
444
439
|
await writeConfig(cfg);
|
|
445
440
|
console.log('done');
|
|
446
441
|
console.log(` File: ${OPENCLAW_CONFIG}\n`);
|
|
@@ -602,6 +597,30 @@ async function cmdUninstall() {
|
|
|
602
597
|
console.log(' Restart the OpenClaw daemon to fully unload the plugin.');
|
|
603
598
|
}
|
|
604
599
|
|
|
600
|
+
/**
|
|
601
|
+
* Write the OKed plugin entry and make sure `oked` is on plugins.allow.
|
|
602
|
+
* Mutates and returns cfg. A missing allow list becomes ["oked"]. An existing
|
|
603
|
+
* list keeps its other ids and gains oked when it is absent.
|
|
604
|
+
*/
|
|
605
|
+
export function applyPluginConfig(cfg, { apiKey, minTier, backendUrl }) {
|
|
606
|
+
const next = cfg && typeof cfg === 'object' ? cfg : {};
|
|
607
|
+
next.plugins = next.plugins && typeof next.plugins === 'object' ? next.plugins : {};
|
|
608
|
+
const allow = Array.isArray(next.plugins.allow) ? next.plugins.allow : [];
|
|
609
|
+
if (!allow.includes('oked')) allow.push('oked');
|
|
610
|
+
next.plugins.allow = allow;
|
|
611
|
+
next.plugins.entries = next.plugins.entries && typeof next.plugins.entries === 'object'
|
|
612
|
+
? next.plugins.entries
|
|
613
|
+
: {};
|
|
614
|
+
next.plugins.entries.oked = {
|
|
615
|
+
...(next.plugins.entries.oked || {}),
|
|
616
|
+
enabled: true,
|
|
617
|
+
apiKey,
|
|
618
|
+
backendUrl,
|
|
619
|
+
minTier,
|
|
620
|
+
};
|
|
621
|
+
return next;
|
|
622
|
+
}
|
|
623
|
+
|
|
605
624
|
function usage() {
|
|
606
625
|
console.log(`oked-openclaw - pairing CLI for the @oked/openclaw plugin
|
|
607
626
|
|
|
@@ -642,10 +661,21 @@ async function main() {
|
|
|
642
661
|
}
|
|
643
662
|
}
|
|
644
663
|
|
|
645
|
-
|
|
646
|
-
|
|
664
|
+
/**
|
|
665
|
+
* True when this file is the process entrypoint.
|
|
666
|
+
* npm and npx put a symlink in the bin path, so process.argv[1] is the link
|
|
667
|
+
* and import.meta.url is the real file. Compare the real paths.
|
|
668
|
+
*/
|
|
669
|
+
function isDirectRun(argvPath = process.argv[1]) {
|
|
670
|
+
if (!argvPath) return false;
|
|
671
|
+
try {
|
|
672
|
+
return realpathSync(argvPath) === realpathSync(fileURLToPath(import.meta.url));
|
|
673
|
+
} catch {
|
|
674
|
+
return false;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
647
677
|
|
|
648
|
-
if (isDirectRun) {
|
|
678
|
+
if (isDirectRun()) {
|
|
649
679
|
main().catch((err) => {
|
|
650
680
|
console.error(`oked-openclaw: ${err.message}`);
|
|
651
681
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oked/openclaw-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.27",
|
|
4
4
|
"description": "Installer CLI for the @oked/openclaw plugin. Wraps `openclaw plugins install` and configures the plugin entry in openclaw.json.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"test": "node --check bin/oked-openclaw.mjs && node test/install-plan.test.mjs"
|
|
14
|
+
"test": "node --check bin/oked-openclaw.mjs && node test/install-plan.test.mjs && node test/plugin-config.test.mjs && node test/direct-run.test.mjs"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@oked/sdk": "0.6.
|
|
17
|
+
"@oked/sdk": "0.6.27"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"openclaw",
|