@onkernel/cli 0.13.1 → 0.13.3

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.
Files changed (2) hide show
  1. package/README.md +63 -3
  2. package/package.json +19 -19
package/README.md CHANGED
@@ -104,6 +104,32 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
104
104
  - `--no-color` - Disable color output
105
105
  - `--log-level <level>` - Set log level (trace, debug, info, warn, error, fatal, print)
106
106
 
107
+ ## JSON Output
108
+
109
+ Many commands support JSON output for scripting and automation. Use `--output json` or `-o json` to get machine-readable output:
110
+
111
+ ```bash
112
+ # Get browser session details as JSON
113
+ kernel browsers create -o json
114
+
115
+ # List apps as JSON
116
+ kernel app list -o json
117
+
118
+ # Deploy with JSONL streaming output (one JSON object per line)
119
+ kernel deploy index.ts -o json
120
+ ```
121
+
122
+ Commands with JSON output support:
123
+ - **Browsers**: `create`, `list`, `get`, `view`
124
+ - **Browser Pools**: `create`, `list`, `get`, `update`, `acquire`
125
+ - **Profiles**: `create`, `list`, `get`
126
+ - **Extensions**: `upload`, `list`
127
+ - **Proxies**: `create`, `list`, `get`
128
+ - **Apps**: `list`, `history`
129
+ - **Deploy**: `deploy` (JSONL streaming), `history`
130
+ - **Invoke**: `invoke` (JSONL streaming), `history`
131
+ - **Browser Sub-commands**: `replays list/start`, `process exec/spawn`, `fs file-info/list-files`
132
+
107
133
  ### Authentication
108
134
 
109
135
  - `kernel login [--force]` - Login via OAuth 2.0
@@ -134,6 +160,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
134
160
  - `--force` - Allow overwriting existing version
135
161
  - `--env <KEY=VALUE>`, `-e` - Set environment variables (can be used multiple times)
136
162
  - `--env-file <file>` - Load environment variables from file (can be used multiple times)
163
+ - `--output json`, `-o json` - Output JSONL (one JSON object per line for each event)
137
164
 
138
165
  - `kernel deploy logs <deployment_id>` - Stream logs for a deployment
139
166
 
@@ -143,6 +170,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
143
170
 
144
171
  - `kernel deploy history [app_name]` - Show deployment history
145
172
  - `--limit <n>` - Max deployments to return (default: 100; 0 = all)
173
+ - `--output json`, `-o json` - Output raw JSON array
146
174
 
147
175
  ### App Management
148
176
 
@@ -150,15 +178,19 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
150
178
 
151
179
  - `--version <version>`, `-v` - Specify app version (default: latest)
152
180
  - `--payload <json>`, `-p` - JSON payload for the action
181
+ - `--payload-file <path>`, `-f` - Read JSON payload from a file (use `-` for stdin)
153
182
  - `--sync`, `-s` - Invoke synchronously (timeout after 60s)
183
+ - `--output json`, `-o json` - Output JSONL (one JSON object per line for each event)
154
184
 
155
185
  - `kernel app list` - List deployed apps
156
186
 
157
187
  - `--name <app_name>` - Filter by app name
158
188
  - `--version <version>` - Filter by version
189
+ - `--output json`, `-o json` - Output raw JSON array
159
190
 
160
191
  - `kernel app history <app_name>` - Show deployment history for an app
161
192
  - `--limit <n>` - Max deployments to return (default: 100; 0 = all)
193
+ - `--output json`, `-o json` - Output raw JSON array
162
194
 
163
195
  ### Logs
164
196
 
@@ -171,21 +203,26 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
171
203
  ### Browser Management
172
204
 
173
205
  - `kernel browsers list` - List running browsers
206
+ - `--output json`, `-o json` - Output raw JSON array
174
207
  - `kernel browsers create` - Create a new browser session
175
208
  - `-s, --stealth` - Launch browser in stealth mode to avoid detection
176
209
  - `-H, --headless` - Launch browser without GUI access
177
210
  - `--kiosk` - Launch browser in kiosk mode
178
211
  - `--pool-id <id>` - Acquire a browser from the specified pool (mutually exclusive with --pool-name; ignores other session flags)
179
212
  - `--pool-name <name>` - Acquire a browser from the pool name (mutually exclusive with --pool-id; ignores other session flags)
213
+ - `--output json`, `-o json` - Output raw JSON object
180
214
  - _Note: When a pool is specified, omit other session configuration flags—pool settings determine profile, proxy, viewport, etc._
