Skip to content

Conversation

@rgarcia
Copy link
Contributor

@rgarcia rgarcia commented Jan 7, 2026

Summary

  • Add new Claude Agent SDK templates for both TypeScript and Python that demonstrate browser automation using the Claude Agent SDK with Kernel's Playwright execution API
  • Update all documentation URLs from onkernel.com to kernel.sh (new domain)
  • Remove outdated kernel logs -f instructions since kernel invoke now streams logs automatically

New Templates

TypeScript (pkg/templates/typescript/claude-agent-sdk/)

  • Uses @anthropic-ai/claude-agent-sdk with @onkernel/sdk
  • Creates a Kernel browser session and exposes Playwright execution as an MCP tool
  • Supports both local execution (pnpm exec tsx index.ts "task") and Kernel deployment

Python (pkg/templates/python/claude-agent-sdk/)

  • Uses claude-agent-sdk with kernel Python SDK
  • Same functionality as TypeScript version
  • Supports both local execution (uv run main.py "task") and Kernel deployment

Other Changes

  • Domain migration: Updated all onkernel.com, www.onkernel.com, dashboard.onkernel.com, docs.onkernel.com references to use kernel.sh
  • Email update: Changed [email protected] to [email protected]
  • Removed outdated instructions: Removed kernel logs <app> -f comments from all templates since logs now stream automatically with kernel invoke

Test Plan

  • Test TypeScript template locally: pnpm exec tsx index.ts "Go to news.ycombinator.com and get top 3 stories"
  • Test Python template locally: uv run main.py "Go to news.ycombinator.com and get top 3 stories"
  • Deploy and invoke TypeScript template via Kernel CLI
  • Deploy and invoke Python template via Kernel CLI
  • Verify all documentation links resolve correctly to kernel.sh

Note

Introduces Claude Agent SDK samples and aligns repo/docs with the new Kernel domain.

  • Adds claude-agent-sdk templates for both TypeScript and Python, including MCP tool to execute Playwright against Kernel browsers, local run scripts, and Kernel deploy/invoke actions
  • Updates README.md, template READMEs, and code comments to replace onkernel.com with kernel.sh; removes outdated kernel logs -f notes since kernel invoke streams logs
  • Extends QA guide with new create/deploy/invoke steps for ts-claude-agent-sdk and py-claude-agent-sdk; increases app count in test matrix
  • Updates Go module path and imports from github.com/onkernel/cli to github.com/kernel/cli; adjusts goreleaser org/URLs and author email
  • Enhances template registry (pkg/create/templates.go) to include the new template, entry points, env requirements, and invoke commands

Written by Cursor Bugbot for commit 67aed22. This will update automatically on new commits. Configure here.

Adds a new TypeScript template that integrates the Claude Agent SDK
with Kernel's browser automation capabilities. The template:

- Creates a Kernel browser and exposes Playwright execution via MCP
- Allows Claude to autonomously browse the web to complete tasks
- Supports both local CLI execution and Kernel app deployment
- Auto-installs Claude Code on Kernel VMs during invocation
- Uses allowedTools for permission-free headless operation
Ports the TypeScript Claude Agent SDK template to Python. The template:

- Uses ClaudeSDKClient for browser automation with MCP tools
- Creates a Kernel browser and exposes Playwright execution via MCP
- Supports both local CLI execution (uv run main.py) and Kernel deployment
- Auto-installs Claude Code on Kernel VMs during invocation
- Uses claude-agent-sdk and kernel Python packages

The template follows the same conventions as other Python templates
in the repo, including pyproject.toml, uv for dependency management,
and dual execution mode (local vs Kernel app).
Updates the README.md to document the new claude-agent-sdk template:
- Added to the templates list in the --template flag description
- Added example usage in the "Create a new app" examples section
Updates all website and documentation URLs to use the new domain:
- onkernel.com -> www.kernel.sh
- dashboard.onkernel.com -> dashboard.kernel.sh
- docs.onkernel.com -> www.kernel.sh/docs

Note: API/infrastructure URLs (api.onkernel.com, auth.onkernel.com,
mcp.onkernel.com) are unchanged as they may require separate migration.
- Change [email protected] to [email protected] in .goreleaser.yaml
- Remove outdated "kernel logs -f" instructions from templates since
  kernel invoke now streams logs automatically
- Update comments referencing manual log watching
os.environ["PATH"] = f"{homedir}/.local/bin:{current_path}"
print("Added ~/.local/bin to PATH")

print("Claude Code installed successfully")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing return code check for installation command

Medium Severity

The install_claude_code function runs subprocess.run without check=True and never validates result.returncode. If the Claude Code installation command fails (network error, script failure, etc.), the function ignores the failure, prints "Claude Code installed successfully", and returns normally. The agent then fails later with a confusing error when it tries to use Claude Code that wasn't actually installed. The TypeScript version correctly throws on non-zero exit codes via execAsync.

Fix in Cursor Fix in Web

@rgarcia rgarcia requested a review from dprevoznik January 7, 2026 22:29
rgarcia and others added 5 commits January 7, 2026 14:29
- Update go.mod module path to github.com/kernel/cli
- Update all Go import paths
- Update GitHub release API URL
- Update npm package install commands
- Update .goreleaser.yaml repository references
Include ts-claude-agent-sdk and py-claude-agent-sdk in all sections
of the QA testing workflow. Updates template count from 13 to 15.
Copy link
Contributor

@dprevoznik dprevoznik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - added one commit @rgarcia to add the new templates to the /qa command file. Once this is live, I can update the docs.

@rgarcia rgarcia merged commit 54e5e2a into main Jan 8, 2026
2 checks passed
@rgarcia rgarcia deleted the raf/kernel-772-claude-agents-sdk-template branch January 8, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants