kroki 1.0.0 → 1.0.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/README.md +8 -7
- package/bin/kroki.js +25 -43
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
No installation required. You can run it directly with `npx`:
|
|
15
15
|
|
|
16
16
|
### 1. Pair with your browser profile
|
|
17
|
+
> **Note:** Requires an active **Ultra** plan.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
1. Log in at [https://kroki.ai/#/devices](https://kroki.ai/#/devices).
|
|
20
|
+
2. Find your active Chrome or Dolphin{anty} profile.
|
|
21
|
+
3. Click **"Скопировать код для AI"**.
|
|
22
|
+
4. Run:
|
|
19
23
|
|
|
20
24
|
```bash
|
|
21
25
|
npx kroki pair <YOUR_PAIRING_CODE>
|
|
@@ -80,7 +84,7 @@ Add the following to your agent prompt or rule file (`.cursorrules` or `CLAUDE.m
|
|
|
80
84
|
|
|
81
85
|
```markdown
|
|
82
86
|
When the user requests live browser interaction or running Kroki workflows:
|
|
83
|
-
1. Ensure the profile is paired: run `npx kroki status`. If not paired, ask the user for their pairing code from https://kroki.
|
|
87
|
+
1. Ensure the profile is paired: run `npx kroki status`. If not paired, ask the user for their pairing code from https://kroki.ai/#/devices (Ultra plan required).
|
|
84
88
|
2. Pair via `npx kroki pair <CODE>`.
|
|
85
89
|
3. Dispatch tasks via `npx kroki "<task>"` or workflows via `npx kroki run "<workflow>" '[vars]'`.
|
|
86
90
|
```
|
|
@@ -91,12 +95,9 @@ When the user requests live browser interaction or running Kroki workflows:
|
|
|
91
95
|
|
|
92
96
|
| Command | Description |
|
|
93
97
|
| :--- | :--- |
|
|
94
|
-
| `npx kroki pair <code_from_devices>` | Connect to a specific browser profile (
|
|
98
|
+
| `npx kroki pair <code_from_devices>` | Connect to a specific browser profile (requires Ultra plan) |
|
|
95
99
|
| `npx kroki "<browser_task>"` | Send an autonomous agent task to the active browser profile |
|
|
96
100
|
| `npx kroki run "<workflow_name>" [json]` | Execute a saved Kroki deterministic workflow |
|
|
97
|
-
| `npx kroki status` | View the currently paired profile and device info |
|
|
98
|
-
| `npx kroki clear` | Clear active pairing session |
|
|
99
|
-
| `npx kroki help` | Show usage options and help |
|
|
100
101
|
|
|
101
102
|
---
|
|
102
103
|
|
|
@@ -111,4 +112,4 @@ When the user requests live browser interaction or running Kroki workflows:
|
|
|
111
112
|
|
|
112
113
|
## 📄 License
|
|
113
114
|
|
|
114
|
-
MIT © [Kroki Team](https://kroki.
|
|
115
|
+
MIT © [Kroki Team](https://kroki.ai)
|
package/bin/kroki.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* Kroki CLI — Control Kroki browser automation from terminal & AI agents.
|
|
5
5
|
* Zero external dependencies. Uses native Node.js 18+ WebSocket & Fetch.
|
|
6
6
|
*
|
|
7
|
-
* https://kroki.
|
|
7
|
+
* https://kroki.ai
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { existsSync, readFileSync, writeFileSync, unlinkSync, mkdirSync } from 'node:fs';
|
|
11
|
-
import {
|
|
11
|
+
import { join } from 'node:path';
|
|
12
12
|
import { homedir } from 'node:os';
|
|
13
13
|
|
|
14
14
|
const CONFIG_DIR = join(homedir(), '.kroki');
|
|
@@ -36,7 +36,7 @@ function decodePairingCode(code) {
|
|
|
36
36
|
return parsed;
|
|
37
37
|
} catch {
|
|
38
38
|
throw new Error(
|
|
39
|
-
'Invalid Kroki pairing code.\nPlease
|
|
39
|
+
'Invalid Kroki pairing code.\nPlease get a valid code from your Kroki Devices panel: https://kroki.ai/#/devices',
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -191,9 +191,17 @@ class RealtimeConnection {
|
|
|
191
191
|
|
|
192
192
|
async function pairCommand(code) {
|
|
193
193
|
if (!code) {
|
|
194
|
-
console.
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
console.log(`
|
|
195
|
+
\x1b[1mKroki Pairing\x1b[0m
|
|
196
|
+
Requires an active \x1b[33mUltra\x1b[0m plan.
|
|
197
|
+
|
|
198
|
+
1. Log in at \x1b[36mhttps://kroki.ai/#/devices\x1b[0m
|
|
199
|
+
2. Find your active browser profile (Chrome or Dolphin{anty})
|
|
200
|
+
3. Click \x1b[32m"Скопировать код для AI"\x1b[0m
|
|
201
|
+
4. Run:
|
|
202
|
+
\x1b[33mnpx kroki pair <YOUR_CODE>\x1b[0m
|
|
203
|
+
`);
|
|
204
|
+
process.exit(0);
|
|
197
205
|
}
|
|
198
206
|
|
|
199
207
|
const payload = decodePairingCode(code);
|
|
@@ -220,8 +228,8 @@ async function taskCommand(taskText) {
|
|
|
220
228
|
const session = getActiveSession();
|
|
221
229
|
if (!session) {
|
|
222
230
|
console.error('\x1b[31mError: Not paired.\x1b[0m');
|
|
223
|
-
console.error('
|
|
224
|
-
console.error('
|
|
231
|
+
console.error('Pair first with code from https://kroki.ai/#/devices (Ultra plan required):');
|
|
232
|
+
console.error(' \x1b[33mnpx kroki pair <YOUR_CODE>\x1b[0m\n');
|
|
225
233
|
process.exit(1);
|
|
226
234
|
}
|
|
227
235
|
|
|
@@ -262,7 +270,8 @@ async function workflowCommand(nameOrId, varsJson) {
|
|
|
262
270
|
const session = getActiveSession();
|
|
263
271
|
if (!session) {
|
|
264
272
|
console.error('\x1b[31mError: Not paired.\x1b[0m');
|
|
265
|
-
console.error('Pair first with
|
|
273
|
+
console.error('Pair first with code from https://kroki.ai/#/devices (Ultra plan required):');
|
|
274
|
+
console.error(' \x1b[33mnpx kroki pair <YOUR_CODE>\x1b[0m\n');
|
|
266
275
|
process.exit(1);
|
|
267
276
|
}
|
|
268
277
|
|
|
@@ -306,39 +315,17 @@ async function workflowCommand(nameOrId, varsJson) {
|
|
|
306
315
|
}
|
|
307
316
|
}
|
|
308
317
|
|
|
309
|
-
function statusCommand() {
|
|
310
|
-
const session = getActiveSession();
|
|
311
|
-
if (!session) {
|
|
312
|
-
console.log('\x1b[33mStatus: Not paired with any browser profile.\x1b[0m');
|
|
313
|
-
console.log('Pair with:\n npx kroki pair <CODE_FROM_DEVICES>');
|
|
314
|
-
} else {
|
|
315
|
-
console.log('\x1b[32mStatus: Paired and Active\x1b[0m');
|
|
316
|
-
console.log(`Profile: ${session.deviceName || session.deviceId}`);
|
|
317
|
-
console.log(`Device ID: ${session.deviceId}`);
|
|
318
|
-
console.log(`Platform: ${session.platform || 'unknown'}`);
|
|
319
|
-
console.log(`Paired At: ${new Date(session.pairedAt).toLocaleString()}`);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
318
|
function helpCommand() {
|
|
324
319
|
console.log(`
|
|
325
|
-
\x1b[1mKroki CLI\x1b[0m —
|
|
320
|
+
\x1b[1mKroki CLI\x1b[0m — Browser Automation & AI Agent Bridge for Chrome & Dolphin{anty}
|
|
326
321
|
|
|
327
322
|
\x1b[1mUsage:\x1b[0m
|
|
328
|
-
npx kroki pair <code_from_devices> Pair with a browser profile (
|
|
329
|
-
npx kroki "<browser_task>" Send an AI task to the
|
|
330
|
-
npx kroki run "<workflow_name>" [json] Execute a
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
\x1b[1mExamples:\x1b[0m
|
|
336
|
-
npx kroki pair kroki_eyJh...
|
|
337
|
-
npx kroki "find top 5 mechanical keyboards on Amazon and return prices"
|
|
338
|
-
npx kroki run "Export Leads" '{"limit": 50}'
|
|
339
|
-
|
|
340
|
-
\x1b[1mDocs & Dashboard:\x1b[0m
|
|
341
|
-
https://kroki.one/devices
|
|
323
|
+
npx kroki pair <code_from_devices> Pair with a browser profile (requires Ultra plan)
|
|
324
|
+
npx kroki "<browser_task>" Send an AI task to the live browser
|
|
325
|
+
npx kroki run "<workflow_name>" [json] Execute a saved workflow
|
|
326
|
+
|
|
327
|
+
\x1b[1mGet pairing code:\x1b[0m
|
|
328
|
+
https://kroki.ai/#/devices
|
|
342
329
|
`);
|
|
343
330
|
}
|
|
344
331
|
|
|
@@ -364,10 +351,6 @@ switch (first) {
|
|
|
364
351
|
});
|
|
365
352
|
break;
|
|
366
353
|
|
|
367
|
-
case 'status':
|
|
368
|
-
statusCommand();
|
|
369
|
-
break;
|
|
370
|
-
|
|
371
354
|
case 'clear':
|
|
372
355
|
case 'disconnect':
|
|
373
356
|
clearActiveSession();
|
|
@@ -381,7 +364,6 @@ switch (first) {
|
|
|
381
364
|
break;
|
|
382
365
|
|
|
383
366
|
default:
|
|
384
|
-
// If user ran `npx kroki "do something..."` directly
|
|
385
367
|
taskCommand(rawArgs.join(' ')).catch(e => {
|
|
386
368
|
console.error(`\x1b[31mError:\x1b[0m ${e.message}`);
|
|
387
369
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kroki",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Kroki Browser Automation CLI — Control Chrome & Dolphin{anty} from terminal and AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kroki",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"type": "module",
|
|
18
18
|
"bin": {
|
|
19
|
-
"kroki": "
|
|
19
|
+
"kroki": "bin/kroki.js"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"bin",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"bugs": {
|
|
34
34
|
"url": "https://github.com/one-focus/kroki-cli/issues"
|
|
35
35
|
},
|
|
36
|
-
"homepage": "https://kroki.
|
|
36
|
+
"homepage": "https://kroki.ai"
|
|
37
37
|
}
|