181
215
  - `kernel browsers delete <id>` - Delete a browser
182
216
  - `-y, --yes` - Skip confirmation prompt
183
217
  - `kernel browsers view <id>` - Get live view URL for a browser
218
+ - `--output json`, `-o json` - Output JSON with liveViewUrl
219
+ - `kernel browsers get <id>` - Get detailed browser session info
220
+ - `--output json`, `-o json` - Output raw JSON object
184
221
 
185
222
  ### Browser Pools
186
223
 
187
224
  - `kernel browser-pools list` - List browser pools
188
- - `-o, --output json` - Output raw JSON response
225
+ - `--output json`, `-o json` - Output raw JSON array
189
226
  - `kernel browser-pools create` - Create a browser pool
190
227
  - `--name <name>` - Optional unique name for the pool
191
228
  - `--size <n>` - Number of browsers in the pool (required)
@@ -193,14 +230,17 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
193
230
  - `--timeout <seconds>` - Idle timeout for browsers acquired from the pool
194
231
  - `--stealth`, `--headless`, `--kiosk` - Default pool configuration
195
232
  - `--profile-id`, `--profile-name`, `--save-changes`, `--proxy-id`, `--extension`, `--viewport` - Same semantics as `kernel browsers create`
233
+ - `--output json`, `-o json` - Output raw JSON object
196
234
  - `kernel browser-pools get <id-or-name>` - Get pool details
197
- - `-o, --output json` - Output raw JSON response
235
+ - `--output json`, `-o json` - Output raw JSON object
198
236
  - `kernel browser-pools update <id-or-name>` - Update pool configuration
199
237
  - Same flags as create plus `--discard-all-idle` to discard all idle browsers in the pool and refill at the specified fill rate
238
+ - `--output json`, `-o json` - Output raw JSON object
200
239
  - `kernel browser-pools delete <id-or-name>` - Delete a pool
201
240
  - `--force` - Force delete even if browsers are leased
202
241
  - `kernel browser-pools acquire <id-or-name>` - Acquire a browser from the pool
203
242
  - `--timeout <seconds>` - Acquire timeout before returning 204
243
+ - `--output json`, `-o json` - Output raw JSON object
204
244
  - `kernel browser-pools release <id-or-name>` - Release a browser back to the pool
205
245
  - `--session-id <id>` - Browser session ID to release (required)
206
246
  - `--reuse` - Reuse the browser instance (default: true)
@@ -217,12 +257,14 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
217
257
  ### Browser Replays
218
258
 
219
259
  - `kernel browsers replays list <id>` - List replays for a browser
260
+ - `--output json`, `-o json` - Output raw JSON array
220
261
  - `kernel browsers replays start <id>` - Start a replay recording
221
262
  - `--framerate <fps>` - Recording framerate (fps)
222
263
  - `--max-duration <seconds>` - Maximum duration in seconds
264
+ - `--output json`, `-o json` - Output raw JSON object
223
265
  - `kernel browsers replays stop <id> <replay-id>` - Stop a replay recording
224
266
  - `kernel browsers replays download <id> <replay-id>` - Download a replay video
225
- - `-o, --output <path>` - Output file path for the replay video
267
+ - `-f, --output-file <path>` - Output file path for the replay video
226
268
 
227
269
  ### Browser Process Control
228
270
 
@@ -233,6 +275,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
233
275
  - `--timeout <seconds>` - Timeout in seconds
234
276
  - `--as-user <user>` - Run as user
235
277
  - `--as-root` - Run as root
278
+ - `--output json`, `-o json` - Output raw JSON object
236
279
  - `kernel browsers process spawn <id> [--] [command...]` - Execute a command asynchronously
237
280
  - `--command <cmd>` - Command to execute (optional; if omitted, trailing args are executed via /bin/bash -c)
238
281
  - `--args <args>` - Command arguments
@@ -240,6 +283,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
240
283
  - `--timeout <seconds>` - Timeout in seconds
241
284
  - `--as-user <user>` - Run as user
242
285
  - `--as-root` - Run as root
286
+ - `--output json`, `-o json` - Output raw JSON object
243
287
  - `kernel browsers process kill <id> <process-id>` - Send a signal to a process
244
288
  - `--signal <signal>` - Signal to send: TERM, KILL, INT, HUP (default: TERM)
245
289
  - `kernel browsers process status <id> <process-id>` - Get process status
