Skip to content

Commit e8a3c05

Browse files
committed
env and login
1 parent bbe6c23 commit e8a3c05

File tree

8 files changed

+35
-25
lines changed

8 files changed

+35
-25
lines changed

README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a href="https://x.com/rfgarcia"><img src="https://img.shields.io/twitter/follow/rfgarcia" alt="Follow @rfgarcia"></a>
88
</p>
99

10-
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.
10+
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.
1111

1212
## Features
1313

@@ -52,30 +52,36 @@ create-kernel-app [app-name] [options]
5252
### Examples
5353

5454
Create a TypeScript application with a sample app:
55+
5556
```bash
5657
npx @onkernel/create-kernel-app my-app --language typescript --template sample-app
5758
```
5859

5960
Create a Typescript application with Stagehand template:
61+
6062
```bash
6163
npx @onkernel/create-kernel-app my-app --language typescript --template stagehand
6264
```
6365

6466
Create a Typescript application with Computer Use template:
67+
6568
```bash
6669
npx @onkernel/create-kernel-app my-app --language typescript --template computer-use
6770
```
6871

6972
Create a Python application with a sample app:
73+
7074
```bash
7175
npx @onkernel/create-kernel-app my-app --language python --template sample-app
7276
```
7377

7478
Create a Python application with Browser Use template:
79+
7580
```bash
7681
npx @onkernel/create-kernel-app my-app --language python --template browser-use
7782
```
78-
```
83+
84+
````
7985
8086
## Next Steps
8187
@@ -84,18 +90,21 @@ After creating your application:
8490
1. Navigate to your project directory:
8591
```bash
8692
cd my-app
87-
```
93+
````
8894

8995
2. Set up your environment:
96+
9097
- For TypeScript: `npm install`
9198
- For Python: `uv venv && source .venv/bin/activate && uv sync`
9299

93100
3. Set your Kernel API key:
101+
94102
```bash
95-
export KERNEL_API_KEY=<YOUR_API_KEY>
103+
kernel login # or: export KERNEL_API_KEY=<YOUR_API_KEY>
96104
```
97105

98106
4. Deploy your application:
107+
99108
```bash
100109
# Typscript
101110
kernel deploy index.ts # --env OPENAI_API_KEY=XXX if Stagehand; --env ANTHROPIC_API_KEY=XXX if Computer Use
@@ -107,6 +116,7 @@ kernel deploy main.py # --env OPENAI_API_KEY=XXX if Browser Use
107116
If deploying an app that requires environment variables, make sure to [set them](https://docs.onkernel.com/launch/deploy#environment-variables) when you `deploy`.
108117

109118
5. Invoke your application:
119+
110120
```bash
111121
# Typescript + Sample App
112122
kernel invoke ts-basic get-page-title --payload '{"url": "https://www.google.com"}'
@@ -134,18 +144,19 @@ kernel invoke python-cua cua-task --payload '{"task": "Get current market price
134144

135145
These are the sample apps currently available when you run `npx @onkernel/create-kernel-app`:
136146

137-
| Template | Description | Framework | Query Parameters |
138-
|----------|-------------|-----------|------------------|
139-
| **sample-app** | Returns the page title of a specified URL | Playwright | `{ url }` |
140-
| **browser-use** | Completes a specified task | Browser Use | `{ task }` |
141-
| **stagehand** | Returns the first result of a specified Google search | Stagehand | `{ query }` |
142-
| **advanced-sample** | Implements sample apps using advanced Kernel configs | n/a |
143-
| **computer-use** | Implements a prompt loop | Anthropic Computer Use API | `{ query }` |
144-
| **cua** | Implements the OpenAI Computer Using Agent (CUA) | OpenAI CUA | `{ task }` |
147+
| Template | Description | Framework | Query Parameters |
148+
| ------------------- | ----------------------------------------------------- | -------------------------- | ---------------- |
149+
| **sample-app** | Returns the page title of a specified URL | Playwright | `{ url }` |
150+
| **browser-use** | Completes a specified task | Browser Use | `{ task }` |
151+
| **stagehand** | Returns the first result of a specified Google search | Stagehand | `{ query }` |
152+
| **advanced-sample** | Implements sample apps using advanced Kernel configs | n/a |
153+
| **computer-use** | Implements a prompt loop | Anthropic Computer Use API | `{ query }` |
154+
| **cua** | Implements the OpenAI Computer Using Agent (CUA) | OpenAI CUA | `{ task }` |
145155

146156
## Documentation
147157

148158
For more information about Kernel and its features, visit:
159+
149160
- [Kernel Documentation](https://docs.onkernel.com/quickstart)
150161
- [Kernel Homepage](https://onkernel.com)
151162

@@ -156,4 +167,3 @@ Contributions are welcome! Please feel free to submit a pull request. See [Contr
156167
## License
157168

158169
MIT © [Kernel](https://onkernel.com)
159-

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,11 @@ function printNextSteps(
379379
Next steps:
380380
brew install onkernel/tap/kernel
381381
cd ${appName}
382-
kernel login
382+
kernel login # or: export KERNEL_API_KEY=<YOUR_API_KEY>
383383
${deployCommand}
384384
${INVOKE_SAMPLES[language][template]}
385385
# Do this in a separate tab
386-
kernel login
386+
kernel login # or: export KERNEL_API_KEY=<YOUR_API_KEY>
387387
kernel logs ${REGISTERED_APP_NAMES[language][template]} --follow
388388
`)
389389
);

