Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Create an API key from the [Kernel dashboard](https://dashboard.onkernel.com).
- `-p, --persistence-id <id>` - Unique identifier for browser session persistence
- `-s, --stealth` - Launch browser in stealth mode to avoid detection
- `-H, --headless` - Launch browser without GUI access
- `--kiosk` - Launch browser in kiosk mode
- `kernel browsers delete <id or persistent id>` - Delete a browser
- `-y, --yes` - Skip confirmation prompt
- `kernel browsers view <id or persistent id>` - Get live view URL for a browser
Expand Down Expand Up @@ -306,6 +307,9 @@ kernel browsers create --persistence-id my-browser-session
# Create a headless browser in stealth mode
kernel browsers create --headless --stealth

# Create a browser in kiosk mode
kernel browsers create --kiosk

# Delete a persistent browser
kernel browsers delete --by-persistent-id my-browser-session --yes

Expand Down
7 changes: 7 additions & 0 deletions cmd/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ type BrowsersCreateInput struct {
TimeoutSeconds int
Stealth BoolFlag
Headless BoolFlag
Kiosk BoolFlag
ProfileID string
ProfileName string
ProfileSaveChanges BoolFlag
Expand Down Expand Up @@ -241,6 +242,9 @@ func (b BrowsersCmd) Create(ctx context.Context, in BrowsersCreateInput) error {
if in.Headless.Set {
params.Headless = kernel.Opt(in.Headless.Value)
}
if in.Kiosk.Set {
params.KioskMode = kernel.Opt(in.Kiosk.Value)
}

// Validate profile selection: at most one of profile-id or profile-name must be provided
if in.ProfileID != "" && in.ProfileName != "" {
Expand Down Expand Up @@ -1541,6 +1545,7 @@ func init() {
browsersCreateCmd.Flags().StringP("persistent-id", "p", "", "Unique identifier for browser session persistence")
browsersCreateCmd.Flags().BoolP("stealth", "s", false, "Launch browser in stealth mode to avoid detection")
browsersCreateCmd.Flags().BoolP("headless", "H", false, "Launch browser without GUI access")
browsersCreateCmd.Flags().Bool("kiosk", false, "Launch browser in kiosk mode")
browsersCreateCmd.Flags().IntP("timeout", "t", 60, "Timeout in seconds for the browser session")
browsersCreateCmd.Flags().String("profile-id", "", "Profile ID to load into the browser session (mutually exclusive with --profile-name)")
browsersCreateCmd.Flags().String("profile-name", "", "Profile name to load into the browser session (mutually exclusive with --profile-id)")
Expand Down Expand Up @@ -1571,6 +1576,7 @@ func runBrowsersCreate(cmd *cobra.Command, args []string) error {
persistenceID, _ := cmd.Flags().GetString("persistent-id")
stealthVal, _ := cmd.Flags().GetBool("stealth")
headlessVal, _ := cmd.Flags().GetBool("headless")
kioskVal, _ := cmd.Flags().GetBool("kiosk")
timeout, _ := cmd.Flags().GetInt("timeout")
profileID, _ := cmd.Flags().GetString("profile-id")
profileName, _ := cmd.Flags().GetString("profile-name")
Expand Down Expand Up @@ -1602,6 +1608,7 @@ func runBrowsersCreate(cmd *cobra.Command, args []string) error {
TimeoutSeconds: timeout,
Stealth: BoolFlag{Set: cmd.Flags().Changed("stealth"), Value: stealthVal},
Headless: BoolFlag{Set: cmd.Flags().Changed("headless"), Value: headlessVal},
Kiosk: BoolFlag{Set: cmd.Flags().Changed("kiosk"), Value: kioskVal},
ProfileID: profileID,
ProfileName: profileName,
ProfileSaveChanges: BoolFlag{Set: cmd.Flags().Changed("save-changes"), Value: saveChanges},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/charmbracelet/fang v0.2.0
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/joho/godotenv v1.5.1
github.com/onkernel/kernel-go-sdk v0.14.2-0.20251013154713-58a9d56ff62f
github.com/onkernel/kernel-go-sdk v0.14.2
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/pterm/pterm v0.12.80
github.com/samber/lo v1.51.0
Expand Down
7 changes: 2 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ github.com/muesli/mango-pflag v0.1.0 h1:UADqbYgpUyRoBja3g6LUL+3LErjpsOwaC9ywvBWe
github.com/muesli/mango-pflag v0.1.0/go.mod h1:YEQomTxaCUp8PrbhFh10UfbhbQrM/xJ4i2PB8VTLLW0=
github.com/muesli/roff v0.1.0 h1:YD0lalCotmYuF5HhZliKWlIx7IEhiXeSfq7hNjFqGF8=
github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig=
github.com/onkernel/kernel-go-sdk v0.14.1 h1:r4drk5uM1phiXl0dZXhnH1zz5iTmApPC0cGSSiNKbVk=
github.com/onkernel/kernel-go-sdk v0.14.1/go.mod h1:MjUR92i8UPqjrmneyVykae6GuB3GGSmnQtnjf1v74Dc=
github.com/onkernel/kernel-go-sdk v0.14.2-0.20251013154713-58a9d56ff62f h1:/cXzVNPxWryqNsIo2Kvc5fYLBlk7CHus3JZIv1JVoU4=
github.com/onkernel/kernel-go-sdk v0.14.2-0.20251013154713-58a9d56ff62f/go.mod h1:MjUR92i8UPqjrmneyVykae6GuB3GGSmnQtnjf1v74Dc=
github.com/onkernel/kernel-go-sdk v0.14.2 h1:femYawCgMHCeRDlFlhGxOM3KuBUvrZhaGOfWxdn2YUY=
github.com/onkernel/kernel-go-sdk v0.14.2/go.mod h1:MjUR92i8UPqjrmneyVykae6GuB3GGSmnQtnjf1v74Dc=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down Expand Up @@ -131,7 +129,6 @@ github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM=
github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
Expand Down