@@ -261,8 +305,10 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
261
305
  - `-o, --output <path>` - Output zip file path
262
306
  - `kernel browsers fs file-info <id>` - Get file or directory info
263
307
  - `--path <path>` - Absolute file or directory path (required)
308
+ - `--output json`, `-o json` - Output raw JSON object
264
309
  - `kernel browsers fs list-files <id>` - List files in a directory
265
310
  - `--path <path>` - Absolute directory path (required)
311
+ - `--output json`, `-o json` - Output raw JSON array
266
312
  - `kernel browsers fs move <id>` - Move or rename a file or directory
267
313
  - `--src <path>` - Absolute source path (required)
268
314
  - `--dest <path>` - Absolute destination path (required)
@@ -343,8 +389,10 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
343
389
  ### Extension Management
344
390
 
345
391
  - `kernel extensions list` - List all uploaded extensions
392
+ - `--output json`, `-o json` - Output raw JSON array
346
393
  - `kernel extensions upload <directory>` - Upload an unpacked browser extension directory
347
394
  - `--name <name>` - Optional unique extension name
395
+ - `--output json`, `-o json` - Output raw JSON object
348
396
  - `kernel extensions download <id-or-name>` - Download an extension archive
349
397
  - `--to <directory>` - Output directory (required)
350
398
  - `kernel extensions download-web-store <url>` - Download an extension from the Chrome Web Store
@@ -356,8 +404,11 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
356
404
  ### Proxy Management
357
405
 
358
406
  - `kernel proxies list` - List proxy configurations
407
+ - `--output json`, `-o json` - Output raw JSON array
359
408
  - `kernel proxies get <id>` - Get a proxy configuration by ID
409
+ - `--output json`, `-o json` - Output raw JSON object
360
410
  - `kernel proxies create` - Create a new proxy configuration
411
+ - `--output json`, `-o json` - Output raw JSON object
361
412
 
362
413
  - `--name <name>` - Proxy configuration name
363
414
  - `--type <type>` - Proxy type: datacenter, isp, residential, mobile, custom (required)
@@ -423,6 +474,15 @@ kernel invoke my-scraper scrape-page
423
474
  # With JSON payload
424
475
  kernel invoke my-scraper scrape-page --payload '{"url": "https://example.com"}'
425
476
 
477
+ # Read payload from a file
478
+ kernel invoke my-scraper scrape-page --payload-file payload.json
479
+
480
+ # Read payload from stdin
481
+ cat payload.json | kernel invoke my-scraper scrape-page --payload-file -
482
+
483
+ # Pipe from another command
484
+ echo '{"url": "https://example.com"}' | kernel invoke my-scraper scrape-page -f -
485
+
426
486
  # Synchronous invoke (wait for completion)
427
487
  kernel invoke my-scraper quick-task --sync
428
488
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onkernel/cli",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "description": "Kernel CLI",
5
5
  "scripts": {
6
6
  "postinstall": "node install.js",
@@ -34,75 +34,75 @@
34
34
  },
