A CLI tool to create the scaffolding for a new Kernel applications. This tool helps you get started with building browser automation applications using Kernel's platform.
- 🚀 Quick project scaffolding for Kernel applications
- 🔄 Support for multiple programming languages:
- TypeScript
- Python
- 📦 Multiple template options:
- Sample App: A basic template that extracts page titles using Playwright
- Browser Use: A template implementing the Browser Use SDK
- Stagehand: A template implementing the Stagehand SDK
- ⚡️ Automatic dependency setup
- 🫶 Interactive CLI
npx @onkernel/create-kernel-app
Create a new Kernel application by running:
create-kernel-app [app-name] [options]
-
-l, --language <language>
: Choose your programming language- TypeScript:
typescript
orts
- Python:
python
orpy
- TypeScript:
-
-t, --template <template>
: Select a template-
sample-app
: Basic template with Playwright integration -
browser-use
: Template with Browser Use SDK (Python only) -
stagehand
: Template with Stagehand SDK (Typescript only)
-
Create a TypeScript application with a sample app:
npx @onkernel/create-kernel-app my-app --language typescript --template sample-app
Create a Typescript application with Stagehand template:
npx @onkernel/create-kernel-app my-app --language typescript --template stagehand
Create a Python application with a sample app:
npx @onkernel/create-kernel-app my-app --language python --template sample-app
Create a Python application with Browser Use template:
npx @onkernel/create-kernel-app my-app --language python --template browser-use
After creating your application:
- Navigate to your project directory:
cd my-app
- Set up your environment:
- For TypeScript:
npm install
- For Python:
uv venv && source .venv/bin/activate && uv sync
- Set your Kernel API key:
export KERNEL_API_KEY=<YOUR_API_KEY>
- Deploy your application:
# Typscript
kernel deploy index.ts # --env OPENAI_API_KEY=XXX if Stagehand
# Python
kernel deploy main.py # --env OPENAI_API_KEY=XXX if Browser Use
If deploying an app that requires environment variables, make sure to set them when you deploy
.
- Invoke your application:
# Typescript + Sample App
kernel invoke ts-basic get-page-title --payload '{"url": "https://www.google.com"}'
# Typescript + Stagehand
kernel invoke ts-stagehand stagehand-task --payload '{"query": "Best wired earbuds"}'
# Python + Sample App
kernel invoke python-basic get-page-title --payload '{"url": "https://www.google.com"}'
# Python + Browser Use
kernel invoke python-bu bu-task --payload '{"task": "Compare the price of gpt-4o and DeepSeek-V3"}'
These are the sample apps currently available when you run npx @onkernel/create-kernel-app
:
Template | Description | Framework | Query Parameters |
---|---|---|---|
sample-app | Returns the page title of a specified URL | Playwright | { url } |
browser-use | Completes a specified task | Browser Use | { task } |
stagehand | Returns the first result of a specified Google search | Stagehand | { query } |
For more information about Kernel and its features, visit:
Contributions are welcome! Please feel free to submit a pull request. See Contributing and Code of Conduct
MIT © Kernel