@onkernel/cli 0.4.0 → 0.4.2

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 +151 -47
  2. package/package.json +19 -19
package/README.md CHANGED
@@ -1,88 +1,192 @@
1
1
  # Kernel CLI
2
2
 
3
- A command-line tool for deploying and invoking Kernel applications.
3
+ The Kernel CLI helps you deploy and run web automation apps on the Kernel platform. Build browser automation, web scraping, and AI agents that run in the cloud.
4
4
 
5
5
  ## Installation
6
6
 
7
+ Install the Kernel CLI using your favorite package manager:
8
+
7
9
  ```bash
10
+ # Using brew (recommended)
8
11
  brew install onkernel/tap/kernel
12
+
13
+ # Using pnpm
14
+ pnpm install -g @onkernel/cli
15
+
16
+ # Using npm
17
+ npm install -g @onkernel/cli
9
18
  ```
10
19
 
11
- ## Development Prerequisites
20
+ Verify the installation:
21
+
22
+ ```bash
23
+ which kernel
24
+ kernel --version
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ 1. **Authenticate with Kernel:**
30
+
31
+ ```bash
32
+ kernel login
33
+ ```
34
+
35
+ 2. **Deploy your first app:**
36
+
37
+ ```bash
38
+ kernel deploy index.ts
39
+ ```
12
40
 
13
- Install the following tools:
41
+ 3. **Invoke your app:**
42
+ ```bash
43
+ kernel invoke my-app action-name --payload '{"key": "value"}'
44
+ ```
14
45
 
15
- - Go 1.22+ ( https://go.dev/doc/install )
16
- - [Goreleaser](https://goreleaser.com/install/)
17
- - [chglog](https://github.com/goreleaser/chglog)
46
+ ## Authentication
18
47
 
19
- Compile the CLI:
48
+ ### OAuth 2.0 (Recommended)
49
+
50
+ The easiest way to authenticate is using OAuth:
20
51
 
21
52
  ```bash
22
- make build # compiles the binary to ./bin/kernel
53
+ kernel login
23
54
  ```
24
55
 
25
- Run the CLI:
56
+ This opens your browser to complete the authentication flow. Your credentials are securely stored and automatically refreshed.
57
+
58
+ ### API Key
59
+
60
+ You can also authenticate using an API key:
26
61
 
27
62
  ```bash