35
35
  "archives": {
36
36
  "darwin-arm64": {
37
- "name": "kernel_0.13.1_darwin_arm64.tar.gz",
38
- "url": "https://github.com/kernel/cli/releases/download/v0.13.1/kernel_0.13.1_darwin_arm64.tar.gz",
37
+ "name": "kernel_0.13.3_darwin_arm64.tar.gz",
38
+ "url": "https://github.com/kernel/cli/releases/download/v0.13.3/kernel_0.13.3_darwin_arm64.tar.gz",
39
39
  "bins": [
40
40
  "kernel"
41
41
  ],
42
42
  "format": "tar.gz",
43
43
  "checksum": {
44
44
  "algorithm": "sha256",
45
- "digest": "660a6f7dc37391e975185f9309b9cfd4c142a3997b72224855ce326a7733cc20"
45
+ "digest": "0df1539a228e90d2fc60aead8af93799f24361d08239cdc907fe1a306605f1d3"
46
46
  }
47
47
  },
48
48
  "darwin-x64": {
49
- "name": "kernel_0.13.1_darwin_amd64.tar.gz",
50
- "url": "https://github.com/kernel/cli/releases/download/v0.13.1/kernel_0.13.1_darwin_amd64.tar.gz",
49
+ "name": "kernel_0.13.3_darwin_amd64.tar.gz",
50
+ "url": "https://github.com/kernel/cli/releases/download/v0.13.3/kernel_0.13.3_darwin_amd64.tar.gz",
51
51
  "bins": [
52
52
  "kernel"
53
53
  ],
54
54
  "format": "tar.gz",
55
55
  "checksum": {
56
56
  "algorithm": "sha256",
57
- "digest": "19f8e2d330d3f1a54714b12267bf76220919a61c38f46aa2d33087b1fbef49d5"
57
+ "digest": "6d855018dbeac070979124c3cf6a9221574dd9c2cb5ccc3bd6d8f8d4745fa2a3"
58
58
  }
59
59
  },
60
60
  "linux-arm64": {
61
- "name": "kernel_0.13.1_linux_arm64.tar.gz",
62
- "url": "https://github.com/kernel/cli/releases/download/v0.13.1/kernel_0.13.1_linux_arm64.tar.gz",
61
+ "name": "kernel_0.13.3_linux_arm64.tar.gz",
62
+ "url": "https://github.com/kernel/cli/releases/download/v0.13.3/kernel_0.13.3_linux_arm64.tar.gz",
63
63
  "bins": [
64
64
  "kernel"
65
65
  ],
66
66
  "format": "tar.gz",
67
67
  "checksum": {
68
68
  "algorithm": "sha256",
69
- "digest": "18581682ac0161ed045366960e0d7bcc0baf8fb72f1ed57a80ad16c44fd8d471"
69
+ "digest": "25692da0b0f9d439c488257e3560599c542bbfbb229e51286dccbc7bcc7aab9b"
70
70
  }
71
71
  },
72
72
  "linux-x64": {
73
- "name": "kernel_0.13.1_linux_amd64.tar.gz",
74
- "url": "https://github.com/kernel/cli/releases/download/v0.13.1/kernel_0.13.1_linux_amd64.tar.gz",
73
+ "name": "kernel_0.13.3_linux_amd64.tar.gz",
74
+ "url": "https://github.com/kernel/cli/releases/download/v0.13.3/kernel_0.13.3_linux_amd64.tar.gz",
75
75
  "bins": [
76
76
  "kernel"
77
77
  ],
78
78
  "format": "tar.gz",
79
79
  "checksum": {
80
80
  "algorithm": "sha256",
81
- "digest": "948e2494b099ae491ef744b8d21ec5b892ebb5488723f1dd7751a8371ceb7a5a"
81
+ "digest": "c7515b33368a72907f2c023c6b70265372a7ba493ee89539bb34462c577f7456"
82
82
  }
83
83
  },
84
84
  "win32-arm64": {
85
- "name": "kernel_0.13.1_windows_arm64.tar.gz",
86
- "url": "https://github.com/kernel/cli/releases/download/v0.13.1/kernel_0.13.1_windows_arm64.tar.gz",
85
+ "name": "kernel_0.13.3_windows_arm64.tar.gz",
86
+ "url": "https://github.com/kernel/cli/releases/download/v0.13.3/kernel_0.13.3_windows_arm64.tar.gz",
87
87
  "bins": [
88
88
  "kernel.exe"
89
89
  ],
90
90
  "format": "tar.gz",
91
91
  "checksum": {
92
92
  "algorithm": "sha256",
93
- "digest": "8935da83ba9d6bd19ab795b221e168798c6fde215b89ec4a60d072669f4c6189"
93
+ "digest": "b738bd181fa6049e76affb7d718655bcc72ac0790a0acb93d97a27b1d67abbcd"
94
94
  }
95
95
  },
96
96
  "win32-x64": {
97
- "name": "kernel_0.13.1_windows_amd64.tar.gz",
98
- "url": "https://github.com/kernel/cli/releases/download/v0.13.1/kernel_0.13.1_windows_amd64.tar.gz",
97
+ "name": "kernel_0.13.3_windows_amd64.tar.gz",
98
+ "url": "https://github.com/kernel/cli/releases/download/v0.13.3/kernel_0.13.3_windows_amd64.tar.gz",
99
99
  "bins": [
100
100
  "kernel.exe"
101
101
  ],
102
102
  "format": "tar.gz",
103
103
  "checksum": {
104
104
  "algorithm": "sha256",
105
- "digest": "03635704a7823c768f6bb8707d79b7865671e41de292e85e905f1c36571915be"
105
+ "digest": "bfb46e97f0aea1ee4059f3ed83b7fcb148576474dc896c9fecd6d5fbbe611855"
106
106
  }
107
107
  }
108
108
  }