Skip to content

Commit 131c686

Browse files
authored
Mason/cli docs organization (#35)
* docs(mcp-server): rewrite and clarify setup guide * docs: Add MCP token reset to troubleshooting * docs: Enhance CLI documentation with new authentication, browser, and app management sections * docs(mcp-server): fix formatting for delete_browser command in browser automation section * docs(mcp-server): update setup instructions and wording * docs: wrap Claude info in Info block * docs(mcp-server): update Claude compatibility info
1 parent 27fdd58 commit 131c686

File tree

6 files changed

+434
-183
lines changed

6 files changed

+434
-183
lines changed

docs.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@
126126
"tab": "CLI",
127127
"icon": "terminal",
128128
"pages": [
129-
"reference/cli"
129+
"reference/cli",
130+
"reference/cli/auth",
131+
"reference/cli/browsers",
132+
"reference/cli/apps"
130133
]
131134
}
132135
]

reference/cli.mdx

Lines changed: 27 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ The Kernel CLI helps you access and manage your Kernel resources.
66

77
## Installation
88

9-
Install the Kernel CLI using your favorite package manager:
10-
119
```bash
1210
# Using brew
1311
brew install onkernel/tap/kernel
@@ -19,94 +17,44 @@ pnpm install -g @onkernel/cli
1917
npm install -g @onkernel/cli
2018
```
2119

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:
20+
Verify installation:
2921

3022
```bash
31-
kernel login
23+
which kernel
24+
kernel --version
3225
```
3326

34-
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).
35-
36-
### API Key
27+
<Columns cols={2}>
28+
<Card icon="key" title="Authentication" href="/reference/cli/auth">
29+
Login, logout, and check auth status.
30+
</Card>
31+
<Card icon="browsers" title="Browsers" href="/reference/cli/browsers">
32+
Create, view, and manage Kernel browsers.
33+
</Card>
34+
<Card icon="rocket" title="Apps" href="/reference/cli/apps">
35+
Deploy apps, invoke actions, and stream logs.
36+
</Card>
37+
</Columns>
3738

38-
You can also authenticate using an API key:
39+
## Quick Start
3940

4041
```bash
41-
export KERNEL_API_KEY=<API_KEY>
42-
```
42+
# 1) Login
43+
kernel login
4344

44-
## Verifying installation
45-
After installation, verify that Kernel CLI was installed correctly:
45+
# 2) Deploy your app
46+
kernel deploy index.ts
4647

47-
```bash
48-
which kernel
48+
# 3) Invoke your app
49+
kernel invoke my-app action-name --payload '{"key":"value"}'
4950
```
5051

5152
## Global Flags
5253

