Skip to content

Commit 658d786

Browse files
committed
qa command
1 parent df4689f commit 658d786

File tree

1 file changed

+225
-0
lines changed

1 file changed

+225
-0
lines changed

.cursor/commands/qa.md

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
# QA Testing for `kernel create`
2+
3+
This command runs QA testing for all `kernel create` template permutations.
4+
5+
## Overview
6+
7+
You will build the CLI, create all template variations, deploy them, and provide invoke commands for manual testing.
8+
9+
## Step 1: Build the CLI
10+
11+
```bash
12+
cd /Users/rafaelgarcia/code/onkernel/cli
13+
make build
14+
```
15+
16+
The built binary will be at `./bin/kernel`.
17+
18+
## Step 2: Create QA Directory
19+
20+
Create a timestamped QA directory:
21+
22+
```bash
23+
QA_DIR="./qa-$(date +%Y%m%d-%H%M%S)"
24+
mkdir -p "$QA_DIR"
25+
cd "$QA_DIR"
26+
```
27+
28+
## Step 3: Get KERNEL_API_KEY
29+
30+
**STOP and ask the human for their `KERNEL_API_KEY`.**
31+
32+
This is required for all deployments. Store it for use in deploy commands:
33+
34+
```bash
35+
export KERNEL_API_KEY="<value from human>"
36+
```
37+
38+
## Step 4: Create All Templates
39+
40+
Use the built CLI binary with non-interactive flags. The command format is:
41+
42+
```bash
43+
../bin/kernel create -n <name> -l <language> -t <template>
44+
```
45+
46+
### Template Matrix
47+
48+
Here are all valid language + template combinations:
49+
50+
| Language | Template | Folder Name | Needs Env File | Required Env Vars |
51+
|-------------|------------------|--------------------------|----------------|--------------------------------------|
52+
| typescript | sample-app | ts-sample-app | No | - |
53+
| typescript | captcha-solver | ts-captcha-solver | No | - |
54+
| typescript | stagehand | ts-stagehand | Yes | OPENAI_API_KEY |
55+
| typescript | computer-use | ts-computer-use | Yes | ANTHROPIC_API_KEY |
56+
| typescript | magnitude | ts-magnitude | Yes | ANTHROPIC_API_KEY |
57+
| typescript | cua | ts-cua | Yes | OPENAI_API_KEY |
58+
| typescript | gemini-cua | ts-gemini-cua | Yes | GOOGLE_API_KEY, OPENAI_API_KEY |
59+
| python | sample-app | py-sample-app | No | - |
60+
| python | captcha-solver | py-captcha-solver | No | - |
61+
| python | browser-use | py-browser-use | Yes | OPENAI_API_KEY |
62+
| python | computer-use | py-computer-use | Yes | ANTHROPIC_API_KEY |
63+
| python | cua | py-cua | Yes | OPENAI_API_KEY |
64+
65+
### Create Commands
66+
67+
Run each of these (they are non-interactive when all flags are provided):
68+
69+
```bash
70+
# TypeScript templates
71+
../bin/kernel create -n ts-sample-app -l typescript -t sample-app
72+
../bin/kernel create -n ts-captcha-solver -l typescript -t captcha-solver
73+
../bin/kernel create -n ts-stagehand -l typescript -t stagehand
74+
../bin/kernel create -n ts-computer-use -l typescript -t computer-use
75+
../bin/kernel create -n ts-magnitude -l typescript -t magnitude
76+
../bin/kernel create -n ts-cua -l typescript -t cua
77+
../bin/kernel create -n ts-gemini-cua -l typescript -t gemini-cua
78+
79+
# Python templates
80+
../bin/kernel create -n py-sample-app -l python -t sample-app
81+
../bin/kernel create -n py-captcha-solver -l python -t captcha-solver
82+
../bin/kernel create -n py-browser-use -l python -t browser-use
83+
../bin/kernel create -n py-computer-use -l python -t computer-use
84+
../bin/kernel create -n py-cua -l python -t cua
85+
```
86+
87+
## Step 5: Deploy Each Template
88+
89+
For each template directory, you need to:
90+
91+
1. `cd` into the directory
92+
2. If `NeedsEnvFile` is true, **STOP and ask the human** for the required API keys
93+
3. Create a `.env` file with those values
94+
4. Run the deploy command
95+
96+
### Deploy Commands by Template
97+
98+
#### Templates WITHOUT env files (deploy directly):
99+
100+
```bash
101+
# ts-sample-app
102+
cd ts-sample-app && ../bin/kernel deploy index.ts && cd ..
103+
104+
# ts-captcha-solver
105+
cd ts-captcha-solver && ../bin/kernel deploy index.ts && cd ..
106+
107+
# py-sample-app
108+
cd py-sample-app && ../bin/kernel deploy main.py && cd ..
109+
110+
# py-captcha-solver
111+
cd py-captcha-solver && ../bin/kernel deploy main.py && cd ..
112+
```
113+
114+
#### Templates WITH env files (prompt human first):
115+
116+
For each of these, **STOP and ask the human** for the required API key(s), then create the `.env` file and deploy:
117+
118+
**ts-stagehand** (needs OPENAI_API_KEY):
119+
```bash
120+
cd ts-stagehand
121+
echo "OPENAI_API_KEY=<value from human>" > .env
122+
../bin/kernel deploy index.ts --env-file .env
123+
cd ..
124+
```
125+
126+
**ts-computer-use** (needs ANTHROPIC_API_KEY):
127+
```bash
128+
cd ts-computer-use
129+
echo "ANTHROPIC_API_KEY=<value from human>" > .env
130+
../bin/kernel deploy index.ts --env-file .env
131+
cd ..
132+
```
133+
134+
**ts-magnitude** (needs ANTHROPIC_API_KEY):
135+
```bash
136+
cd ts-magnitude
137+
echo "ANTHROPIC_API_KEY=<value from human>" > .env
138+
../bin/kernel deploy index.ts --env-file .env
139+
cd ..
140+
```
141+
142+
**ts-cua** (needs OPENAI_API_KEY):
143+
```bash
144+
cd ts-cua
145+
echo "OPENAI_API_KEY=<value from human>" > .env
146+
../bin/kernel deploy index.ts --env-file .env
147+
cd ..
148+
```
149+
150+
**ts-gemini-cua** (needs GOOGLE_API_KEY and OPENAI_API_KEY):
151+
```bash
152+
cd ts-gemini-cua
153+
cat > .env << EOF
154+
GOOGLE_API_KEY=<value from human>
155+
OPENAI_API_KEY=<value from human>
156+
EOF
157+
../bin/kernel deploy index.ts --env-file .env
158+
cd ..
159+
```
160+
161+
**py-browser-use** (needs OPENAI_API_KEY):
162+
```bash
163+
cd py-browser-use
164+
echo "OPENAI_API_KEY=<value from human>" > .env
165+
../bin/kernel deploy main.py --env-file .env
166+
cd ..
167+
```
168+
169+
**py-computer-use** (needs ANTHROPIC_API_KEY):
170+
```bash
171+
cd py-computer-use
172+
echo "ANTHROPIC_API_KEY=<value from human>" > .env
173+
../bin/kernel deploy main.py --env-file .env
174+
cd ..
175+
```
176+
177+
**py-cua** (needs OPENAI_API_KEY):
178+
```bash
179+
cd py-cua
180+
echo "OPENAI_API_KEY=<value from human>" > .env
181+
../bin/kernel deploy main.py --env-file .env
182+
cd ..
183+
```
184+
185+
## Step 6: Provide Invoke Commands
186+
187+
Once all deployments are complete, present the human with these invoke commands to test manually:
188+
189+
```bash
190+
# TypeScript apps
191+
kernel invoke ts-basic get-page-title --payload '{"url": "https://www.google.com"}'
192+
kernel invoke ts-captcha-solver test-captcha-solver
193+
kernel invoke ts-stagehand teamsize-task --payload '{"company": "Kernel"}'
194+
kernel invoke ts-cu cu-task --payload '{"query": "Return the first url of a search result for NYC restaurant reviews Pete Wells"}'
195+
kernel invoke ts-magnitude mag-url-extract --payload '{"url": "https://en.wikipedia.org/wiki/Special:Random"}'
196+
kernel invoke ts-cua cua-task --payload '{"task": "Go to https://news.ycombinator.com and get the top 5 articles"}'
197+
kernel invoke ts-gemini-cua gemini-cua-task
198+
199+
# Python apps
200+
kernel invoke python-basic get-page-title --payload '{"url": "https://www.google.com"}'
201+
kernel invoke python-captcha-solver test-captcha-solver
202+
kernel invoke python-bu bu-task --payload '{"task": "Compare the price of gpt-4o and DeepSeek-V3"}'
203+
kernel invoke python-cu cu-task --payload '{"query": "Return the first url of a search result for NYC restaurant reviews Pete Wells"}'
204+
kernel invoke python-cua cua-task --payload '{"task": "Go to https://news.ycombinator.com and get the top 5 articles"}'
205+
```
206+
207+
## Summary Checklist
208+
209+
- [ ] Built CLI with `make build`
210+
- [ ] Created QA directory
211+
- [ ] Got KERNEL_API_KEY from human
212+
- [ ] Created all 12 template variations
213+
- [ ] Got required API keys from human (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY)
214+
- [ ] Deployed all 12 apps
215+
- [ ] Provided invoke commands to human for manual testing
216+
217+
## Cleanup
218+
219+
After QA is complete, the human can remove the QA directory:
220+
221+
```bash
222+
cd ..
223+
rm -rf "$QA_DIR"
224+
```
225+

0 commit comments

Comments
 (0)