Kernel CLI
The Kernel CLI provides command-line access to Kernel's cloud browser platform for browser automation, serverless app deployment, and infrastructure management.
Installation
- Homebrew:
brew install kernel/tap/kernel
- npm:
npm install -g @onkernel/cli
Verify with kernel --version. Use kernel <command> --help as the source of truth for the installed version.
Authentication
- Preferred: Set
KERNEL_API_KEY environment variable
- Fallback: Run
kernel login for interactive OAuth
Quick Start
# Authenticate
export KERNEL_API_KEY=your_api_key
# Create a browser session
kernel browsers create -o json
# Run Playwright automation (use `return` to get a value back)
kernel browsers playwright execute <session_id> '
await page.goto("https://example.com");
return await page.evaluate(() => document.title);
'
# Take a screenshot
kernel browsers computer screenshot <session_id> --to screenshot.png
# Cleanup
kernel browsers delete <session_id>
Safe Operation
- Prefer
-o json plus jq for scripts; deploy and invoke emit JSONL rather than one JSON object.
- Use
--project <id-or-name> or KERNEL_PROJECT when an API key can access multiple projects.
- Keep confirmation prompts for destructive operations unless non-interactive execution is intentional.
- Delete created browser sessions and pools after testing. Never echo, log, commit, or share API keys, credentials, or proxy passwords.
Project, API Key, and Organization Administration
# Rename, archive, or reactivate a project (provide at least one update)
kernel projects update <id-or-name> --name <new-name> -o json
kernel projects update <id-or-name> --status archived -o json
kernel projects update <id-or-name> --status active -o json
# Look up a soft-deleted API key
kernel api-keys get <id> --include-deleted -o json
# Inspect limits before changing the default project cap
kernel org limits get -o json
kernel org limits set --default-project-max-concurrent-sessions <n> -o json
For org limits set, 0 removes the default cap; the value cannot exceed the organization concurrency limit.
Rotate an API key interactively with kernel api-keys rotate <id>. Use --days-to-expire <1-3650> to set the replacement key lifetime and --expire-in-days <n> to set the old key's grace period (default 7 days; 0 revokes it immediately). The output contains the replacement plaintext key once: keep it out of logs, migrate callers during the grace period, and then verify the old key no longer works.
References
- Browser Management - Create, list, view, and delete browser sessions
- App Deployment - Deploy TypeScript/Python apps and invoke actions
- Computer Controls - OS-level mouse, keyboard, and screenshot capabilities
- Process Execution - Execute and manage processes in browser VMs
- Profiles - Manage persistent browser profiles
- Managed Auth - Auth connections, login sessions, credential providers, auto re-authentication
- Proxies - Create and manage datacenter, ISP, residential, and mobile proxies
- Browser Pools - Manage pre-warmed browser pools
- Extensions - Upload and manage Chrome extensions
- Replays - Record and download video replays
- Filesystem Operations - Read, write, upload, and download files
1---
2name: kernel-cli
3description: Use the Kernel CLI to manage cloud browsers, apps, profiles, proxies, managed auth, API keys, projects, and organization limits. Use when installing or authenticating the CLI, looking up current command syntax, or choosing the right command group.
4metadata:
5 source: https://skillmd.com/skills/kernel/kernel-cli
6---
7
8# Kernel CLI
9
10The Kernel CLI provides command-line access to Kernel's cloud browser platform for browser automation, serverless app deployment, and infrastructure management.
11
12## Installation
13
14- Homebrew: `brew install kernel/tap/kernel`
15- npm: `npm install -g @onkernel/cli`
16
17Verify with `kernel --version`. Use `kernel <command> --help` as the source of truth for the installed version.
18
19## Authentication
20
21- **Preferred:** Set `KERNEL_API_KEY` environment variable
22- **Fallback:** Run `kernel login` for interactive OAuth
23
24## Quick Start
25
26```bash
27# Authenticate
28export KERNEL_API_KEY=your_api_key
29
30# Create a browser session
31kernel browsers create -o json
32
33# Run Playwright automation (use `return` to get a value back)
34kernel browsers playwright execute <session_id> '
35 await page.goto("https://example.com");
36 return await page.evaluate(() => document.title);
37'
38
39# Take a screenshot
40kernel browsers computer screenshot <session_id> --to screenshot.png
41
42# Cleanup
43kernel browsers delete <session_id>
44```
45
46## Safe Operation
47
48- Prefer `-o json` plus `jq` for scripts; deploy and invoke emit JSONL rather than one JSON object.
49- Use `--project <id-or-name>` or `KERNEL_PROJECT` when an API key can access multiple projects.
50- Keep confirmation prompts for destructive operations unless non-interactive execution is intentional.
51- Delete created browser sessions and pools after testing. Never echo, log, commit, or share API keys, credentials, or proxy passwords.
52
53## Project, API Key, and Organization Administration
54
55```bash
56# Rename, archive, or reactivate a project (provide at least one update)
57kernel projects update <id-or-name> --name <new-name> -o json
58kernel projects update <id-or-name> --status archived -o json
59kernel projects update <id-or-name> --status active -o json
60
61# Look up a soft-deleted API key
62kernel api-keys get <id> --include-deleted -o json
63
64# Inspect limits before changing the default project cap
65kernel org limits get -o json
66kernel org limits set --default-project-max-concurrent-sessions <n> -o json
67```
68
69For `org limits set`, `0` removes the default cap; the value cannot exceed the organization concurrency limit.
70
71Rotate an API key interactively with `kernel api-keys rotate <id>`. Use `--days-to-expire <1-3650>` to set the replacement key lifetime and `--expire-in-days <n>` to set the old key's grace period (default 7 days; `0` revokes it immediately). The output contains the replacement plaintext key once: keep it out of logs, migrate callers during the grace period, and then verify the old key no longer works.
72
73## References
74
75- [Browser Management](./references/browser-management.md) - Create, list, view, and delete browser sessions
76- [App Deployment](./references/app-deployment.md) - Deploy TypeScript/Python apps and invoke actions
77- [Computer Controls](./references/computer-controls.md) - OS-level mouse, keyboard, and screenshot capabilities
78- [Process Execution](./references/process-execution.md) - Execute and manage processes in browser VMs
79- [Profiles](./references/profiles.md) - Manage persistent browser profiles
80- [Managed Auth](./references/managed-auth.md) - Auth connections, login sessions, credential providers, auto re-authentication
81- [Proxies](./references/proxies.md) - Create and manage datacenter, ISP, residential, and mobile proxies
82- [Browser Pools](./references/browser-pools.md) - Manage pre-warmed browser pools
83- [Extensions](./references/extensions.md) - Upload and manage Chrome extensions
84- [Replays](./references/replays.md) - Record and download video replays
85- [Filesystem Operations](./references/filesystem-ops.md) - Read, write, upload, and download files