Skip to content

Commit 6016785

Browse files
CLI: Update Go SDK to 218107bfe6a52574986b3747eedf28753fe52abe and accept us-west region
- Bump kernel-go-sdk to 218107bfe6a52574986b3747eedf28753fe52abe - Add "us-west" to the client-side --region validation used by browsers create/list, browser-pools create/list, and auth connections create/update/login; update flag help and README Tested: browsers list --region us-west, browser-pools list --region us-west (both succeed); browsers create --region us-west reaches the API (rejected server-side with region_not_enabled for the test org, as expected); --region emea still rejected client-side; go test ./... passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9c858fe commit 6016785

7 files changed

Lines changed: 21 additions & 17 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,14 @@ kernel search contents srch_01jsearchresult --limit 3 --content-source browser
259259

260260
- `kernel browsers list` - List running browsers
261261
- `--query <q>` - Search by name, session ID, profile ID, proxy ID, or pool name
262-
- `--region us-east|eu-west|ap-southeast` - Filter by geographic region; omit to list sessions in all regions
262+
- `--region us-east|us-west|eu-west|ap-southeast` - Filter by geographic region; omit to list sessions in all regions
263263
- `--tag <KEY=VALUE>` - Filter by tag, repeatable; a session must match every pair
264264
- `--output json`, `-o json` - Output raw JSON array
265265
- `kernel browsers create` - Create a new browser session
266266
- `-s, --stealth` - Launch browser in stealth mode to avoid detection
267267
- `-H, --headless` - Launch browser without GUI access
268268
- `--kiosk` - Launch browser in kiosk mode
269-
- `--region us-east|eu-west|ap-southeast` - Geographic region for the session. Fixed once the session is created; requires a Start-Up or Enterprise plan and defaults to `us-east`.
269+
- `--region us-east|us-west|eu-west|ap-southeast` - Geographic region for the session. Fixed once the session is created; requires a Start-Up or Enterprise plan and defaults to `us-east`.
270270
- `--private-host <host>` - Destination the browser reaches directly through the session's own network instead of Kernel-managed egress, for private hosts on a VPN or tunnel the session joins (repeatable or comma-separated, max 32). Accepts hostname patterns (`*.example.ts.net`), IPs (`10.1.30.63`, `[fd00::1]`), and private CIDRs (`100.64.0.0/10`). Replaces the default private ranges (RFC1918, `100.64.0.0/10`, `fc00::/7`); omit to keep them. Fixed once the session is created. Unrelated to a proxy's `--bypass-host`, which only chooses between upstream proxy and Kernel-managed direct egress.
271271
- `--allowed-host <host>` - Egress allowlist: the only destinations the browser may reach through Kernel-managed egress (repeatable or comma-separated, max 100). Other destinations are refused with a 403 whose `X-Kernel-Proxy-Error` header is `network_policy_denied`. Accepts exact hostnames (`example.com`), a leading wildcard that matches subdomains but not the domain itself (`*.example.com`), public IPs (`8.8.8.8`, `[2001:4860:4860::8888]`), and public CIDRs (`8.8.4.0/24`); no ports, paths, or schemes. `--start-url` must be allowed. Omit for unfiltered egress. Requires proxy v3; not supported with pools. Create-only.
272272
- `--proxy-route '<host>[,<host>...]=<proxy>'` - Route matching browser requests through a selected proxy (repeatable, max 10 routes with 1–50 hosts each). Example: `--proxy-route 'api.ipify.org,*.ipify.org=name:my-dc-proxy'`. The proxy is an ID by default; use `id:<id>` or `name:<name>` explicitly. Exact hostnames beat wildcards; longer wildcard suffixes beat shorter ones. `*.example.com` matches subdomains, not `example.com`. Matching ignores case and ports. Unmatched hosts use `--proxy-*` or default egress, while `--start-url` uses the top-level proxy during setup. Routes are create-only and are not available on pool sessions.
@@ -787,7 +787,7 @@ exists.
787787
### Browser Pools
788788

