Learn how to use Kai Browser and build extensions
Kai Browser is a Python-based browser where you can create custom extensions using natural language. Describe what you want, and AI builds it for you.
Note: Kai Browser is currently available for Linux only.
./kai-browser to startCreate browser extensions by describing what you want in plain English. No coding experience required.
Tip: You can refine your extension. Ask it to "make the button blue" or "add a keyboard shortcut" after generation.
The AI builder requires an API key from one of these providers:
Add your key in Extension Builder → Settings. Keys are stored securely using your system's keyring.
Enable "Auto-fix errors" to have the AI automatically attempt to fix loading errors. It will retry up to 3 times.
Kai supports two patterns: Natural Pattern (simpler, for AI-generated code) and Legacy Pattern (more features, for complex extensions).
Create a class with __init__ and activate methods:
Extend KaiModule for state persistence and helper methods:
Available methods when using the Legacy Pattern (KaiModule):
| Method | Description |
|---|---|
add_button(text, on_click) | Add toolbar button |
add_menu_button(text, items, on_select) | Add dropdown menu |
add_input(placeholder, on_enter) | Add text input |
show_message(text, title, icon) | Show message dialog |
ask_text(prompt, default) | Ask for text input |
ask_yes_no(question) | Ask yes/no question |
| Property/Method | Description |
|---|---|
self.browser_core | Main browser instance |
self.browser_core.browser | Active tab's web view |
self.browser_core.get_current_url() | Get current URL |
self.browser_core.inject_javascript(script) | Execute JS on page |
self.browser_core.show_status(msg, timeout) | Show status message |
| Method | Description |
|---|---|
on_page_load(callback) | Called when page loads |
on_url_change(callback) | Called when URL changes |
set_interval(callback, seconds) | Run repeatedly |
run_in_background(callback, on_complete) | Background thread |
| Method | Description |
|---|---|
get_preference(key, default) | Get saved value |
set_preference(key, value) | Save value |
Share your extensions and discover community creations.
.py file in your modules/ folder and restart kai browser or copy and paste the code into the code editor and click add extension (no restart is needed).py fileNote: The marketplace is in early development. Review extension code before installing from untrusted sources.
activate methodmy_extensionImportError, install the missing package at system level and restartKai stores data in ~/.kai_browser/:
preferences.json – Settings and extension statesprofile/ – Cookies and browsing datacache/ – Cached contentTo reset, delete the ~/.kai_browser/ folder.
Check GitHub Issues or open a new issue for support.