You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
login, logout, auth commands - oauth vs api key auth (#16)
* login, logout, auth commands - oauth vs api key auth
* removed --verbose for log-level logs
* Update quickstart guide to clarify Kernel account setup and authentication
* updated outdated commands table (this will be overhauled in the near future, but is ok for now)
To get started, sign up for a Kernel account and create an API key [here](https://dashboard.onkernel.com/sign-up). Then follow our [quickstart guide](/quickstart) to launch your first web agent or browser automation.
5
+
## Authentication Methods
6
+
7
+
Kernel supports two authentication methods:
8
+
9
+
### OAuth 2.0 (Recommended for CLI)
10
+
11
+
The preferred authentication method to use the CLI is OAuth 2.0, which provides secure browser-based authentication with automatic token refresh:
12
+
13
+
```bash
14
+
kernel login
15
+
```
16
+
17
+
This method stores your credentials securely in your system keychain and handles token refresh automatically.
18
+
19
+
### API Keys
20
+
21
+
API keys are an alternative authentication method, particularly useful for programmatic access, CI/CD pipelines, or when OAuth is not suitable:
22
+
23
+
```bash
24
+
export KERNEL_API_KEY=<YOUR_API_KEY>
25
+
```
26
+
27
+
## Creating API Keys
28
+
29
+
To create an API key:
30
+
31
+
1. Sign up for a Kernel account [here](https://dashboard.onkernel.com/sign-up)
32
+
2. Navigate to your dashboard settings
33
+
3. Generate a new API key
34
+
4. Store it securely and use it in your environment
35
+
36
+
## Getting Started
37
+
38
+
Once you have your authentication set up, follow our [quickstart guide](/quickstart) to launch your first web agent or browser automation.
6
39
7
40
You can find information about pricing on our [website](https://www.onkernel.com/#pricing).
Copy file name to clipboardExpand all lines: reference/cli.mdx
+71-12Lines changed: 71 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,31 @@ Install the Kernel CLI using your favorite package manager:
13
13
brew install onkernel/tap/kernel
14
14
15
15
# Using pnpm
16
-
pnpm install -g onkernel/cli
16
+
pnpm install -g @onkernel/cli
17
17
18
18
# Using npm
19
-
npm install -g onkernel/cli
19
+
npm install -g @onkernel/cli
20
20
```
21
21
22
-
Then, set your Kernel API key for deployments
22
+
## Authentication
23
+
24
+
The Kernel CLI supports two authentication methods:
25
+
26
+
### OAuth 2.0 (Recommended)
27
+
28
+
The preferred method is OAuth 2.0 with PKCE, which provides secure browser-based authentication:
29
+
30
+
```bash
31
+
# Login via browser
32
+
kernel login
33
+
```
34
+
35
+
This opens your browser to complete the OAuth flow. Your tokens are securely stored in your system keychain (macOS/Windows) or a local file (Linux).
36
+
37
+
### API Key
38
+
39
+
You can also authenticate using an API key:
40
+
23
41
```bash
24
42
export KERNEL_API_KEY=<API_KEY>
25
43
```
@@ -31,20 +49,61 @@ After installation, verify that Kernel CLI was installed correctly:
31
49
which kernel
32
50
```
33
51
34
-
## Commands
52
+
## Global Flags
53
+
54
+
| Flag | Description |
55
+
|------|-------------|
56
+
|`--version`, `-v`| Print the CLI version |
57
+
|`--no-color`| Disable color output |
58
+
|`--log-level <level>`| Set the log level (trace, debug, info, warn, error, fatal, print) |
59
+
60
+
## Authentication Commands
61
+
62
+
| Command | Description |
63
+
|---------|-------------|
64
+
|`kernel login [--force]`| Initiates OAuth 2.0 authentication flow via browser. Use `--force` to re-authenticate when already logged in |
65
+
|`kernel logout`| Clears stored authentication tokens and logs out |
66
+
|`kernel auth`| Displays current authentication status, user details, and token expiry. Use `--log-level debug` for detailed information including user ID and storage method |
67
+
68
+
## App Management Commands
35
69
36
70
| Command | Optional Flags | Description |
37
71
|---------|-------------| -------------|
38
72
|`kernel deploy <entrypoint_file_name>`| - | Deploys an app to Kernel from the current directory. |
39
-
||`--env <ENV_VAR=VAL>`| Adds environment variables to the app. Expects the form `ENV_VAR=VAL` delimited by spaces. Optional. |
73
+
||`--version <version>`| Specify a version for the app (default: latest). Optional. |
74
+
||`--force`| Allow overwrite of an existing version with the same name. Optional. |
75
+
||`--env <ENV_VAR=VAL>`, `-e`| Adds environment variables to the app. Expects the form `ENV_VAR=VAL` delimited by spaces. May be specified multiple times. Optional. |
76
+
||`--env-file <file>`| Read environment variables from a file (.env format). May be specified multiple times. Optional. |
40
77
|`kernel invoke <app_name> <action_name>`| - | Invokes a specific app action by its name. Generates an Invocation. |
41
-
||`--payload <payload_data>`| Includes the specified parameters. Expects a stringified JSON object. Optional. |
78
+
||`--version <version>`, `-v`| Specify a version of the app to invoke (default: latest). Optional. |
79
+
||`--payload <payload_data>`, `-p`| Includes the specified parameters. Expects a stringified JSON object. Optional. |
80
+
||`--sync`, `-s`| Invoke synchronously (default false). A synchronous invocation opens a long-lived HTTP POST that times out after 60 seconds. Optional. |
42
81
||`ctrl-c`| Terminates the running invocation in your CLI. Also destroys any associated browsers. |
82
+
|`kernel app list`| - | List deployed application versions. |
83
+
||`--name <app_name>`| Filter by application name. Optional. |
84
+
||`--version <version>`| Filter by version label. Optional. |
85
+
|`kernel app history <app_name>`| - | Show deployment history for an application. |
43
86
|`kernel logs <app_name>`| - | Prints the logs for the specified app. |
44
-
||`--follow`| Follows the logs. Optional. |
45
-
||`--log-level <log_level>`| Specify the log level to print: trace, debug, info, warn, error, fatal, print. Optional. |
0 commit comments