28
- ./bin/kernel --help
63
+ export KERNEL_API_KEY=<YOUR_API_KEY>
29
64
  ```
30
65
 
31
- ## Development workflow
66
+ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
32
67
 
33
- Useful make targets:
68
+ ## Commands Reference
34
69
 
35
- - `make build` – compile the project to `./bin/kernel`
36
- - `make test` – execute unit tests
37
- - `make lint` – run the linter (requires `golangci-lint`)
38
- - `make changelog` – generate/update the `CHANGELOG.md` file using **chglog**
39
- - `make release` – create a release using **goreleaser** (builds archives, homebrew formula, etc. See below)
70
+ ### Global Flags
40
71
 
41
- ### Developing Against API Changes
72
+ - `--version`, `-v` - Print the CLI version
73
+ - `--no-color` - Disable color output
74
+ - `--log-level <level>` - Set log level (trace, debug, info, warn, error, fatal, print)
42
75
 
43
- A typical workflow we encounter is updating the API and integrating those changes into our CLI. The high level workflow is (update API) -> (update SDK) -> (update CLI). Detailed instructions below
76
+ ### Authentication
44
77
 
45
- 1. Get added to https://www.stainless.com/ organization
46
- 1. For the given SDK version switch to branch changes - see https://app.stainless.com/docs/guides/branches
47
- 1. Update `openapi.stainless.yml` with new endpoint paths, objects, etc
48
- 1. Note: https://github.com/stainless-sdks/kernel-config/blob/main/openapi.stainless.yml is the source of truth. You can pull older versions as necessary
49
- 1. Update `openapi.yml` with your changes
50
- 1. Iterate in the diagnostics view until all errors are fixed
51
- 1. Hit `Save & build branch`
52
- 1. This will then create a branch in https://github.com/stainless-sdks/kernel-go
53
- 1. Using either your branch name or a specific commit hash you want to point to, run this script to modify the CLI's `go.mod`:
78
+ - `kernel login [--force]` - Login via OAuth 2.0
79
+ - `kernel logout` - Clear stored credentials
80
+ - `kernel auth` - Check authentication status
54
81
 
55
- ```
56
- ./scripts/go-mod-replace-kernel.sh <commit | branch name>
57
- ```
82
+ ### App Management
83
+
84
+ - `kernel deploy <file>` - Deploy an app to Kernel
85
+ - `--version <version>` - Specify app version (default: latest)
86
+ - `--force` - Allow overwriting existing version
87
+ - `--env <KEY=VALUE>`, `-e` - Set environment variables (can be used multiple times)
88
+ - `--env-file <file>` - Load environment variables from file (can be used multiple times)
89
+
90
+ - `kernel invoke <app> <action>` - Run an app action
91
+ - `--version <version>`, `-v` - Specify app version (default: latest)
92
+ - `--payload <json>`, `-p` - JSON payload for the action
93
+ - `--sync`, `-s` - Invoke synchronously (timeout after 60s)
94
+
95
+ - `kernel app list` - List deployed apps
96
+ - `--name <app_name>` - Filter by app name
97
+ - `--version <version>` - Filter by version
98
+
99
+ - `kernel app history <app_name>` - Show deployment history for an app
100
+
101
+ ### Logs
58
102
 
59
- ### Releasing a new version
103
+ - `kernel logs <app_name>` - View app logs
104
+ - `--version <version>` - Specify app version (default: latest)
105
+ - `--follow`, `-f` - Follow logs in real-time
106
+ - `--since <time>`, `-s` - How far back to retrieve logs (e.g., 5m, 1h)
107
+ - `--with-timestamps` - Include timestamps in log output
60
108
 
61
- Prerequisites:
109
+ ### Browser Management
62
110
 
63
- - Make sure you have `goreleaser` _pro_ installed via `brew install --cask goreleaser/tap/goreleaser-pro`. You will need a license key (in 1pw), and then `export GORELEASER_KEY=<the key>`.
111
+ - `kernel browsers list` - List running browsers
112
+ - `kernel browsers delete` - Delete a browser
113
+ - `--by-persistent-id <id>` - Delete by persistent ID
114
+ - `--by-id <id>` - Delete by session ID
115
+ - `--yes`, `-y` - Skip confirmation prompt
116
+ - `kernel browsers view` - Get live view URL for a browser
117
+ - `--by-persistent-id <id>` - View by persistent ID
118
+ - `--by-id <id>` - View by session ID
64
119
 
65
- - Grab the NPM token for our org (in 1pw) and run `npm config set '//registry.npmjs.org/:_authToken'=<the token>`
120
+ ## Examples
66
121
 
67
- - export a `GITHUB_TOKEN` with repo and write:packages permissions: https://github.com/settings/tokens/new?scopes=repo,write:packages.
122
+ ### Deploy with environment variables
68
123
 
69
- - Make sure you are logged in to the prod AWS account with `aws sso login --sso-session=kernel` + `export AWS_PROFILE=kernel-prod`. This is necessary to publish releases to S3.
124
+ ```bash
125
+ # Set individual variables
126
+ kernel deploy index.ts --env API_KEY=abc123 --env DEBUG=true
127
+
128
+ # Load from .env file
129
+ kernel deploy index.ts --env-file .env
130
+
131
+ # Combine both methods
132
+ kernel deploy index.ts --env-file .env --env OVERRIDE_VAR=value
133
+ ```
70
134
 
71
- With a clean tree on the branch you want to release (can be main or a pr branch you're about to merge, doesn't matter), run:
135
+ ### Invoke with payload
72
136
 
73
137
  ```bash
