The Kernel CLI helps you access and manage your Kernel resources.

Installation

Install the Kernel CLI using your favorite package manager:
# Using brew
brew install onkernel/tap/kernel

# Using pnpm
pnpm install -g @onkernel/cli

# Using npm
npm install -g @onkernel/cli

Authentication

The Kernel CLI supports two authentication methods: The preferred method is OAuth 2.0 with PKCE, which provides secure browser-based authentication:
kernel login
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).

API Key

You can also authenticate using an API key:
export KERNEL_API_KEY=<API_KEY>

Verifying installation

After installation, verify that Kernel CLI was installed correctly:
which kernel

Global Flags

FlagDescription
--version, -vPrint the CLI version
--no-colorDisable color output
--log-level <level>Set the log level (trace, debug, info, warn, error, fatal, print)

Authentication Commands

CommandDescription
kernel login [--force]Initiates OAuth 2.0 authentication flow via browser. Use --force to re-authenticate when already logged in
kernel logoutClears stored authentication tokens and logs out
kernel authDisplays current authentication status, user details, and token expiry. Use --log-level debug for detailed information including user ID and storage method

Browser Management Commands

CommandDescription
kernel browsers listList running or persistent browsers
kernel browsers createCreate a new browser session
--persistence-id <id>Unique identifier for browser session persistence. Optional.
--stealthLaunch browser in stealth mode to avoid detection. Optional.
--headlessLaunch browser without GUI access. Optional.
kernel browsers deleteDelete a browser. Must specify either --by-persistent-id or --by-id
--by-persistent-id <id>Delete browser by persistent ID
--by-id <id>Delete browser by session ID
--yes, -ySkip confirmation prompt
kernel browsers viewGet the live view URL for a browser. Must specify either --by-persistent-id or --by-id
--by-persistent-id <id>View browser by persistent ID
--by-id <id>View browser by session ID

App Management Commands

CommandOptional FlagsDescription
kernel deploy <entrypoint_file_name>-Deploys an app to Kernel from the current directory.
--version <version>Specify a version for the app (default: latest). Optional.
--forceAllow overwrite of an existing version with the same name. Optional.
--env <ENV_VAR=VAL>, -eAdds environment variables to the app. Expects the form ENV_VAR=VAL delimited by spaces. May be specified multiple times. Optional.
--env-file <file>Read environment variables from a file (.env format). May be specified multiple times. Optional.
kernel invoke <app_name> <action_name>-Invokes a specific app action by its name. Generates an Invocation.
--version <version>, -vSpecify a version of the app to invoke (default: latest). Optional.
--payload <payload_data>, -pIncludes the specified parameters. Expects a stringified JSON object. Optional.
--sync, -sInvoke synchronously (default false). A synchronous invocation opens a long-lived HTTP POST that times out after 60 seconds. Optional.
ctrl-cTerminates the running invocation in your CLI. Also destroys any associated browsers.
kernel app list-List deployed application versions.
--name <app_name>Filter by application name. Optional.
--version <version>Filter by version label. Optional.
kernel app history <app_name>-Show deployment history for an application.
kernel logs <app_name>-Prints the logs for the specified app.
--version <version>Specify a version of the app (default: latest). Optional.
--follow, -fFollow logs in real-time (stream continuously). Optional.
--since <time>, -sHow far back to retrieve logs (e.g., 5m, 1h). Defaults to 5m if not following, 5s if following. Optional.
--with-timestampsInclude timestamps in each log line. Optional.

General Commands

CommandDescription
kernel help [command]Displays help information about Kernel commands