Skip to content
Open
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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ failed still exits with status 1 even if stderr is closed and cannot report the
error. These source changes require a new binary; updating Skill instructions
does not change an already installed CLI.

## Automatic CAPTCHA handling

```bash
browser-cli session create --browser-mode normal --enable-captcha
```

`--enable-captcha` enables server-side automatic CAPTCHA handling for the created
session only. It is off by default and supports only `normal` browser mode;
requesting it with any other mode returns a configuration error before any
session request. Availability and usage are subject to your plan's CAPTCHA quota.
Rust SDK callers can set `CreateSession.enable_captcha` to `Some(true)`; the
default `None` omits the field from the request.

This option requires a binary built from source containing this feature;
updating Skill documentation alone does not update an installed binary.

## Local network proxy tunnels

Introduced in 1.3.0. This requires a newly built or published binary; updating the
Expand Down
18 changes: 17 additions & 1 deletion skills/lexmount-browser/references/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ browser-cli doctor
browser-cli auth status
browser-cli auth login [--client-name "NAME"]

browser-cli session create [--browser-mode normal|light]
browser-cli session create [--browser-mode normal|light] [--enable-captcha]
[--context-id ID --context-mode read_write|read_only]
[--downloads] [--recording] [--window-size 1920,1080]
[--official-proxy | --local-proxy-tunnel-id TUNNEL_ID]
Expand Down Expand Up @@ -47,6 +47,22 @@ browser-cli action eval --session-id ID --expression JS
browser-cli action raw --session-id ID --method CDP_METHOD --params-json JSON
```

## Automatic CAPTCHA handling

```bash
browser-cli session create --browser-mode normal --enable-captcha
```

`--enable-captcha` enables server-side automatic CAPTCHA handling for the created
session only. It is off by default and supports only `normal` browser mode;
requesting it with any other mode returns a configuration error before any
session request. Availability and usage are subject to your plan's CAPTCHA quota.
Rust SDK callers can set `CreateSession.enable_captcha` to `Some(true)`; the
default `None` omits the field from the request.

This option requires a binary built from source containing this feature;
updating Skill documentation alone does not update an installed binary.

## Page selection

Introduced in 1.2.0; requires a binary whose `browser-cli action --help` lists
Expand Down
5 changes: 5 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ impl Client {
request: CreateSession,
poll_timeout: Duration,
) -> Result<Session> {
if request.enable_captcha == Some(true) && request.browser_mode != "normal" {
return Err(Error::Config(
"automatic CAPTCHA handling requires normal browser mode".into(),
));
}
let local_id = request
.proxy
.as_ref()
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ enum DownloadsCommand {
struct CreateSessionArgs {
#[arg(long, default_value = "normal")]
browser_mode: String,
/// Enable server-side CAPTCHA handling for this session (normal mode only).
#[arg(long)]
enable_captcha: bool,
#[arg(long)]
context_id: Option<String>,
#[arg(long, default_value = "read_write")]
Expand Down Expand Up @@ -472,6 +475,7 @@ fn run_session(client: Client, command: SessionCommand) -> Result<Value> {
.map(|id| json!({"id":id,"mode":args.context_mode}));
let request = CreateSession {
browser_mode: args.browser_mode,
enable_captcha: args.enable_captcha.then_some(true),
context,
context_description: args.context_description,
weak_lock: args.weak_lock.then_some(true),
Expand Down
3 changes: 3 additions & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ pub struct ContextList {
pub struct CreateSession {
pub browser_mode: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_captcha: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub context: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub extension_ids: Option<Vec<String>>,
Expand All @@ -171,6 +173,7 @@ impl Default for CreateSession {
fn default() -> Self {
Self {
browser_mode: "normal".into(),
enable_captcha: None,
context: None,
extension_ids: None,
proxy: None,
Expand Down
Loading