0.1.18 • Published 10 months ago

@onkernel/create-kernel-app v0.1.18

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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)
    • advanced-sample: Implements sample apps using advanced Kernel configs
    • computer-use: Implements a prompt loop using Anthropic Computer Use

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 Typescript application with Computer Use template:

npx @onkernel/create-kernel-app my-app --language typescript --template computer-use

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:
```bash
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; --env ANTHROPIC_API_KEY=XXX if Computer Use

# 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"}'

# Typescript + Computer Use
kernel invoke ts-cu cu-task --payload '{"query": "Search for the top 3 restaurants in NYC according to Pete Wells"}'

# 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:

TemplateDescriptionFrameworkQuery Parameters
sample-appReturns the page title of a specified URLPlaywright{ url }
browser-useCompletes a specified taskBrowser Use{ task }
stagehandReturns the first result of a specified Google searchStagehand{ query }
advanced-sampleImplements sample apps using advanced Kernel configsn/a
computer-useImplements a prompt loopAnthropic Computer Use API{ 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

0.1.18

10 months ago

0.1.17

10 months ago

0.1.16

10 months ago

0.1.15

11 months ago

0.1.14

11 months ago

0.1.13

11 months ago

0.1.12

11 months ago

0.1.11

11 months ago

0.1.10

11 months ago

0.1.9

11 months ago

0.1.8

11 months ago

0.1.6

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago