Add local Chrome profile import to the Kernel CLI - #223
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 41073c6. Configure here.
| } | ||
| const chromeEpochMicros = int64(11_644_473_600_000_000) | ||
| cutoff := since.UnixMicro() + chromeEpochMicros | ||
| query := fmt.Sprintf(`SELECT u.url, COUNT(*) AS visits, MAX(v.visit_time) AS last_visit FROM visits v JOIN urls u ON u.id = v.url WHERE v.visit_time >= %d AND (u.url LIKE 'http://%%' OR u.url LIKE 'https://%%') GROUP BY u.url ORDER BY visits DESC, last_visit DESC LIMIT 10000`, cutoff) |
There was a problem hiding this comment.
Site ranking misses heavy domains
Medium Severity
RecentSites applies LIMIT 10000 to per-URL visit rows before aggregating by registrable domain. Domains whose traffic is spread across many lower-traffic URLs can be undercounted or dropped, so the default “most-used” site list can omit sites the user actually uses most.
Reviewed by Cursor Bugbot for commit 41073c6. Configure here.
Move the macOS Chrome and Helium happy path into the existing Kernel CLI. Rank websites from the last 30 days, let users choose five to ten domains, decrypt only their cookies, and upload a minimal bundle through the durable browser-import API. Reuse CLI authentication and keep the command non-interactive when explicit flags are supplied.
41073c6 to
59b7587
Compare


why
The browser-import backend stack currently assumes a separate local helper and dashboard handoff. Kernel already ships a cross-platform CLI with authentication, project selection, upgrades, prompts, and release distribution. Putting the local import entry point there removes a second installer and makes the happy path one command.
This PR intentionally supports only the current main path: Google Chrome and Helium on macOS, importing cookies for five to ten recently used websites into one Kernel profile.
what
kernel profiles import-localhow
The command reads Chrome's local History and Cookies SQLite databases through the system sqlite3 client. It groups history by registrable domain, filters cookies locally, and encodes only selected cookie records into the server's existing tar.zst bundle contract.
The released Go SDK does not yet expose the browser-import endpoints, so this PR includes a narrow authenticated HTTP client for those four endpoints. Managed Auth and credential creation remain on the existing generated SDK and are intentionally deferred to the next stacked PR.
scope
Included:
Not included:
verification
Before: the Kernel CLI had no local browser import command. Browser import required the dashboard and standalone helper path.
After:
make buildpassesmake testpasses, includinggo vet ./...andgo test ./...This is the first PR in the CLI browser-import stack. The next PR adds selected Bitwarden/1Password credentials, Managed Auth activation, and optional agent-skill installation.
Note
High Risk
Reads and decrypts browser cookies from local Chromium databases and Keychain, then uploads session material to the API. Auth token handling is also refactored for a custom HTTP client.
Overview
Adds
kernel profiles import-localso macOS users can pull cookies from local Google Chrome or Helium into a Kernel profile without a separate helper.The command discovers profiles, ranks recent sites from History, decrypts only selected-site cookies via Keychain, and uploads a tar.zst cookie bundle through the browser-import API.
import-statuspolls that job. Interactive site/profile prompts are skippable with--sites/--yes.Also extracts
auth.BearerTokenfor endpoints not in the released SDK, and adds a narrow HTTP client that rejects untrusted API URLs and does not follow redirects.Reviewed by Cursor Bugbot for commit 39d3c5b. Bugbot is set up for automated code reviews on this repo. Configure here.