templates/python/advanced-sample/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
None
1616
1717
Invoke this via CLI:
18-
kernel login
18+
kernel login # or: export KERNEL_API_KEY=<your_api_key>
1919
kernel deploy main.py # If you haven't already deployed this app
2020
kernel invoke py-advanced test_captcha_solver
2121
kernel logs py-advanced -f # Open in separate tab
@@ -36,7 +36,7 @@ async def test_captcha_solver(ctx: kernel.KernelContext) -> None:
3636
page = context.pages[0] if context.pages else await context.new_page()
3737

3838
# Access the live view. Retrieve this live_view_url from the Kernel logs in your CLI:
39-
# kernel login
39+
# kernel login # or: export KERNEL_API_KEY=<Your API key>
4040
# kernel logs py-advanced --follow
4141
print("Kernel browser live view url: ", kernel_browser.browser_live_view_url)
4242

templates/python/cua/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Returns:
1616
An answer to the task, elapsed time and optionally the messages stack
1717
Invoke this via CLI:
18-
kernel login
18+
kernel login # or: export KERNEL_API_KEY=<your_api_key>
1919
kernel deploy main.py -e OPENAI_API_KEY=XXXXX --force
2020
kernel invoke python-cua cua-task -p '{"task":"go to https://news.ycombinator.com and list top 5 articles"}'
2121
kernel logs python-cua -f # Open in separate tab

templates/python/sample-app/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Returns:
1818
A dictionary containing the page title
1919
Invoke this via CLI:
20-
kernel login
20+
kernel login # or: export KERNEL_API_KEY=<your_api_key>
2121
kernel deploy main.py # If you haven't already deployed this app
2222
kernel invoke python-basic get-page-title -p '{"url": "https://www.google.com"}'
2323
kernel logs python-basic -f # Open in separate tab
@@ -74,7 +74,7 @@ async def get_page_title(ctx: kernel.KernelContext, input_data: PageTitleInput)
7474
Returns:
7575
A dictionary containing the browser live view url
7676
Invoke this via CLI:
77-
kernel login
77+
kernel login # or: export KERNEL_API_KEY=<your_api_key>
7878
kernel deploy main.py # If you haven't already deployed this app
7979
kernel invoke python-basic create-persisted-browser
8080
kernel logs python-basic -f # Open in separate tab

templates/typescript/advanced-sample/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const app = kernel.app("ts-advanced");
1515
* None
1616
*
1717
* Invoke this via CLI:
18-
* kernel login
18+
* kernel login # or: export KERNEL_API_KEY=<your_api_key>
1919
* kernel deploy index.ts # If you haven't already deployed this app
2020
* kernel invoke ts-advanced test-captcha-solver
2121
* kernel logs ts-advanced -f # Open in separate tab
@@ -31,7 +31,7 @@ app.action("test-captcha-solver", async (ctx: KernelContext): Promise<void> => {
3131
const browser = await chromium.connectOverCDP(kernelBrowser.cdp_ws_url);
3232

3333
// Access the live view. Retrieve this live_view_url from the Kernel logs in your CLI:
34-
// kernel login
34+
// kernel login # or: export KERNEL_API_KEY=<Your API key>
3535
// kernel logs ts-advanced --follow
3636
console.log(
3737
"Kernel browser live view url: ",

templates/typescript/cua/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (!process.env.OPENAI_API_KEY) {
2828
* Returns:
2929
* An answer to the task, elapsed time and optionally the messages stack
3030
* Invoke this via CLI:
31-
* kernel login
31+
* kernel login # or: export KERNEL_API_KEY=<your_api_key>
3232
* kernel deploy index.ts -e OPENAI_API_KEY=XXXXX --force
3333
* kernel invoke ts-cua cua-task -p "{\"task\":\"current market price range for a used dreamcast\"}"
3434
* kernel logs ts-cua -f # Open in separate tab

templates/typescript/sample-app/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const app = kernel.app("ts-basic");
1313
* Returns:
1414
* A dictionary containing the page title
1515
* Invoke this via CLI:
16-
* kernel login
16+
* kernel login # or: export KERNEL_API_KEY=<your_api_key>
1717
* kernel deploy index.ts # If you haven't already deployed this app
1818
* kernel invoke ts-basic get-page-title -p '{"url": "https://www.google.com"}'
1919
* kernel logs ts-basic -f # Open in separate tab
@@ -85,7 +85,7 @@ app.action<PageTitleInput, PageTitleOutput>(
8585
* Returns:
8686
* A dictionary containing the browser live view url
8787
* Invoke this via CLI:
88-
* kernel login
88+
* kernel login # or: export KERNEL_API_KEY=<your_api_key>
8989
* kernel deploy index.ts # If you haven't already deployed this app
9090
* kernel invoke ts-basic create-persisted-browser
9191
* kernel logs ts-basic -f # Open in separate tab

0 commit comments

Comments
 (0)