789789
- `kernel browser-pools list` - List browser pools
790-
- `--region us-east|eu-west|ap-southeast` - Filter by geographic region; omit to list pools in all regions
790+
- `--region us-east|us-west|eu-west|ap-southeast` - Filter by geographic region; omit to list pools in all regions
791791
- `--output json`, `-o json` - Output raw JSON array
792792
- `kernel browser-pools create` - Create a browser pool
793793
- `--name <name>` - Optional unique name for the pool
@@ -1181,21 +1181,21 @@ Managed auth connections (`kernel auth connections`). The commands below are new
11811181
- `--per-page <n>` - Items per page (default: 20)
11821182
- `--output json`, `-o json` - Output raw JSON array
11831183
- `kernel auth connections create` - New flags:
1184-
- `--region us-east|eu-west|ap-southeast` - Region for this connection's login, reauth, and health-check browser sessions. Defaults to `us-east`.
1184+
- `--region us-east|us-west|eu-west|ap-southeast` - Region for this connection's login, reauth, and health-check browser sessions. Defaults to `us-east`.
11851185
- `--proxy-id <id>` / `--proxy-name <name>` / `--proxy-mode direct|default` - Proxy configuration for this connection's login, reauth, and health-check browser sessions (mutually exclusive). Omit to derive the default from stealth.
11861186
- `--stealth` - Whether those browser sessions run in stealth mode (default: true); use `--stealth=false` to disable
11871187
- `--telemetry=all` / `--telemetry=off` / `--telemetry=<categories>` - Default telemetry for this connection's browser sessions. Same semantics as `kernel browsers create`
11881188
- `--telemetry-export-otlp <id-or-name>` - Export this connection's captured telemetry over OTLP to one of the org's configured destinations. Implies `--telemetry=all` when `--telemetry` is not set. Use `=off` to disable export.
11891189
- `--telemetry-storage on|off` - Whether this connection's sessions persist captured telemetry to Kernel storage (default on). `off` requires `--telemetry-export-otlp <id-or-name>` in the same command.
11901190
- `kernel auth connections update <id>` - New flags:
1191-
- `--region us-east|eu-west|ap-southeast` - Update the region for browser sessions created after this command. Active sessions don't move.
1191+
- `--region us-east|us-west|eu-west|ap-southeast` - Update the region for browser sessions created after this command. Active sessions don't move.
11921192
- `--proxy-id <id>` / `--proxy-name <name>` / `--proxy-mode direct|default` - Proxy configuration for future browser sessions (mutually exclusive). Use `--proxy-mode=default` to drop a selected proxy rather than passing an empty value.
11931193
- `--stealth` - Set whether future browser sessions run in stealth mode; use `--stealth=false` to disable
11941194
- `--telemetry=all` / `--telemetry=off` / `--telemetry=<categories>` - Update telemetry for future browser sessions
11951195
- `--telemetry-export-otlp <id-or-name>` - Update where future sessions export captured telemetry. Naming a destination requires passing `--telemetry` in the same command, since the API validates capture and export together and enabling capture here would replace the connection's current category selection. Use `=off` to disable export.
11961196
- `--telemetry-storage on|off` - Update whether future sessions persist captured telemetry to Kernel storage. Requires `--telemetry` in the same command; `off` also requires an export destination.
11971197
- `kernel auth connections login <id>` - New flags:
1198-
- `--region us-east|eu-west|ap-southeast` - Region override for this login only. Omit it to inherit the connection region.
1198+
- `--region us-east|us-west|eu-west|ap-southeast` - Region override for this login only. Omit it to inherit the connection region.
11991199
- `--proxy-id <id>` / `--proxy-name <name>` / `--proxy-mode direct|default` - Proxy override for this login's browser session (mutually exclusive); omitted properties inherit the connection defaults
12001200
- `--stealth` - Stealth override for this login's browser session; use `--stealth=false` to disable
12011201
- `--telemetry=all` / `--telemetry=off` / `--telemetry=<categories>` - Telemetry override for this login only, merged onto the connection's config