74
- make release-dry-run
138
+ # Simple invoke
139
+ kernel invoke my-scraper scrape-page
140
+
141
+ # With JSON payload
142
+ kernel invoke my-scraper scrape-page --payload '{"url": "https://example.com"}'
143
+
144
+ # Synchronous invoke (wait for completion)
145
+ kernel invoke my-scraper quick-task --sync
75
146
  ```
76
147
 
77
- This will check that everything is working, but not actually release anything.
78
- You should see one error about there not being a git tag, and that's fine.
148
+ ### Follow logs in real-time
79
149
 
80
- To actually release, run:
150
+ ```bash
151
+ # Follow logs
152
+ kernel logs my-app --follow
153
+
154
+ # Show recent logs with timestamps
155
+ kernel logs my-app --since 1h --with-timestamps
156
+ ```
157
+
158
+ ### Browser management
81
159
 
82
160
  ```bash
83
- # use `git tag -l | grep cli` to find the latest version and what you want to bump it to
84
- export VERSION=0.1.1
85
- git tag -a cli/v$VERSION -m "Bugfixes"
86
- git push origin cli/v$VERSION
87
- make release
161
+ # List all browsers
162
+ kernel browsers list
163
+
164
+ # Delete a persistent browser
165
+ kernel browsers delete --by-persistent-id my-browser-session --yes
166
+
167
+ # Get live view URL
168
+ kernel browsers view --by-id browser123
88
169
  ```
170
+
171
+ ## Getting Help
172
+
173
+ - `kernel --help` - Show all available commands
174
+ - `kernel <command> --help` - Get help for a specific command
175
+
176
+ ## Documentation
177
+
178
+ For complete documentation, visit:
179
+
180
+ - [📖 Documentation](https://docs.onkernel.com)
181
+ - [🚀 Quickstart Guide](https://docs.onkernel.com/quickstart)
182
+ - [📋 CLI Reference](https://docs.onkernel.com/reference/cli)
183
+
184
+ ## Support
185
+
186
+ - [Discord Community](https://discord.gg/kernel)
187
+ - [GitHub Issues](https://github.com/onkernel/kernel/issues)
188
+ - [Documentation](https://docs.onkernel.com)
189
+
190
+ ---
191
+
192
+ For development and contribution information, see [DEVELOPMENT.md](./DEVELOPMENT.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onkernel/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Kernel CLI",
5
5
  "scripts": {
6
6
  "postinstall": "node install.js",
@@ -33,75 +33,75 @@
33
33
  },
34
34
  "archives": {
35
35
  "darwin-arm64": {
36
- "name": "kernel_0.4.0_darwin_arm64.tar.gz",
37
- "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.0/kernel_0.4.0_darwin_arm64.tar.gz",
36
+ "name": "kernel_0.4.2_darwin_arm64.tar.gz",
37
+ "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.2/kernel_0.4.2_darwin_arm64.tar.gz",
38
38
  "bins": [
39
39
  "kernel"
40
40
  ],
41
41
  "format": "tar.gz",
42
42
  "checksum": {
43
43
  "algorithm": "sha256",
44
- "digest": "ddab5014bf3a1ab913ec0f4067b45f0b5639cf11f7dd0bd3f97f9a097f6cc895"
44
+ "digest": "6c0e0ab6502f35db66fd6629802ba9e0e85b2e200e391b9db40e54ea317fe97a"
45
45
  }
46
46
  },
47
47
  "darwin-x64": {
48
- "name": "kernel_0.4.0_darwin_amd64.tar.gz",
49
- "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.0/kernel_0.4.0_darwin_amd64.tar.gz",
48
+ "name": "kernel_0.4.2_darwin_amd64.tar.gz",
49
+ "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.2/kernel_0.4.2_darwin_amd64.tar.gz",
50
50
  "bins": [
51
51
  "kernel"
52
52
  ],
53
53
  "format": "tar.gz",
54
54
  "checksum": {
55
55
  "algorithm": "sha256",
56
- "digest": "102540e5367fb4b1f1ca2a8ab58cdc0fab2349b47d6abb2dbb3ca7e58afd6ec1"
56
+ "digest": "b0f9cd02e99cf2c96da9b0887bcfd1cb415c2fef7b4c315a732743ed30eb68da"
57
57
  }
58
58
  },
59
59
  "linux-arm64": {
60
- "name": "kernel_0.4.0_linux_arm64.tar.gz",
61
- "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.0/kernel_0.4.0_linux_arm64.tar.gz",
60
+ "name": "kernel_0.4.2_linux_arm64.tar.gz",
61
+ "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.2/kernel_0.4.2_linux_arm64.tar.gz",
62
62
  "bins": [
63
63
  "kernel"
64
64
  ],
65
65
  "format": "tar.gz",
66
66
  "checksum": {
67
67
  "algorithm": "sha256",
68
- "digest": "35022fa180cee8d5c13f6b19193e69eae30ea991d8381f95cddfa4a35caa2a60"
68
+ "digest": "965650f03d7a1ee816201dcb1e7b993306ad305307deec826ae62db0a9ba799d"
69
69
  }
70
70
  },
71
71
  "linux-x64": {
72
- "name": "kernel_0.4.0_linux_amd64.tar.gz",
73
- "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.0/kernel_0.4.0_linux_amd64.tar.gz",
72
+ "name": "kernel_0.4.2_linux_amd64.tar.gz",
73
+ "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.2/kernel_0.4.2_linux_amd64.tar.gz",
74
74
  "bins": [
75
75
  "kernel"
76
76
  ],
77
77
  "format": "tar.gz",
78
78
  "checksum": {
79
79
  "algorithm": "sha256",
80
- "digest": "761cde4f95268da34433fd334ac01f78ad3e8576749f85ca3d1a20c75e7cc12c"
80
+ "digest": "af369823ed5ed3fce14019211937dd8d82df56f7d28d7a5431e34ef2c1005f11"
81
81
  }
82
82
  },
83
83
  "win32-arm64": {
84
- "name": "kernel_0.4.0_windows_arm64.tar.gz",
85
- "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.0/kernel_0.4.0_windows_arm64.tar.gz",
84
+ "name": "kernel_0.4.2_windows_arm64.tar.gz",
85
+ "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.2/kernel_0.4.2_windows_arm64.tar.gz",
86
86
  "bins": [
87
87
  "kernel.exe"
88
88
  ],
89
89
  "format": "tar.gz",
90
90
  "checksum": {
91
91
  "algorithm": "sha256",
92
- "digest": "af6d9666282a2a6dc5ed5d5925ee7c9610cac89ee27d6cd934fbdb618f51f2f6"
92
+ "digest": "fea78c89cb6d424c5cae1cba88d83080b4fe7d6590616deba97dce0dabad5a6e"
93
93
  }
94
94
  },
95
95
  "win32-x64": {
96
- "name": "kernel_0.4.0_windows_amd64.tar.gz",
97
- "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.0/kernel_0.4.0_windows_amd64.tar.gz",
96
+ "name": "kernel_0.4.2_windows_amd64.tar.gz",
97
+ "url": "https://onkernel-public.s3.us-east-1.amazonaws.com/releases/download/cli/0.4.2/kernel_0.4.2_windows_amd64.tar.gz",
98
98
  "bins": [
99
99
  "kernel.exe"
100
100
  ],
101
101
  "format": "tar.gz",
102
102
  "checksum": {
103
103
  "algorithm": "sha256",
104
- "digest": "d00b1bc4a903980d8c39e1d907ac7c9db6ec225b5f9d8b340bfadceb092b8197"
104
+ "digest": "03538c87634310c52b3374aef1c74fb94df00810a008e85a128f1aa24a6776f1"
105
105
  }
106
106
  }
107
107
  }