@onkernel/create-kernel-app

0.1.12 • Public • Published

create-kernel-app

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.

Features

  • 🚀 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

Set-Up

npx @onkernel/create-kernel-app

Usage

Create a new Kernel application by running:

create-kernel-app [app-name] [options]

Options

  • -l, --language <language>: Choose your programming language
    • TypeScript: typescript or ts
    • Python: python or py
  • -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)

Examples

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

Next Steps

After creating your application:

  1. Navigate to your project directory:
cd my-app
  1. Set up your environment:
  • For TypeScript: npm install
  • For Python: uv venv && source .venv/bin/activate && uv sync
  1. Set your Kernel API key:
export KERNEL_API_KEY=<YOUR_API_KEY>
  1. 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.

  1. 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"}'

Sample apps reference

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 }

Documentation

For more information about Kernel and its features, visit:

Contributing

Contributions are welcome! Please feel free to submit a pull request. See Contributing and Code of Conduct

License

MIT © Kernel

Package Sidebar

Install

npm i @onkernel/create-kernel-app

Homepage

onkernel.com

Weekly Downloads

293

Version

0.1.12

License

MIT

Unpacked Size

1.88 MB

Total Files

32

Last publish

Collaborators

  • raf-kernel
  • cat-kernel