53-
| Flag | Description |
54-
|------|-------------|
55-
| `--version`, `-v` | Print the CLI version |
56-
| `--no-color` | Disable color output |
57-
| `--log-level <level>` | Set the log level (trace, debug, info, warn, error, fatal, print) |
58-
59-
## Authentication Commands
60-
61-
| Command | Description |
62-
|---------|-------------|
63-
| `kernel login [--force]` | Initiates OAuth 2.0 authentication flow via browser. Use `--force` to re-authenticate when already logged in |
64-
| `kernel logout` | Clears stored authentication tokens and logs out |
65-
| `kernel auth` | Displays current authentication status, user details, and token expiry. Use `--log-level debug` for detailed information including user ID and storage method |
66-
67-
## Browser Management Commands
68-
69-
| Command | Description |
70-
|---------|-------------|
71-
| `kernel browsers list` | List running or persistent browsers |
72-
| `kernel browsers create` | Create a new browser session |
73-
| | `--persistence-id <id>` | Unique identifier for browser session persistence. Optional. |
74-
| | `--stealth` | Launch browser in stealth mode to avoid detection. Optional. |
75-
| | `--headless` | Launch browser without GUI access. Optional. |
76-
| `kernel browsers delete` | Delete a browser. Must specify either `--by-persistent-id` or `--by-id` |
77-
| | `--by-persistent-id <id>` | Delete browser by persistent ID |
78-
| | `--by-id <id>` | Delete browser by session ID |
79-
| | `--yes`, `-y` | Skip confirmation prompt |
80-
| `kernel browsers view` | Get the live view URL for a browser. Must specify either `--by-persistent-id` or `--by-id` |
81-
| | `--by-persistent-id <id>` | View browser by persistent ID |
82-
| | `--by-id <id>` | View browser by session ID |
83-
84-
## App Management Commands
85-
86-
| Command | Optional Flags | Description |
87-
|---------|-------------| -------------|
88-
| `kernel deploy <entrypoint_file_name>` | - | Deploys an app to Kernel from the current directory. |
89-
| | `--version <version>` | Specify a version for the app (default: latest). Optional. |
90-
| | `--force` | Allow overwrite of an existing version with the same name. Optional. |
91-
| | `--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. |
92-
| | `--env-file <file>` | Read environment variables from a file (.env format). May be specified multiple times. Optional. |
93-
| `kernel invoke <app_name> <action_name>` | - | Invokes a specific app action by its name. Generates an Invocation. |
94-
| | `--version <version>`, `-v` | Specify a version of the app to invoke (default: latest). Optional. |
95-
| | `--payload <payload_data>`, `-p` | Includes the specified parameters. Expects a stringified JSON object. Optional. |
96-
| | `--sync`, `-s` | Invoke synchronously (default false). A synchronous invocation opens a long-lived HTTP POST that times out after 60 seconds. Optional. |
97-
| | `ctrl-c` | Terminates the running invocation in your CLI. Also destroys any associated browsers. |
98-
| `kernel app list` | - | List deployed application versions. |
99-
| | `--name <app_name>` | Filter by application name. Optional. |
100-
| | `--version <version>` | Filter by version label. Optional. |
101-
| `kernel app history <app_name>` | - | Show deployment history for an application. |
102-
| `kernel logs <app_name>` | - | Prints the logs for the specified app. |
103-
| | `--version <version>` | Specify a version of the app (default: latest). Optional. |
104-
| | `--follow`, `-f` | Follow logs in real-time (stream continuously). Optional. |
105-
| | `--since <time>`, `-s` | How far back to retrieve logs (e.g., 5m, 1h). Defaults to 5m if not following, 5s if following. Optional. |
106-
| | `--with-timestamps` | Include timestamps in each log line. Optional. |
107-
108-
## General Commands
54+
- `--version`, `-v` - Print the CLI version
55+
- `--no-color` - Disable color output
56+
- `--log-level <level>` - Set the log level (trace, debug, info, warn, error, fatal, print)
10957

110-
| Command | Description |
111-
|---------|-------------|
112-
| `kernel help [command]` | Displays help information about Kernel commands |
58+
<Info>
59+
Looking for the API? See the [API Reference](/api-reference/invocations/invoke-an-action).
60+
</Info>

reference/cli/apps.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: "Apps"
3+
---
4+
5+
## `kernel deploy <entrypoint_file_name>`
6+
Deploy an app to Kernel from the current directory.
7+
8+
| Flag | Description |
9+
|------|-------------|
10+
| `--version <version>` | Specify a version for the app (default: latest). Optional. |
11+
| `--force` | Allow overwrite of an existing version with the same name. Optional. |
12+
| `--env <ENV_VAR=VAL>`, `-e` | Adds environment variables to the app. May be specified multiple times. Optional. |
13+
| `--env-file <file>` | Read environment variables from a .env file. May be specified multiple times. Optional. |
14+
15+
## `kernel invoke <app_name> <action_name>`
16+
Invoke a specific app action by its name. Generates an Invocation.
17+
18+
| Flag | Description |
19+
|------|-------------|
20+
| `--version <version>`, `-v` | Specify a version of the app to invoke (default: latest). Optional. |
21+
| `--payload <payload_data>`, `-p` | Stringified JSON object (max 64 KB). Optional. |
22+
| `--sync`, `-s` | Invoke synchronously (default false). Optional. |
23+
24+
<Info>Synchronous invocations open a long-lived HTTP POST that times out after 60 seconds. Press `ctrl-c` to terminate a running invocation; associated browsers are destroyed.</Info>
25+
26+
## `kernel app list`
27+
List deployed application versions.
28+
29+
| Flag | Description |
30+
|------|-------------|
31+
| `--name <app_name>` | Filter by application name. Optional. |
32+
| `--version <version>` | Filter by version label. Optional. |
33+
34+
## `kernel app history <app_name>`
35+
Show deployment history for an application.
36+
37+
## `kernel logs <app_name>`
38+
Print the logs for the specified app.
39+
40+
| Flag | Description |
41+
|------|-------------|
42+
| `--version <version>` | Specify a version of the app (default: latest). Optional. |
43+
| `--follow`, `-f` | Follow logs in real-time (stream continuously). Optional. |
44+
| `--since <time>`, `-s` | How far back to retrieve logs (e.g., 5m, 1h). Defaults to 5m if not following, 5s if following. Optional. |
45+
| `--with-timestamps` | Include timestamps in each log line. Optional. |

reference/cli/auth.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: "Authentication"
3+
---
4+
5+
## `kernel login`
6+
Login via OAuth 2.0 (PKCE) using your browser. Credentials are stored securely and refreshed automatically.
7+
8+
| Flag | Description |
9+
|------|-------------|
10+
| `--force` | Force re-authentication even if already logged in |
11+
12+
## `kernel logout`
13+
Clear stored authentication tokens and log out.
14+
15+
## `kernel auth`
16+
Show current authentication status and token expiry.
17+
18+
| Flag | Description |
19+
|------|-------------|
20+
| `--log-level debug` | Set the log level to debug for detailed info including user ID, org ID, and storage method. |

0 commit comments

Comments
 (0)