@browserless.io/cli 0.4.2 → 0.5.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0](https://github.com/browserless/browserless-cli/compare/v0.4.2...v0.5.0) (2026-10-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * AUTO-303 add profile terms command ([#130](https://github.com/browserless/browserless-cli/issues/130)) ([3472d1f](https://github.com/browserless/browserless-cli/commit/3472d1fd8dcb23f59f3c0d4501399d9cc49ff0dc))
9
+
3
10
  ## [0.4.2](https://github.com/browserless/browserless-cli/compare/v0.4.1...v0.4.2) (2026-10-13)
4
11
 
5
12
 
package/README.md CHANGED
@@ -133,8 +133,14 @@ they're mutually exclusive.
133
133
  > Use `--accept-terms` (or `BROWSERLESS_ACCEPT_TERMS=1`) in scripts /
134
134
  > non-interactive shells; `--terms-ttl-days <n>` tunes the re-prompt
135
135
  > window (0 to re-prompt every run).
136
+ > Scripts and agents can print the notice with `browserless profile terms`
137
+ > and show it to the user. Agents must wait for explicit user approval before
138
+ > passing `--accept-terms`.
136
139
 
137
140
  ```bash
141
+ # Print the liability disclaimer (for scripts and agents that pass --accept-terms)
142
+ browserless profile terms
143
+
138
144
  # Discover local browser profiles
139
145
  browserless profile sources list
140
146
 
@@ -13,4 +13,4 @@ Heads up \u2014 uploading a profile sends authentication state to Browserless:
13
13
  By continuing you confirm you understand the above and accept responsibility
14
14
  for the contents of the upload. Privacy policy: https://www.browserless.io/privacy-policy
15
15
  `,l="I accept",y=o(()=>!!process.env.CI,"isCi"),h=o((t,e)=>{if(!t||e<=0)return!1;const r=Date.parse(t);if(!Number.isFinite(r))return!1;const a=Date.now()-r;return a>=0&&a<e*24*60*60*1e3},"isWithinTtl"),S=o(async t=>{s.write(t);const e=u.createInterface({input:n,output:s});try{return await e.question(`
16
- Type "${l}" to continue: `)}finally{e.close()}},"defaultPrompt"),R=o(async(t,e={})=>{const r=await m(),a=t.ttlDaysOverride??r.terms_ttl_days??f;if(h(r.accepted_terms_at,a))return;if(t.acceptViaFlag||process.env.BROWSERLESS_ACCEPT_TERMS==="1"){await c(i=>{i.accepted_terms_at=new Date().toISOString()});return}if(!(e.isInteractive??(n.isTTY&&!y())))throw new p("Liability disclaimer must be acknowledged before uploading. Re-run with `--accept-terms` or set BROWSERLESS_ACCEPT_TERMS=1 in non-interactive environments.","terms-not-accepted");if((await(e.prompt??S)(w)).trim()!==l)throw new p("Disclaimer not accepted \u2014 aborting.","terms-not-accepted");await c(i=>{i.accepted_terms_at=new Date().toISOString()})},"ensureTermsAccepted");export{R as ensureTermsAccepted};
16
+ Type "${l}" to continue: `)}finally{e.close()}},"defaultPrompt"),R=o(async(t,e={})=>{const r=await m(),a=t.ttlDaysOverride??r.terms_ttl_days??f;if(h(r.accepted_terms_at,a))return;if(t.acceptViaFlag||process.env.BROWSERLESS_ACCEPT_TERMS==="1"){await c(i=>{i.accepted_terms_at=new Date().toISOString()});return}if(!(e.isInteractive??(n.isTTY&&!y())))throw new p("Liability disclaimer must be acknowledged before uploading. Re-run with `--accept-terms` or set BROWSERLESS_ACCEPT_TERMS=1 in non-interactive environments.","terms-not-accepted");if((await(e.prompt??S)(w)).trim()!==l)throw new p("Disclaimer not accepted \u2014 aborting.","terms-not-accepted");await c(i=>{i.accepted_terms_at=new Date().toISOString()})},"ensureTermsAccepted");export{w as DISCLAIMER_TEXT,R as ensureTermsAccepted};
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{Command as t}from"commander";import{version as i}from"./version.js";import{registerProfile as n}from"./commands/profile/index.js";import{registerAuth as a}from"./commands/auth/index.js";import{registerConfig as m}from"./commands/config/index.js";import{registerAgent as c}from"./commands/agent/index.js";import{errorCodeOf as p,exitCodeFor as f,UserFacingError as d}from"./errors.js";import*as r from"./telemetry/index.js";const o=new t;o.name("browserless").description("Browserless CLI \u2014 manage profiles, sessions, and more.").version(i),n(o),a(o),m(o),c(o),o.hook("preAction",(e,s)=>{try{r.begin(s)}catch{}}),o.hook("postAction",async()=>{try{await r.complete({status:"ok",exitCode:0})}catch{}}),o.parseAsync(process.argv).catch(async e=>{e instanceof d?process.stderr.write(`${e.message}
2
+ var n=Object.defineProperty;var t=(e,o)=>n(e,"name",{value:o,configurable:!0});import{Command as m}from"commander";import{version as a}from"./version.js";import{registerProfile as c}from"./commands/profile/index.js";import{registerAuth as p}from"./commands/auth/index.js";import{registerConfig as f}from"./commands/config/index.js";import{registerAgent as d}from"./commands/agent/index.js";import{errorCodeOf as g,exitCodeFor as l,UserFacingError as C}from"./errors.js";import*as s from"./telemetry/index.js";const r=new m;r.name("browserless").description("Browserless CLI \u2014 manage profiles, sessions, and more.").version(a),c(r),p(r),f(r),d(r);const i=t(e=>e.name()==="terms"&&e.parent?.name()==="profile","isProfileTerms");r.hook("preAction",(e,o)=>{if(!i(o))try{s.begin(o)}catch{}}),r.hook("postAction",async(e,o)=>{if(!i(o))try{await s.complete({status:"ok",exitCode:0})}catch{}}),r.parseAsync(process.argv).catch(async e=>{e instanceof C?process.stderr.write(`${e.message}
3
3
  `):e instanceof Error?process.stderr.write(`${e.stack??e.message}
4
4
  `):process.stderr.write(`${String(e)}
5
- `),process.exitCode=f(e);try{await r.complete({status:"error",exitCode:process.exitCode,errorName:e instanceof Error?e.name:void 0,errorCode:p(e)})}catch{}});
5
+ `),process.exitCode=l(e);try{await s.complete({status:"error",exitCode:process.exitCode,errorName:e instanceof Error?e.name:void 0,errorCode:g(e)})}catch{}});
@@ -1 +1 @@
1
- var i=Object.defineProperty;var o=(e,r)=>i(e,"name",{value:r,configurable:!0});import{registerList as t}from"./list.js";import{registerShow as m}from"./show.js";import{registerUpload as s}from"./upload.js";import{registerRefresh as f}from"./refresh.js";import{registerInspect as p}from"./inspect.js";import{registerLaunch as g}from"./launch.js";import{registerRename as c}from"./rename.js";import{registerDelete as n}from"./delete.js";import{registerProfileSources as a}from"./sources/index.js";import{registerProfileExclude as l}from"./exclude/index.js";const I=o(e=>{const r=e.command("profile").description("Manage authentication profiles");t(r),m(r),s(r),f(r),p(r),g(r),c(r),n(r),a(r),l(r)},"registerProfile");export{I as registerProfile};
1
+ var i=Object.defineProperty;var o=(e,r)=>i(e,"name",{value:r,configurable:!0});import{registerList as t}from"./list.js";import{registerShow as m}from"./show.js";import{registerUpload as s}from"./upload.js";import{registerRefresh as f}from"./refresh.js";import{registerInspect as p}from"./inspect.js";import{registerLaunch as g}from"./launch.js";import{registerRename as c}from"./rename.js";import{registerDelete as n}from"./delete.js";import{registerTerms as a}from"./terms.js";import{registerProfileSources as l}from"./sources/index.js";import{registerProfileExclude as d}from"./exclude/index.js";const T=o(e=>{const r=e.command("profile").description("Manage authentication profiles");t(r),m(r),s(r),f(r),p(r),g(r),c(r),n(r),a(r),l(r),d(r)},"registerProfile");export{T as registerProfile};
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty;var i=(r,t)=>e(r,"name",{value:t,configurable:!0});import{DISCLAIMER_TEXT as o}from"../../auth/disclaimer.js";const n=i(r=>{r.command("terms").description("Print the liability disclaimer shown before a profile upload").action(()=>{process.stdout.write(o.trim()+`
2
+ `)})},"registerTerms");export{n as registerTerms};
package/build/version.js CHANGED
@@ -1 +1 @@
1
- const o="0.4.2";export{o as version};
1
+ const o="0.5.0";export{o as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserless.io/cli",
3
- "version": "0.4.2",
3
+ "version": "0.5.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",
@@ -50,7 +50,7 @@
50
50
  "ws": "^8.22.0"
51
51
  },
52
52
  "optionalDependencies": {
53
- "@napi-rs/keyring": "^2.1.0"
53
+ "@napi-rs/keyring": "^2.1.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@eslint/js": "^10.0.1",
@@ -70,7 +70,7 @@
70
70
  "prettier": "3.9.10",
71
71
  "sinon": "^22.1.0",
72
72
  "typescript": "^6.0.3",
73
- "typescript-eslint": "^8.71.1"
73
+ "typescript-eslint": "^8.71.2"
74
74
  },
75
75
  "overrides": {
76
76
  "mocha": {