@browserless.io/cli 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -8
- package/build/api/client.js +1 -1
- package/build/api/refresh.js +1 -1
- package/build/api/upload.js +1 -1
- package/build/commands/profile/refresh.js +2 -2
- package/build/commands/profile/upload.js +2 -2
- package/build/telemetry/index.js +2 -2
- package/build/telemetry/profile-setup.js +1 -0
- package/build/version.js +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.0](https://github.com/browserless/browserless-cli/compare/v0.3.0...v0.4.0) (2026-09-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* AUTO-419 track CLI profile setup attempts ([#100](https://github.com/browserless/browserless-cli/issues/100)) ([93f5f5f](https://github.com/browserless/browserless-cli/commit/93f5f5fc033dbe98788f614082e997bd31a7129c))
|
|
9
|
+
|
|
3
10
|
## [0.3.0](https://github.com/browserless/browserless-cli/compare/v0.2.0...v0.3.0) (2026-08-04)
|
|
4
11
|
|
|
5
12
|
|
|
6
13
|
### Features
|
|
7
14
|
|
|
8
|
-
*
|
|
15
|
+
* Profile refresh replays the capture settings a profile was created with — no flags needed ([#58](https://github.com/browserless/browserless-cli/issues/58)) ([94fe959](https://github.com/browserless/browserless-cli/commit/94fe959620909e9f7e9bfe533dd0c94c1560c712))
|
|
9
16
|
|
|
10
17
|
## [0.2.0](https://github.com/browserless/browserless-cli/compare/v0.1.0...v0.2.0) (2026-06-18)
|
|
11
18
|
|
|
@@ -19,8 +26,7 @@
|
|
|
19
26
|
|
|
20
27
|
### Features
|
|
21
28
|
|
|
22
|
-
* agent
|
|
23
|
-
* agent functionality AI-107 ([c453dba](https://github.com/browserless/browserless-cli/commit/c453dbad50aa3283f9f8340bf32ed51d185ff132))
|
|
29
|
+
* Interactive agent chat via `browserless agent` ([c453dba](https://github.com/browserless/browserless-cli/commit/c453dbad50aa3283f9f8340bf32ed51d185ff132))
|
|
24
30
|
|
|
25
31
|
## [0.0.3](https://github.com/browserless/browserless-cli/compare/v0.0.2...v0.0.3) (2026-06-05)
|
|
26
32
|
|
|
@@ -36,14 +42,10 @@
|
|
|
36
42
|
## [0.0.2](https://github.com/browserless/browserless-cli/compare/v0.0.1...v0.0.2) (2026-05-27)
|
|
37
43
|
|
|
38
44
|
|
|
39
|
-
* set next release to 0.0.2 ([e755492](https://github.com/browserless/browserless-cli/commit/e7554922a8576286c5ffe37edc1bfd55f532f2bd))
|
|
40
|
-
|
|
41
|
-
|
|
42
45
|
### Features
|
|
43
46
|
|
|
44
47
|
* --region sfo|lon|ams shortcut + region config key ([c921251](https://github.com/browserless/browserless-cli/commit/c921251664c89bb0e66c2549767d37ae2f011734))
|
|
45
|
-
*
|
|
46
|
-
* add browserless CLI for authenticated profile management [do not merge] ([4194243](https://github.com/browserless/browserless-cli/commit/41942439b3ee3166fe15c90648bfe7de8da4a6fe))
|
|
48
|
+
* Add the Browserless CLI for authenticated profile management ([d2ccbbe](https://github.com/browserless/browserless-cli/commit/d2ccbbe33204f74e188a1a4bb7a999e40a7034d7))
|
|
47
49
|
* **capture:** live progress events, skip vendor NTP origins, cap loop on attempts, + --auto-fit/--keep-domain/--only-domain for artifact size mgmt ([f83c2a9](https://github.com/browserless/browserless-cli/commit/f83c2a99d086f9ab4c267f254a42c1154de7b9d4))
|
|
48
50
|
* **capture:** skip sensitive profile files from temp copy + CI smoke that catches future Chrome additions ([0ad3a97](https://github.com/browserless/browserless-cli/commit/0ad3a9731c6133dcd68356c33b4ce40b0d01c4d0))
|
|
49
51
|
* **ci:** cli-smoke integration test invokes every command on every OS via stub server ([c5fb558](https://github.com/browserless/browserless-cli/commit/c5fb5581bc4255b5b118e13cc543d4a115e5ebd5))
|
package/build/api/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $=Object.defineProperty;var c=(e,t)=>$(e,"name",{value:t,configurable:!0});import{ApiError as f}from"../errors.js";const w=3e4,l=c(e=>typeof e=="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?e.toLowerCase():void 0,"profileAttemptId"),y=c((e,t,n,r)=>{const s=e.endsWith("/")?e:`${e}/`,m=t.replace(/^\/+/,""),o=new URL(m,s);if(o.searchParams.set("token",n),r)for(const[h,u]of Object.entries(r))u!==void 0&&o.searchParams.set(h,String(u));return o},"buildUrl"),p=c((e,t,n)=>{if(!n)return`HTTP ${e} ${t}`;try{const s=JSON.parse(n);if(s?.message&&typeof s.message=="string")return s.message}catch{}const r=n.trim();return r.length>200?`HTTP ${e} ${t}: ${r.slice(0,200)}\u2026`:`HTTP ${e} ${t}: ${r}`},"messageFromBody"),T=c(async(e,t)=>{const n=y(e.server,t.path,e.token,t.query),r={method:t.method};let s;t.rawBody!==void 0?s=t.rawBody:t.body!==void 0&&(s=JSON.stringify(t.body)),s!==void 0&&(r.body=s,r.headers={"Content-Type":"application/json"});const m=l(t.attemptId);m&&(r.headers={...r.headers,"x-browserless-attempt-id":m});const o=t.timeoutMs??w,h=new AbortController,u=setTimeout(()=>h.abort(),o);r.signal=h.signal;let a;try{a=await fetch(n,r)}catch(d){throw d?.name==="AbortError"?new f(`Request to ${e.server}${t.path} timed out after ${o}ms`,0):new f(`Failed to reach ${e.server}: ${d?.message??d}`,0)}finally{clearTimeout(u)}let i;try{i=await a.text()}catch(d){throw d?.name==="AbortError"?new f(`Request to ${e.server}${t.path} timed out after ${o}ms`,0):new f(`Failed to read response from ${e.server}${t.path}: ${d?.message??d}`,0)}if(!a.ok)throw new f(p(a.status,a.statusText,i),a.status,i);if(!(a.status===204||!i))try{return JSON.parse(i)}catch{throw new f(`Server returned non-JSON response: ${i}`,a.status,i)}},"apiFetch");export{T as apiFetch,l as profileAttemptId};
|
package/build/api/refresh.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a=Object.defineProperty;var
|
|
1
|
+
var a=Object.defineProperty;var e=(r,t)=>a(r,"name",{value:t,configurable:!0});import{apiFetch as i}from"./client.js";import{buildProfileBody as p,rethrowCaptureSettingsSkew as f}from"./upload.js";const s=e(async(r,t)=>{try{return await i(r,{method:"POST",path:"/profile/refresh",rawBody:p(t),attemptId:t.attemptId})}catch(o){return f(o,r.server)}},"refreshProfile");export{s as refreshProfile};
|
package/build/api/upload.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var s=Object.defineProperty;var i=(t,e)=>s(t,"name",{value:e,configurable:!0});import{apiFetch as n}from"./client.js";import{ApiError as o}from"../errors.js";import{version as a}from"../version.js";const d=i(t=>{const e=t.serialized??JSON.stringify(t.state),r=t.captureSettings===void 0?"":`,"captureSettings":${JSON.stringify(t.captureSettings)}`;return`{"name":${JSON.stringify(t.name)},"state":${e}${r}}`},"buildProfileBody"),p=i((t,e)=>{throw!(t instanceof o)||t.status!==400||!/additional propert/i.test(`${t.body??""} ${t.message}`)?t:new o(`The server at ${e} rejected the profile capture settings this CLI (v${a}) sends \u2014 it predates either the field itself or one of its members. Deploy the server to every region before using this CLI against it. Server said: ${t.message}`,400,t.body)},"rethrowCaptureSettingsSkew"),u=i(async(t,e)=>{try{return await n(t,{method:"POST",path:"/profile/upload",rawBody:d(e)})}catch(r){return p(r,t.server)}},"uploadProfile");export{d as buildProfileBody,p as rethrowCaptureSettingsSkew,u as uploadProfile};
|
|
1
|
+
var s=Object.defineProperty;var i=(t,e)=>s(t,"name",{value:e,configurable:!0});import{apiFetch as n}from"./client.js";import{ApiError as o}from"../errors.js";import{version as a}from"../version.js";const d=i(t=>{const e=t.serialized??JSON.stringify(t.state),r=t.captureSettings===void 0?"":`,"captureSettings":${JSON.stringify(t.captureSettings)}`;return`{"name":${JSON.stringify(t.name)},"state":${e}${r}}`},"buildProfileBody"),p=i((t,e)=>{throw!(t instanceof o)||t.status!==400||!/additional propert/i.test(`${t.body??""} ${t.message}`)?t:new o(`The server at ${e} rejected the profile capture settings this CLI (v${a}) sends \u2014 it predates either the field itself or one of its members. Deploy the server to every region before using this CLI against it. Server said: ${t.message}`,400,t.body)},"rethrowCaptureSettingsSkew"),u=i(async(t,e)=>{try{return await n(t,{method:"POST",path:"/profile/upload",rawBody:d(e),attemptId:e.attemptId})}catch(r){return p(r,t.server)}},"uploadProfile");export{d as buildProfileBody,p as rethrowCaptureSettingsSkew,u as uploadProfile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
`);const
|
|
1
|
+
var c=Object.defineProperty;var a=(e,t)=>c(e,"name",{value:t,configurable:!0});import{addClientFlags as d,buildClient as f,printJson as m}from"../../cli-utils/client.js";import{addCaptureFlags as p,buildCaptureSettings as u,mergeStoredSettings as g,printEffectiveSettings as h,runCapture as C}from"../../cli-utils/capture-runner.js";import{getProfile as S}from"../../api/profiles.js";import{refreshProfile as w}from"../../api/refresh.js";import{withProfileSetup as $}from"../../telemetry/profile-setup.js";const x=a(e=>$(e.attemptId,"refresh",async t=>{const i=await f(e),s=await S(i,e.name),l=e.defaultExcludes===!1,o=g(e,s.captureSettings);h(o,s.captureSettings,{userOptedOut:l});const n=await C({flags:o,requiresDisclaimer:!0});t.ready(),process.stderr.write(`> Refreshing profile "${e.name}" on ${i.server}
|
|
2
|
+
`),t.submit();const r=await w(i,{attemptId:t.attemptId,name:e.name,state:n.state,serialized:n.serialized,captureSettings:u(o,n.diagnostics,"refresh")});if(e.json){m(r);return}console.log(`\u2713 Profile "${r.name}" refreshed`),console.log(` id: ${r.id}`),console.log(` cookies: ${r.cookieCount}`),console.log(` origins: ${r.originCount}`),console.log(` updated: ${r.updatedAt}`)}),"action"),q=a(e=>{const t=e.command("refresh").description("Capture a local browser profile and replace an existing cloud profile in place").requiredOption("--name <name>","Name of the existing cloud profile to refresh").option("--attempt-id <UUID>","Optional setup correlation ID");p(d(t),{sourceOptional:!0}).action(x)},"registerRefresh");export{q as registerRefresh};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
`);const
|
|
1
|
+
var l=Object.defineProperty;var n=(e,t)=>l(e,"name",{value:t,configurable:!0});import{addClientFlags as s,buildClient as d,printJson as c}from"../../cli-utils/client.js";import{addCaptureFlags as p,buildCaptureSettings as u,runCapture as m}from"../../cli-utils/capture-runner.js";import{uploadProfile as g}from"../../api/upload.js";import{withProfileSetup as f}from"../../telemetry/profile-setup.js";const C={runCapture:m},w=n((e,t)=>f(e.attemptId,"create",async a=>{const r=await d(e),i=await t.runCapture({flags:e,requiresDisclaimer:!0});a.ready(),process.stderr.write(`> Uploading to ${r.server}
|
|
2
|
+
`),a.submit();const o=await g(r,{attemptId:a.attemptId,name:e.name,state:i.state,serialized:i.serialized,captureSettings:u(e,i.diagnostics,"upload")});if(e.json){c(o);return}console.log(`\u2713 Profile "${o.name}" uploaded`),console.log(` id: ${o.id}`),console.log(` cookies: ${o.cookieCount}`),console.log(` origins: ${o.originCount}`),console.log(` created: ${o.createdAt}`)}),"action"),P=n((e,t=C)=>{const a=e.command("upload").description("Capture a local browser profile and upload it as a new cloud profile").requiredOption("--name <name>","Name for the new cloud profile").option("--attempt-id <UUID>","Optional setup correlation ID");p(s(a)).action(r=>w(r,t))},"registerUpload");export{P as registerUpload};
|
package/build/telemetry/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)},"debug");let c;const
|
|
1
|
+
var E=Object.defineProperty;var t=(e,r)=>E(e,"name",{value:r,configurable:!0});import{performance as p}from"node:perf_hooks";import{readConfig as l}from"../config/store.js";import{REGION_URLS as _,KNOWN_REGIONS as v,isKnownRegion as g}from"../regions.js";import{version as R}from"../version.js";import{commandPath as h,usedFlagNames as S}from"./command-meta.js";import{getRecordedToken as T}from"./token-cache.js";import{getOrCreateDeviceId as w}from"./device-id.js";import{postCliEvents as y}from"./api.js";const L="CLI Command Run",a=t(e=>e!==void 0&&e!==""&&e!=="0"&&e.toLowerCase()!=="false","isTruthyEnv"),N=t(()=>{const e=Number(process.env.BROWSERLESS_TELEMETRY_TIMEOUT_MS);return e>0?e:2e3},"flushTimeoutMs"),i=t(e=>{a(process.env.BROWSERLESS_TELEMETRY_DEBUG)&&process.stderr.write(`[telemetry] ${e}
|
|
2
|
+
`)},"debug");let c,s=[];const K=t(e=>{c&&s.length<6&&s.push(e)},"recordProfileSetupEvent"),k=t(async()=>{if(a(process.env.BROWSERLESS_TELEMETRY_DISABLED)||a(process.env.DO_NOT_TRACK))return!1;try{const e=await l();return e.telemetry===void 0||e.telemetry===!0}catch{return!1}},"isEnabled"),Y=t(e=>{s=[],c={command:h(e),flags:S(e),startedAt:p.now()}},"begin"),C=t(e=>{let r;try{r=new URL(e).origin}catch{return"custom"}return v.find(o=>{try{return new URL(_[o]).origin===r}catch{return!1}})??"custom"},"bucketServerUrl"),M=t(()=>Number(process.versions.node.split(".")[0])||0,"nodeMajor"),O=t((e,r,d,o)=>{const n={command:e.command,flags:e.flags,status:r.status,exit_code:r.exitCode,error_name:r.status==="error"?r.errorName:void 0,error_code:r.status==="error"?r.errorCode:void 0,duration_ms:Math.round(p.now()-e.startedAt),cli_version:R,os:process.platform,arch:process.arch,node_major:M(),is_ci:a(process.env.CI),server_region:d,cli_device_id:o};return{event_type:L,time:Date.now(),event_properties:n}},"buildEvent"),$=t(async e=>{const r=c;c=void 0;const d=s;if(s=[],!!r)try{if(!await k()){i("skipped: telemetry disabled");return}const o=T();if(!o){i("skipped: no token resolved this run");return}const n=C(o.server);if(!g(n)){i("skipped: non-cloud server");return}const m=await w(),f=O(r,e,n,m),u=await y([f,...d],{token:o.token,timeoutMs:N()});i(u?`sent (${n})`:`send failed (${n})`)}catch{i("skipped: error while flushing")}},"complete"),j=t(()=>{c=void 0,s=[]},"_resetForTests");export{j as _resetForTests,Y as begin,C as bucketServerUrl,$ as complete,N as flushTimeoutMs,k as isEnabled,K as recordProfileSetupEvent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var r=(o,i)=>p(o,"name",{value:i,configurable:!0});import{randomUUID as f}from"node:crypto";import{profileAttemptId as l}from"../api/client.js";import{ApiError as u,CaptureError as m,PreconditionError as _,UsageError as S}from"../errors.js";import{recordProfileSetupEvent as v}from"./index.js";const I=r(async(o,i,s)=>{const n=l(o)??f(),c=new Set;let d="capture";const t=r((e,a={})=>{c.has(e)||(c.add(e),v({event_type:e,time:Date.now(),event_properties:{attempt_id:n,setup_method:"cli",source:"cli",operation:i,...a}}))},"emit");t("Profile Setup Method Selected"),t("Profile Setup Started");try{return await s({attemptId:n,ready:r(()=>{t("Profile Setup Ready")},"ready"),submit:r(()=>{d="save",t("Profile Save Submitted")},"submit")})}catch(e){const a=e instanceof u?e.status===0?"connection_failed":e.status<500?"validation_rejected":"server_failed":e instanceof S?"validation_rejected":e instanceof _?"precondition_failed":e instanceof m?"capture_failed":"internal_error";throw t("Profile Setup Failed",{step:d,reason_code:a}),e}},"withProfileSetup");export{I as withProfileSetup};
|
package/build/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="0.
|
|
1
|
+
const o="0.4.0";export{o as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browserless.io/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Browserless CLI — manage authentication profiles, sessions, and other Browserless features from your terminal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -47,30 +47,30 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"chrome-remote-interface": "^0.34.0",
|
|
49
49
|
"commander": "^15.0.0",
|
|
50
|
-
"ws": "^8.21.
|
|
50
|
+
"ws": "^8.21.3"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@napi-rs/keyring": "^1.
|
|
53
|
+
"@napi-rs/keyring": "^2.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@eslint/js": "^10.0.1",
|
|
57
57
|
"@types/chai": "^5.2.3",
|
|
58
58
|
"@types/chrome-remote-interface": "^0.34.0",
|
|
59
59
|
"@types/mocha": "^10.0.10",
|
|
60
|
-
"@types/node": "^26.1
|
|
60
|
+
"@types/node": "^26.6.1",
|
|
61
61
|
"@types/sinon": "^22.0.0",
|
|
62
62
|
"@types/ws": "^8.18.1",
|
|
63
63
|
"chai": "^6.2.2",
|
|
64
|
-
"esbuild": "^0.28.
|
|
65
|
-
"eslint": "^10.
|
|
66
|
-
"globals": "^17.
|
|
64
|
+
"esbuild": "^0.28.2",
|
|
65
|
+
"eslint": "^10.10.0",
|
|
66
|
+
"globals": "^17.12.0",
|
|
67
67
|
"husky": "^9.1.7",
|
|
68
|
-
"lint-staged": "^17.
|
|
69
|
-
"mocha": "^
|
|
70
|
-
"prettier": "3.9.
|
|
68
|
+
"lint-staged": "^17.5.1",
|
|
69
|
+
"mocha": "^12.0.2",
|
|
70
|
+
"prettier": "3.9.8",
|
|
71
71
|
"sinon": "^22.1.0",
|
|
72
72
|
"typescript": "^6.0.3",
|
|
73
|
-
"typescript-eslint": "^8.
|
|
73
|
+
"typescript-eslint": "^8.70.0"
|
|
74
74
|
},
|
|
75
75
|
"overrides": {
|
|
76
76
|
"mocha": {
|