‎cmd/auth_connections.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ func init() {
13631363
authConnectionsCreateCmd.Flags().String("proxy-id", "", "Proxy ID to use for this connection's browser sessions (mutually exclusive with --proxy-name and --proxy-mode)")
13641364
authConnectionsCreateCmd.Flags().String("proxy-name", "", "Proxy name to use for this connection's browser sessions (mutually exclusive with --proxy-id and --proxy-mode)")
13651365
authConnectionsCreateCmd.Flags().String("proxy-mode", "", "Proxy egress mode instead of a selected proxy: 'direct' for no proxy regardless of stealth, or 'default' for the stealth-derived default")
1366-
authConnectionsCreateCmd.Flags().String("region", "", "Geographic region for browser sessions: 'us-east', 'eu-west', or 'ap-southeast'. Defaults to us-east")
1366+
authConnectionsCreateCmd.Flags().String("region", "", "Geographic region for browser sessions: 'us-east', 'us-west', 'eu-west', or 'ap-southeast'. Defaults to us-east")
13671367
authConnectionsCreateCmd.Flags().Bool("stealth", true, "Run this connection's browser sessions in stealth mode; use --stealth=false to disable")
13681368
authConnectionsCreateCmd.Flags().Bool("no-save-credentials", false, "Disable saving credentials after successful login")
13691369
authConnectionsCreateCmd.Flags().Int("health-check-interval", 0, "Interval in seconds between health checks. Defaults to 3600 or your plan minimum, whichever is larger. The maximum is 86400; the minimum depends on your plan (Enterprise 300, Startup 1200, Hobbyist 3600, Free 21600)")
@@ -1392,7 +1392,7 @@ func init() {
13921392
authConnectionsUpdateCmd.Flags().String("proxy-id", "", "Proxy ID to use for future browser sessions (mutually exclusive with --proxy-name and --proxy-mode)")
13931393
authConnectionsUpdateCmd.Flags().String("proxy-name", "", "Proxy name to use for future browser sessions (mutually exclusive with --proxy-id and --proxy-mode)")
13941394
authConnectionsUpdateCmd.Flags().String("proxy-mode", "", "Proxy egress mode instead of a selected proxy: 'direct' for no proxy regardless of stealth, or 'default' to drop a selected proxy and use the stealth-derived default")
1395-
authConnectionsUpdateCmd.Flags().String("region", "", "Geographic region for future browser sessions: 'us-east', 'eu-west', or 'ap-southeast'")
1395+
authConnectionsUpdateCmd.Flags().String("region", "", "Geographic region for future browser sessions: 'us-east', 'us-west', 'eu-west', or 'ap-southeast'")
13961396
authConnectionsUpdateCmd.Flags().Bool("stealth", true, "Set whether future browser sessions run in stealth mode; use --stealth=false to disable")
13971397
authConnectionsUpdateCmd.Flags().Bool("save-credentials", false, "Enable saving credentials after successful login")
13981398
authConnectionsUpdateCmd.Flags().Bool("no-save-credentials", false, "Disable saving credentials after successful login")
@@ -1427,7 +1427,7 @@ func init() {
14271427
authConnectionsLoginCmd.Flags().String("proxy-id", "", "Proxy ID to use for this login (mutually exclusive with --proxy-name and --proxy-mode)")
14281428
authConnectionsLoginCmd.Flags().String("proxy-name", "", "Proxy name to use for this login (mutually exclusive with --proxy-id and --proxy-mode)")
14291429
authConnectionsLoginCmd.Flags().String("proxy-mode", "", "Proxy egress mode for this login instead of a selected proxy: 'direct' for no proxy regardless of stealth, or 'default' for the stealth-derived default")
1430-
authConnectionsLoginCmd.Flags().String("region", "", "Geographic region override for this login: 'us-east', 'eu-west', or 'ap-southeast'")
1430+
authConnectionsLoginCmd.Flags().String("region", "", "Geographic region override for this login: 'us-east', 'us-west', 'eu-west', or 'ap-southeast'")
14311431
authConnectionsLoginCmd.Flags().Bool("stealth", true, "Override stealth mode for this login's browser session; use --stealth=false to disable")
14321432
authConnectionsLoginCmd.Flags().Bool("record-session", false, "Override whether this login's browser session is recorded; use --record-session=false to disable")
14331433
authConnectionsLoginCmd.Flags().String("skill-mode", "", "Whether this login reads and writes learned domain skills: 'enabled' (default) or 'disabled'. Automatic reauths inherit the selected mode until a later accepted login sets enabled or omits the flag")

‎cmd/browser_pools.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ func init() {
793793
browserPoolsListCmd.Flags().String("query", "", "Search browser pools by name (IDs match by exact value)")
794794
browserPoolsListCmd.Flags().Int("limit", 0, "Maximum number of pools to return")
795795
browserPoolsListCmd.Flags().Int("offset", 0, "Number of pools to skip (for pagination)")
796-
browserPoolsListCmd.Flags().String("region", "", "Filter by geographic region: 'us-east', 'eu-west', or 'ap-southeast' (omit to list pools in all regions)")
796+
browserPoolsListCmd.Flags().String("region", "", "Filter by geographic region: 'us-east', 'us-west', 'eu-west', or 'ap-southeast' (omit to list pools in all regions)")
797797

798798
addJSONOutputFlag(browserPoolsCreateCmd)
799799
browserPoolsCreateCmd.Flags().String("name", "", "Optional unique name for the pool")
@@ -809,7 +809,7 @@ func init() {
809809
browserPoolsCreateCmd.Flags().String("profile-id", "", "Profile ID")
810810
browserPoolsCreateCmd.Flags().String("profile-name", "", "Profile name")
811811
browserPoolsCreateCmd.Flags().String("proxy-id", "", "Proxy ID")
812-
browserPoolsCreateCmd.Flags().String("region", "", "Geographic region for the pool: 'us-east', 'eu-west', or 'ap-southeast'. Fixed once the pool is created; requires a Start-Up or Enterprise plan and defaults to us-east")
812+
browserPoolsCreateCmd.Flags().String("region", "", "Geographic region for the pool: 'us-east', 'us-west', 'eu-west', or 'ap-southeast'. Fixed once the pool is created; requires a Start-Up or Enterprise plan and defaults to us-east")
813813
browserPoolsCreateCmd.Flags().StringSlice("private-host", nil, "Destinations browsers in the pool reach directly through their own network instead of Kernel-managed egress, for private hosts on a VPN or tunnel they join (repeat or comma-separated, max 32). Accepts hostname patterns ('*.example.ts.net'), IPs ('10.1.30.63', '[fd00::1]'), and private CIDRs ('100.64.0.0/10'). Replaces the default private ranges (RFC1918, 100.64.0.0/10, fc00::/7); omit to keep them")
814814
browserPoolsCreateCmd.Flags().String("start-url", "", "Initial page to open for new browsers")
815815
browserPoolsCreateCmd.Flags().StringSlice("extension", []string{}, "Extension IDs or names")

‎cmd/browsers.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func parseViewport(viewport string) (width, height, refreshRate int64, err error
166166
// availableRegions returns the geographic regions the API accepts for browser
167167
// sessions and pools.
168168
func availableRegions() []string {
169-
return []string{"us-east", "eu-west", "ap-southeast"}
169+
return []string{"us-east", "us-west", "eu-west", "ap-southeast"}
170170
}
171171

172172
// parseRegionFlag validates a --region value. An empty value means the flag was
@@ -2956,7 +2956,7 @@ func init() {
29562956
browsersListCmd.Flags().Int("limit", 0, "Maximum number of results to return (default 20, max 100)")
29572957
browsersListCmd.Flags().Int("offset", 0, "Number of results to skip (for pagination)")
29582958
browsersListCmd.Flags().String("query", "", "Search browsers by name, session ID, profile ID, proxy ID, or pool name")
2959-
browsersListCmd.Flags().String("region", "", "Filter by geographic region: 'us-east', 'eu-west', or 'ap-southeast' (omit to list sessions in all regions)")
2959+
browsersListCmd.Flags().String("region", "", "Filter by geographic region: 'us-east', 'us-west', 'eu-west', or 'ap-southeast' (omit to list sessions in all regions)")
29602960
browsersListCmd.Flags().StringArray("tag", nil, "Filter by tag KEY=VALUE (repeatable; a session must match every pair)")
29612961

29622962
// get flags
@@ -3280,7 +3280,7 @@ unrestricted code execution inside the browser VM and is not sandboxed.`,
32803280
browsersCreateCmd.Flags().String("proxy-id", "", "Proxy ID to use for the browser session (mutually exclusive with --proxy-name and --proxy-mode)")
32813281
browsersCreateCmd.Flags().String("proxy-name", "", "Proxy name to use for the browser session; must match exactly one active proxy in the project (mutually exclusive with --proxy-id and --proxy-mode)")
32823282
browsersCreateCmd.Flags().String("proxy-mode", "", "Proxy egress mode instead of a selected proxy: 'direct' for no proxy regardless of stealth, or 'default' for the browser default (Kernel's stealth proxy when --stealth is set, direct egress otherwise)")
3283-
browsersCreateCmd.Flags().String("region", "", "Geographic region for the session: 'us-east', 'eu-west', or 'ap-southeast'. Fixed once the session is created; requires a Start-Up or Enterprise plan and defaults to us-east")
3283+
browsersCreateCmd.Flags().String("region", "", "Geographic region for the session: 'us-east', 'us-west', 'eu-west', or 'ap-southeast'. Fixed once the session is created; requires a Start-Up or Enterprise plan and defaults to us-east")
32843284
browsersCreateCmd.Flags().StringSlice("private-host", nil, "Destinations the browser reaches directly through its own network instead of Kernel-managed egress, for private hosts on a VPN or tunnel the session joins (repeat or comma-separated, max 32). Accepts hostname patterns ('*.example.ts.net'), IPs ('10.1.30.63', '[fd00::1]'), and private CIDRs ('100.64.0.0/10'). Replaces the default private ranges (RFC1918, 100.64.0.0/10, fc00::/7); omit to keep them. Fixed once the session is created")
32853285
browsersCreateCmd.Flags().StringSlice("allowed-host", nil, "Egress allowlist: the only destinations the browser may reach through Kernel-managed egress (repeat or comma-separated, max 100); anything else is refused with a 403 (network_policy_denied). Accepts exact hostnames ('example.com'), a leading wildcard matching subdomains only ('*.example.com'), public IPs ('8.8.8.8', '[2001:4860:4860::8888]'), and public CIDRs ('8.8.4.0/24'). No ports, paths, or schemes. --start-url must be allowed. Omit for unfiltered egress. Requires proxy v3; not supported with pools. Create-only")
32863286
browsersCreateCmd.Flags().StringArray("proxy-route", nil, "Route HOST[,HOST...]=PROXY through a proxy (repeatable, max 10 routes and 50 hosts per route). PROXY is an ID by default; use id:ID or name:NAME explicitly. Exact hosts beat wildcards (longer suffixes win); *.example.com excludes example.com. Unmatched hosts use --proxy-* or default egress; start_url uses the top-level proxy. Create-only")

‎cmd/browsers_test.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,10 @@ func TestBrowsersCreate_WithRegion(t *testing.T) {
777777
require.NoError(t, err)
778778
assert.Contains(t, string(raw), `"region":"ap-southeast"`)
779779

780+
err = b.Create(context.Background(), BrowsersCreateInput{Region: "us-west"})
781+
require.NoError(t, err)
782+
assert.Equal(t, kernel.BrowserNewParamsRegionUsWest, captured.Region)
783+
780784
// Omitting the flag sends nothing; the server defaults to us-east.
781785
err = b.Create(context.Background(), BrowsersCreateInput{})
782786
require.NoError(t, err)

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.1
1010
github.com/golang-jwt/jwt/v5 v5.2.2
1111
github.com/joho/godotenv v1.5.1
12-
github.com/kernel/kernel-go-sdk v0.119.1-0.20261006192232-418cdfed18c8
12+
github.com/kernel/kernel-go-sdk v0.119.1-0.20261006201303-218107bfe6a5
1313
github.com/klauspost/compress v1.18.5
1414
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
1515
github.com/pterm/pterm v0.12.80

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
6666
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
6767
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
6868
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
69-
github.com/kernel/kernel-go-sdk v0.119.1-0.20261006192232-418cdfed18c8 h1:g1zA+KLA3DXNHY3rZwr0zZPGUeC6X7PWru0qnWc820I=
70-
github.com/kernel/kernel-go-sdk v0.119.1-0.20261006192232-418cdfed18c8/go.mod h1:EeZzSuHZVeHKxKCPUzxou2bovNGhXaz0RXrSqKNf1AQ=
69+
github.com/kernel/kernel-go-sdk v0.119.1-0.20261006201303-218107bfe6a5 h1:Qxgno4N1f2WIgS/VzbuUpGkEmptu2M6sVm2yVF0ebhM=
70+
github.com/kernel/kernel-go-sdk v0.119.1-0.20261006201303-218107bfe6a5/go.mod h1:EeZzSuHZVeHKxKCPUzxou2bovNGhXaz0RXrSqKNf1AQ=
7171
github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE=
7272
github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
7373
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=

0 commit comments

Comments
 (0)