@sequenzy/cli 0.0.215 → 0.0.217
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/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -329,7 +329,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
329
329
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
330
330
|
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;if((Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment")n?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&t.sep&&!t.value){let o=[];for(let c=0;c<t.sep.length;++c){let l=t.sep[c];switch(l.type){case"newline":o.push(c);break;case"space":break;case"comment":if(l.indent>e.indent)o.length=0;break;default:o.length=0}}if(o.length>=2)i=t.sep.splice(o[1])}switch(this.type){case"anchor":case"tag":if(r||t.value)i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(r||t.value)i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(Hl(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Rm(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Hl(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(X6(t.key)&&!Hl(t.sep,"newline")){let o=Rm(t.start),{key:c,sep:l}=t;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:c,sep:l}]})}else if(i.length>0)t.sep=t.sep.concat(i,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||r)e.items.push({start:i,key:null,sep:[this.sourceToken]});else if(Hl(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);if(r||t.value)e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(o);else Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0;return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Hl(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(n)e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;if((Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment")n?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||Hl(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:r,sep:[]});else if(t.sep)this.stack.push(r);else Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);if(n)this.stack.push(n);else yield*this.pop(),yield*this.step()}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let r=jI(n),i=Rm(r);Z6(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let c={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
331
331
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
332
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=jI(e),n=Rm(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=jI(e),n=Rm(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((n)=>n.type==="newline"||n.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}LNe.Parser=e9});var o9=P(function(VNe){var t9=tR(),MNe=NA(),LA=$A(),jNe=dk(),zNe=nn(),GNe=dR(),n9=pR();function r9(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new GNe.LineCounter||null,prettyErrors:t}}function HNe(e,t={}){let{lineCounter:n,prettyErrors:r}=r9(t),i=new n9.Parser(n?.addNewLine),o=new t9.Composer(t),c=Array.from(o.compose(i.parse(e)));if(r&&n)for(let l of c)l.errors.forEach(LA.prettifyError(e,n)),l.warnings.forEach(LA.prettifyError(e,n));if(c.length>0)return c;return Object.assign([],{empty:!0},o.streamInfo())}function i9(e,t={}){let{lineCounter:n,prettyErrors:r}=r9(t),i=new n9.Parser(n?.addNewLine),o=new t9.Composer(t),c=null;for(let l of o.compose(i.parse(e),!0,e.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new LA.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(r&&n)c.errors.forEach(LA.prettifyError(e,n)),c.warnings.forEach(LA.prettifyError(e,n));return c}function JNe(e,t,n){let r=void 0;if(typeof t==="function")r=t;else if(n===void 0&&t&&typeof t==="object")n=t;let i=i9(e,n);if(!i)return null;if(i.warnings.forEach((o)=>jNe.warn(i.options.logLevel,o)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:r},n))}function KNe(e,t,n){let r=null;if(typeof t==="function"||Array.isArray(t))r=t;else if(n===void 0&&t)n=t;if(typeof n==="string")n=n.length;if(typeof n==="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}if(zNe.isDocument(e)&&!r)return e.toString(n);return new MNe.Document(e,r,n).toString(n)}VNe.parse=JNe;VNe.parseAllDocuments=HNe;VNe.parseDocument=i9;VNe.stringify=KNe});var P0={};Vne(P0,{program:()=>oP,createCommand:()=>sP,createOption:()=>aP,createArgument:()=>cP,Command:()=>lP,Option:()=>uP,Argument:()=>dP,Help:()=>pP,CommanderError:()=>mP,InvalidArgumentError:()=>fP,InvalidOptionArgumentError:()=>gP},{program:(Qje)=>oP=Qje,createCommand:(Qje)=>sP=Qje,createOption:(Qje)=>aP=Qje,createArgument:(Qje)=>cP=Qje,Command:(Qje)=>lP=Qje,Option:(Qje)=>uP=Qje,Argument:(Qje)=>dP=Qje,Help:(Qje)=>pP=Qje,CommanderError:(Qje)=>mP=Qje,InvalidArgumentError:(Qje)=>fP=Qje,InvalidOptionArgumentError:(Qje)=>gP=Qje});var{Argument:nP}=Jy(),{Command:$0}=tP(),{CommanderError:Sre,InvalidArgumentError:rP}=Wf(),{Help:Dre}=R0(),{Option:iP}=T0();var oP=new $0,sP=(e)=>new $0(e),aP=(e,t)=>new iP(e,t),cP=(e,t)=>new nP(e,t),lP=$0,uP=iP,dP=nP,pP=Dre,mP=Sre,fP=rP,gP=rP;var{program:Fje,createCommand:Lje,createArgument:Uje,createOption:Mje,CommanderError:AP,InvalidArgumentError:jje,InvalidOptionArgumentError:zje,Command:hP,Argument:Gje,Option:Hje,Help:Jje}=P0;var Ky={name:"@sequenzy/cli",version:"0.0.215",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun ../../scripts/build-ink-cli.ts",start:"node dist/index.js",lint:"eslint src","type-check":"bun check",test:"sh ../../scripts/run-package-tests.sh src","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0",yaml:"^2.8.2"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as Lge}from"node:util";import uj from"node:process";import Fu from"node:fs";import dj from"node:path";import Eg from"node:crypto";import Uge from"node:assert";var Tu=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var Q0=new Set(["__proto__","prototype","constructor"]),xre=new Set("0123456789");function Vy(e){let t=[],n="",r="start",i=!1;for(let o of e)switch(o){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(i)n+=o;r="property",i=!i;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(i){i=!1,n+=o;break}if(Q0.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(i){i=!1,n+=o;break}if(r==="property"){if(Q0.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!xre.has(o))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(i)i=!1,n+="\\";n+=o}}if(i)n+="\\";switch(r){case"property":{if(Q0.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function q0(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function yP(e,t){if(q0(e,t))throw Error("Cannot use string index")}function bP(e,t,n){if(!Tu(e)||typeof t!=="string")return n===void 0?e:n;let r=Vy(t);if(r.length===0)return n;for(let i=0;i<r.length;i++){let o=r[i];if(q0(e,o))e=i===r.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(i!==r.length-1)return n;break}}return e===void 0?n:e}function F0(e,t,n){if(!Tu(e)||typeof t!=="string")return e;let r=e,i=Vy(t);for(let o=0;o<i.length;o++){let c=i[o];if(yP(e,c),o===i.length-1)e[c]=n;else if(!Tu(e[c]))e[c]=typeof i[o+1]==="number"?[]:{};e=e[c]}return r}function vP(e,t){if(!Tu(e)||typeof t!=="string")return!1;let n=Vy(t);for(let r=0;r<n.length;r++){let i=n[r];if(yP(e,i),r===n.length-1)return delete e[i],!0;if(e=e[i],!Tu(e))return!1}}function EP(e,t){if(!Tu(e)||typeof t!=="string")return!1;let n=Vy(t);if(n.length===0)return!1;for(let r of n){if(!Tu(e)||!(r in e)||q0(e,r))return!1;e=e[r]}return!0}import er from"node:path";import IP from"node:os";import L0 from"node:process";var tl=IP.homedir(),U0=IP.tmpdir(),{env:fp}=L0,Bre=(e)=>{let t=er.join(tl,"Library");return{data:er.join(t,"Application Support",e),config:er.join(t,"Preferences",e),cache:er.join(t,"Caches",e),log:er.join(t,"Logs",e),temp:er.join(U0,e)}},kre=(e)=>{let t=fp.APPDATA||er.join(tl,"AppData","Roaming"),n=fp.LOCALAPPDATA||er.join(tl,"AppData","Local");return{data:er.join(n,e,"Data"),config:er.join(t,e,"Config"),cache:er.join(n,e,"Cache"),log:er.join(n,e,"Log"),temp:er.join(U0,e)}},Rre=(e)=>{let t=er.basename(tl);return{data:er.join(fp.XDG_DATA_HOME||er.join(tl,".local","share"),e),config:er.join(fp.XDG_CONFIG_HOME||er.join(tl,".config"),e),cache:er.join(fp.XDG_CACHE_HOME||er.join(tl,".cache"),e),log:er.join(fp.XDG_STATE_HOME||er.join(tl,".local","state"),e),temp:er.join(U0,t,e)}};function M0(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(L0.platform==="darwin")return Bre(e);if(L0.platform==="win32")return kre(e);return Rre(e)}import Fre from"node:path";import an from"node:fs";import{promisify as Bi}from"node:util";var Tre=(e,t)=>{let{onError:n}=t;return function(...i){return e.apply(void 0,i).catch(n)}},ha=Tre;var Ore=(e,t)=>{let{onError:n}=t;return function(...i){try{return e.apply(void 0,i)}catch(o){return n(o)}}},ks=Ore;var CP=250;var Nre=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:o}=i,c=i.interval??CP,l=Date.now()+o;return function d(...m){return e.apply(void 0,m).catch((A)=>{if(!n(A))throw A;if(Date.now()>=l)throw A;let y=Math.round(c*Math.random());if(y>0)return new Promise((v)=>setTimeout(v,y)).then(()=>d.apply(void 0,m));else return d.apply(void 0,m)})}}},ya=Nre;var $re=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:o}=i,c=Date.now()+o;return function(...d){while(!0)try{return e.apply(void 0,d)}catch(m){if(!n(m))throw m;if(Date.now()>=c)throw m;continue}}}},ba=$re;import SP from"node:process";var Yf={isChangeErrorOk:(e)=>{if(!Yf.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!wP&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Yf.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!Yf.isNodeError(e))throw e;if(Yf.isChangeErrorOk(e))return;throw e}},j0=Yf;var Zf={onError:j0.onChangeError},ao={onError:()=>{return}},wP=SP.getuid?!SP.getuid():!1,Ii={isRetriable:j0.isRetriableError};var Pre={attempt:{chmod:ha(Bi(an.chmod),Zf),chown:ha(Bi(an.chown),Zf),close:ha(Bi(an.close),ao),fsync:ha(Bi(an.fsync),ao),mkdir:ha(Bi(an.mkdir),ao),realpath:ha(Bi(an.realpath),ao),stat:ha(Bi(an.stat),ao),unlink:ha(Bi(an.unlink),ao),chmodSync:ks(an.chmodSync,Zf),chownSync:ks(an.chownSync,Zf),closeSync:ks(an.closeSync,ao),existsSync:ks(an.existsSync,ao),fsyncSync:ks(an.fsync,ao),mkdirSync:ks(an.mkdirSync,ao),realpathSync:ks(an.realpathSync,ao),statSync:ks(an.statSync,ao),unlinkSync:ks(an.unlinkSync,ao)},retry:{close:ya(Bi(an.close),Ii),fsync:ya(Bi(an.fsync),Ii),open:ya(Bi(an.open),Ii),readFile:ya(Bi(an.readFile),Ii),rename:ya(Bi(an.rename),Ii),stat:ya(Bi(an.stat),Ii),write:ya(Bi(an.write),Ii),writeFile:ya(Bi(an.writeFile),Ii),closeSync:ba(an.closeSync,Ii),fsyncSync:ba(an.fsyncSync,Ii),openSync:ba(an.openSync,Ii),readFileSync:ba(an.readFileSync,Ii),renameSync:ba(an.renameSync,Ii),statSync:ba(an.statSync,Ii),writeSync:ba(an.writeSync,Ii),writeFileSync:ba(an.writeFileSync,Ii)}},oi=Pre;import Ou from"node:process";var DP="utf8",z0=438,_P=511;var xP={},BP=Ou.geteuid?Ou.geteuid():-1,kP=Ou.getegid?Ou.getegid():-1;var RP=1000,TP=!!Ou.getuid,wze=Ou.getuid?!Ou.getuid():!1,G0=128;var OP=(e)=>e instanceof Error&&("code"in e);var H0=(e)=>typeof e==="string",Wy=(e)=>e===void 0;import qre from"node:path";import gp from"node:process";import NP from"node:process";var $P=NP.platform==="linux",Yy=NP.platform==="win32";var J0=["SIGHUP","SIGINT","SIGTERM"];if(!Yy)J0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if($P)J0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var PP=J0;class QP{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Yy&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))gp.kill(gp.pid,"SIGTERM");else gp.kill(gp.pid,e)},this.hook=()=>{gp.once("exit",()=>this.exit());for(let e of PP)try{gp.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var qP=new QP;var Qre=qP.register,FP=Qre;var Oo={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",i=`.tmp-${n}${t}`;return`${e}${i}`},get:(e,t,n=!0)=>{let r=Oo.truncate(t(e));if(r in Oo.store)return Oo.get(e,t,n);return Oo.store[r]=n,[r,()=>delete Oo.store[r]]},purge:(e)=>{if(!Oo.store[e])return;delete Oo.store[e],oi.attempt.unlink(e)},purgeSync:(e)=>{if(!Oo.store[e])return;delete Oo.store[e],oi.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Oo.store)Oo.purgeSync(e)},truncate:(e)=>{let t=qre.basename(e);if(t.length<=G0)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-G0;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};FP(Oo.purgeSyncAll);var Xf=Oo;function K0(e,t,n=xP){if(H0(n))return K0(e,t,{encoding:n});let i={timeout:n.timeout??RP},o=null,c=null,l=null;try{let d=oi.attempt.realpathSync(e),m=!!d;e=d||e,[c,o]=Xf.get(e,n.tmpCreate||Xf.create,n.tmpPurge!==!1);let A=TP&&Wy(n.chown),y=Wy(n.mode);if(m&&(A||y)){let b=oi.attempt.statSync(e);if(b){if(n={...n},A)n.chown={uid:b.uid,gid:b.gid};if(y)n.mode=b.mode}}if(!m){let b=Fre.dirname(e);oi.attempt.mkdirSync(b,{mode:_P,recursive:!0})}if(l=oi.retry.openSync(i)(c,"w",n.mode||z0),n.tmpCreated)n.tmpCreated(c);if(H0(t))oi.retry.writeSync(i)(l,t,0,n.encoding||DP);else if(!Wy(t))oi.retry.writeSync(i)(l,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)oi.retry.fsyncSync(i)(l);else oi.attempt.fsync(l);if(oi.retry.closeSync(i)(l),l=null,n.chown&&(n.chown.uid!==BP||n.chown.gid!==kP))oi.attempt.chownSync(c,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==z0)oi.attempt.chmodSync(c,n.mode);try{oi.retry.renameSync(i)(c,e)}catch(b){if(!OP(b))throw b;if(b.code!=="ENAMETOOLONG")throw b;oi.retry.renameSync(i)(c,Xf.truncate(e))}o(),c=null}finally{if(l)oi.attempt.closeSync(l);if(c)Xf.purge(c)}}var mj=Et(WL(),1),fj=Et(yU(),1);var Ope=(e,t,n,r)=>{if(n==="length"||n==="prototype")return;if(n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);if(!Npe(i,o)&&r)return;Object.defineProperty(e,n,o)},Npe=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},$pe=(e,t)=>{let n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,n)},Ppe=(e,t)=>`/* Wrapped ${e}*/
|
|
332
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=jI(e),n=Rm(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=jI(e),n=Rm(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((n)=>n.type==="newline"||n.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}LNe.Parser=e9});var o9=P(function(VNe){var t9=tR(),MNe=NA(),LA=$A(),jNe=dk(),zNe=nn(),GNe=dR(),n9=pR();function r9(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new GNe.LineCounter||null,prettyErrors:t}}function HNe(e,t={}){let{lineCounter:n,prettyErrors:r}=r9(t),i=new n9.Parser(n?.addNewLine),o=new t9.Composer(t),c=Array.from(o.compose(i.parse(e)));if(r&&n)for(let l of c)l.errors.forEach(LA.prettifyError(e,n)),l.warnings.forEach(LA.prettifyError(e,n));if(c.length>0)return c;return Object.assign([],{empty:!0},o.streamInfo())}function i9(e,t={}){let{lineCounter:n,prettyErrors:r}=r9(t),i=new n9.Parser(n?.addNewLine),o=new t9.Composer(t),c=null;for(let l of o.compose(i.parse(e),!0,e.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new LA.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(r&&n)c.errors.forEach(LA.prettifyError(e,n)),c.warnings.forEach(LA.prettifyError(e,n));return c}function JNe(e,t,n){let r=void 0;if(typeof t==="function")r=t;else if(n===void 0&&t&&typeof t==="object")n=t;let i=i9(e,n);if(!i)return null;if(i.warnings.forEach((o)=>jNe.warn(i.options.logLevel,o)),i.errors.length>0)if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:r},n))}function KNe(e,t,n){let r=null;if(typeof t==="function"||Array.isArray(t))r=t;else if(n===void 0&&t)n=t;if(typeof n==="string")n=n.length;if(typeof n==="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){let{keepUndefined:i}=n??t??{};if(!i)return}if(zNe.isDocument(e)&&!r)return e.toString(n);return new MNe.Document(e,r,n).toString(n)}VNe.parse=JNe;VNe.parseAllDocuments=HNe;VNe.parseDocument=i9;VNe.stringify=KNe});var P0={};Vne(P0,{program:()=>oP,createCommand:()=>sP,createOption:()=>aP,createArgument:()=>cP,Command:()=>lP,Option:()=>uP,Argument:()=>dP,Help:()=>pP,CommanderError:()=>mP,InvalidArgumentError:()=>fP,InvalidOptionArgumentError:()=>gP},{program:(Qje)=>oP=Qje,createCommand:(Qje)=>sP=Qje,createOption:(Qje)=>aP=Qje,createArgument:(Qje)=>cP=Qje,Command:(Qje)=>lP=Qje,Option:(Qje)=>uP=Qje,Argument:(Qje)=>dP=Qje,Help:(Qje)=>pP=Qje,CommanderError:(Qje)=>mP=Qje,InvalidArgumentError:(Qje)=>fP=Qje,InvalidOptionArgumentError:(Qje)=>gP=Qje});var{Argument:nP}=Jy(),{Command:$0}=tP(),{CommanderError:Sre,InvalidArgumentError:rP}=Wf(),{Help:Dre}=R0(),{Option:iP}=T0();var oP=new $0,sP=(e)=>new $0(e),aP=(e,t)=>new iP(e,t),cP=(e,t)=>new nP(e,t),lP=$0,uP=iP,dP=nP,pP=Dre,mP=Sre,fP=rP,gP=rP;var{program:Fje,createCommand:Lje,createArgument:Uje,createOption:Mje,CommanderError:AP,InvalidArgumentError:jje,InvalidOptionArgumentError:zje,Command:hP,Argument:Gje,Option:Hje,Help:Jje}=P0;var Ky={name:"@sequenzy/cli",version:"0.0.217",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun ../../scripts/build-ink-cli.ts",start:"node dist/index.js",lint:"eslint src","type-check":"bun check",test:"sh ../../scripts/run-package-tests.sh src","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0",yaml:"^2.8.2"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as Lge}from"node:util";import uj from"node:process";import Fu from"node:fs";import dj from"node:path";import Eg from"node:crypto";import Uge from"node:assert";var Tu=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var Q0=new Set(["__proto__","prototype","constructor"]),xre=new Set("0123456789");function Vy(e){let t=[],n="",r="start",i=!1;for(let o of e)switch(o){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(i)n+=o;r="property",i=!i;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(i){i=!1,n+=o;break}if(Q0.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(i){i=!1,n+=o;break}if(r==="property"){if(Q0.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!xre.has(o))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(i)i=!1,n+="\\";n+=o}}if(i)n+="\\";switch(r){case"property":{if(Q0.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function q0(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function yP(e,t){if(q0(e,t))throw Error("Cannot use string index")}function bP(e,t,n){if(!Tu(e)||typeof t!=="string")return n===void 0?e:n;let r=Vy(t);if(r.length===0)return n;for(let i=0;i<r.length;i++){let o=r[i];if(q0(e,o))e=i===r.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(i!==r.length-1)return n;break}}return e===void 0?n:e}function F0(e,t,n){if(!Tu(e)||typeof t!=="string")return e;let r=e,i=Vy(t);for(let o=0;o<i.length;o++){let c=i[o];if(yP(e,c),o===i.length-1)e[c]=n;else if(!Tu(e[c]))e[c]=typeof i[o+1]==="number"?[]:{};e=e[c]}return r}function vP(e,t){if(!Tu(e)||typeof t!=="string")return!1;let n=Vy(t);for(let r=0;r<n.length;r++){let i=n[r];if(yP(e,i),r===n.length-1)return delete e[i],!0;if(e=e[i],!Tu(e))return!1}}function EP(e,t){if(!Tu(e)||typeof t!=="string")return!1;let n=Vy(t);if(n.length===0)return!1;for(let r of n){if(!Tu(e)||!(r in e)||q0(e,r))return!1;e=e[r]}return!0}import er from"node:path";import IP from"node:os";import L0 from"node:process";var tl=IP.homedir(),U0=IP.tmpdir(),{env:fp}=L0,Bre=(e)=>{let t=er.join(tl,"Library");return{data:er.join(t,"Application Support",e),config:er.join(t,"Preferences",e),cache:er.join(t,"Caches",e),log:er.join(t,"Logs",e),temp:er.join(U0,e)}},kre=(e)=>{let t=fp.APPDATA||er.join(tl,"AppData","Roaming"),n=fp.LOCALAPPDATA||er.join(tl,"AppData","Local");return{data:er.join(n,e,"Data"),config:er.join(t,e,"Config"),cache:er.join(n,e,"Cache"),log:er.join(n,e,"Log"),temp:er.join(U0,e)}},Rre=(e)=>{let t=er.basename(tl);return{data:er.join(fp.XDG_DATA_HOME||er.join(tl,".local","share"),e),config:er.join(fp.XDG_CONFIG_HOME||er.join(tl,".config"),e),cache:er.join(fp.XDG_CACHE_HOME||er.join(tl,".cache"),e),log:er.join(fp.XDG_STATE_HOME||er.join(tl,".local","state"),e),temp:er.join(U0,t,e)}};function M0(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(L0.platform==="darwin")return Bre(e);if(L0.platform==="win32")return kre(e);return Rre(e)}import Fre from"node:path";import an from"node:fs";import{promisify as Bi}from"node:util";var Tre=(e,t)=>{let{onError:n}=t;return function(...i){return e.apply(void 0,i).catch(n)}},ha=Tre;var Ore=(e,t)=>{let{onError:n}=t;return function(...i){try{return e.apply(void 0,i)}catch(o){return n(o)}}},ks=Ore;var CP=250;var Nre=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:o}=i,c=i.interval??CP,l=Date.now()+o;return function d(...m){return e.apply(void 0,m).catch((A)=>{if(!n(A))throw A;if(Date.now()>=l)throw A;let y=Math.round(c*Math.random());if(y>0)return new Promise((v)=>setTimeout(v,y)).then(()=>d.apply(void 0,m));else return d.apply(void 0,m)})}}},ya=Nre;var $re=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:o}=i,c=Date.now()+o;return function(...d){while(!0)try{return e.apply(void 0,d)}catch(m){if(!n(m))throw m;if(Date.now()>=c)throw m;continue}}}},ba=$re;import SP from"node:process";var Yf={isChangeErrorOk:(e)=>{if(!Yf.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!wP&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Yf.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!Yf.isNodeError(e))throw e;if(Yf.isChangeErrorOk(e))return;throw e}},j0=Yf;var Zf={onError:j0.onChangeError},ao={onError:()=>{return}},wP=SP.getuid?!SP.getuid():!1,Ii={isRetriable:j0.isRetriableError};var Pre={attempt:{chmod:ha(Bi(an.chmod),Zf),chown:ha(Bi(an.chown),Zf),close:ha(Bi(an.close),ao),fsync:ha(Bi(an.fsync),ao),mkdir:ha(Bi(an.mkdir),ao),realpath:ha(Bi(an.realpath),ao),stat:ha(Bi(an.stat),ao),unlink:ha(Bi(an.unlink),ao),chmodSync:ks(an.chmodSync,Zf),chownSync:ks(an.chownSync,Zf),closeSync:ks(an.closeSync,ao),existsSync:ks(an.existsSync,ao),fsyncSync:ks(an.fsync,ao),mkdirSync:ks(an.mkdirSync,ao),realpathSync:ks(an.realpathSync,ao),statSync:ks(an.statSync,ao),unlinkSync:ks(an.unlinkSync,ao)},retry:{close:ya(Bi(an.close),Ii),fsync:ya(Bi(an.fsync),Ii),open:ya(Bi(an.open),Ii),readFile:ya(Bi(an.readFile),Ii),rename:ya(Bi(an.rename),Ii),stat:ya(Bi(an.stat),Ii),write:ya(Bi(an.write),Ii),writeFile:ya(Bi(an.writeFile),Ii),closeSync:ba(an.closeSync,Ii),fsyncSync:ba(an.fsyncSync,Ii),openSync:ba(an.openSync,Ii),readFileSync:ba(an.readFileSync,Ii),renameSync:ba(an.renameSync,Ii),statSync:ba(an.statSync,Ii),writeSync:ba(an.writeSync,Ii),writeFileSync:ba(an.writeFileSync,Ii)}},oi=Pre;import Ou from"node:process";var DP="utf8",z0=438,_P=511;var xP={},BP=Ou.geteuid?Ou.geteuid():-1,kP=Ou.getegid?Ou.getegid():-1;var RP=1000,TP=!!Ou.getuid,wze=Ou.getuid?!Ou.getuid():!1,G0=128;var OP=(e)=>e instanceof Error&&("code"in e);var H0=(e)=>typeof e==="string",Wy=(e)=>e===void 0;import qre from"node:path";import gp from"node:process";import NP from"node:process";var $P=NP.platform==="linux",Yy=NP.platform==="win32";var J0=["SIGHUP","SIGINT","SIGTERM"];if(!Yy)J0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if($P)J0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var PP=J0;class QP{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Yy&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))gp.kill(gp.pid,"SIGTERM");else gp.kill(gp.pid,e)},this.hook=()=>{gp.once("exit",()=>this.exit());for(let e of PP)try{gp.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var qP=new QP;var Qre=qP.register,FP=Qre;var Oo={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",i=`.tmp-${n}${t}`;return`${e}${i}`},get:(e,t,n=!0)=>{let r=Oo.truncate(t(e));if(r in Oo.store)return Oo.get(e,t,n);return Oo.store[r]=n,[r,()=>delete Oo.store[r]]},purge:(e)=>{if(!Oo.store[e])return;delete Oo.store[e],oi.attempt.unlink(e)},purgeSync:(e)=>{if(!Oo.store[e])return;delete Oo.store[e],oi.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Oo.store)Oo.purgeSync(e)},truncate:(e)=>{let t=qre.basename(e);if(t.length<=G0)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-G0;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};FP(Oo.purgeSyncAll);var Xf=Oo;function K0(e,t,n=xP){if(H0(n))return K0(e,t,{encoding:n});let i={timeout:n.timeout??RP},o=null,c=null,l=null;try{let d=oi.attempt.realpathSync(e),m=!!d;e=d||e,[c,o]=Xf.get(e,n.tmpCreate||Xf.create,n.tmpPurge!==!1);let A=TP&&Wy(n.chown),y=Wy(n.mode);if(m&&(A||y)){let b=oi.attempt.statSync(e);if(b){if(n={...n},A)n.chown={uid:b.uid,gid:b.gid};if(y)n.mode=b.mode}}if(!m){let b=Fre.dirname(e);oi.attempt.mkdirSync(b,{mode:_P,recursive:!0})}if(l=oi.retry.openSync(i)(c,"w",n.mode||z0),n.tmpCreated)n.tmpCreated(c);if(H0(t))oi.retry.writeSync(i)(l,t,0,n.encoding||DP);else if(!Wy(t))oi.retry.writeSync(i)(l,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)oi.retry.fsyncSync(i)(l);else oi.attempt.fsync(l);if(oi.retry.closeSync(i)(l),l=null,n.chown&&(n.chown.uid!==BP||n.chown.gid!==kP))oi.attempt.chownSync(c,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==z0)oi.attempt.chmodSync(c,n.mode);try{oi.retry.renameSync(i)(c,e)}catch(b){if(!OP(b))throw b;if(b.code!=="ENAMETOOLONG")throw b;oi.retry.renameSync(i)(c,Xf.truncate(e))}o(),c=null}finally{if(l)oi.attempt.closeSync(l);if(c)Xf.purge(c)}}var mj=Et(WL(),1),fj=Et(yU(),1);var Ope=(e,t,n,r)=>{if(n==="length"||n==="prototype")return;if(n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);if(!Npe(i,o)&&r)return;Object.defineProperty(e,n,o)},Npe=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},$pe=(e,t)=>{let n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,n)},Ppe=(e,t)=>`/* Wrapped ${e}*/
|
|
333
333
|
${t}`,Qpe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),qpe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Fpe=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,i=Ppe.bind(null,r,t.toString());Object.defineProperty(i,"name",qpe);let{writable:o,enumerable:c,configurable:l}=Qpe;Object.defineProperty(e,"toString",{value:i,writable:o,enumerable:c,configurable:l})};function WD(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let i of Reflect.ownKeys(t))Ope(e,t,i,n);return $pe(e,t),Fpe(e,t,r),e}var Lpe=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:n=0,maxWait:r=Number.POSITIVE_INFINITY,before:i=!1,after:o=!0}=t;if(n<0||r<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!o)throw Error("Both `before` and `after` are false, function wouldn't be called.");let c,l,d,m=function(...A){let y=this,b=()=>{if(c=void 0,l)clearTimeout(l),l=void 0;if(o)d=e.apply(y,A)},v=()=>{if(l=void 0,c)clearTimeout(c),c=void 0;if(o)d=e.apply(y,A)},k=i&&!c;if(clearTimeout(c),c=setTimeout(b,n),r>0&&r!==Number.POSITIVE_INFINITY&&!l)l=setTimeout(v,r);if(k)d=e.apply(y,A);return d};return WD(m,e),m.cancel=()=>{if(c)clearTimeout(c),c=void 0;if(l)clearTimeout(l),l=void 0},m},YD=Lpe;var Lu=Et(sj(),1);var Oge=Object.prototype.toString;function cj(e,t,n){if(!e)return!1;if(e.constructor===t)return!0;return Oge.call(e)===n}function lj(e){return cj(e,Uint8Array,"[object Uint8Array]")}function Nge(e){return cj(e,ArrayBuffer,"[object ArrayBuffer]")}function $ge(e){return lj(e)||Nge(e)}function Pge(e){if(!lj(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function Qge(e){if(!$ge(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function d_(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,o)=>i+o.length,0);let n=new Uint8Array(t),r=0;for(let i of e)Pge(i),n.set(i,r),r+=i.length;return n}var aj={utf8:new globalThis.TextDecoder("utf8")};function p_(e,t="utf8"){return Qge(e),aj[t]??=new globalThis.TextDecoder(t),aj[t].decode(e)}function qge(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}var Fge=new globalThis.TextEncoder;function lv(e){return qge(e),Fge.encode(e)}var dJe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));var Mge=fj.default.default,pj="aes-256-cbc",Mp=()=>Object.create(null),jge=(e)=>e!==void 0&&e!==null,zge=(e,t)=>{let n=new Set(["undefined","symbol","function"]),r=typeof t;if(n.has(r))throw TypeError(`Setting a value of type \`${r}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},uv="__internal__",m_=`${uv}.migrations.version`;class dv{path;events;#r;#t;#e;#n={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=M0(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let o=new mj.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});Mge(o);let c={...t.rootSchema,type:"object",properties:t.schema};this.#r=o.compile(c);for(let[l,d]of Object.entries(t.schema??{}))if(d?.default)this.#n[l]=d.default}if(t.defaults)this.#n={...this.#n,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let n=t.fileExtension?`.${t.fileExtension}`:"";this.path=dj.resolve(t.cwd,`${t.configName??"config"}${n}`);let r=this.store,i=Object.assign(Mp(),t.defaults,r);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(i);try{Uge.deepEqual(r,i)}catch{this.store=i}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:n}=this;return e in n?n[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${uv} key, as it's used to manage this module internal operations.`);let{store:n}=this,r=(i,o)=>{if(zge(i,o),this.#e.accessPropertiesByDotNotation)F0(n,i,o);else n[i]=o};if(typeof e==="object"){let i=e;for(let[o,c]of Object.entries(i))r(o,c)}else r(e,t);this.store=n}has(e){if(this.#e.accessPropertiesByDotNotation)return EP(this.store,e);return e in this.store}reset(...e){for(let t of e)if(jge(this.#n[t]))this.set(t,this.#n[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)vP(t,e);else delete t[e];this.store=t}clear(){this.store=Mp();for(let e of Object.keys(this.#n))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=Fu.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),n=this._deserialize(t);return this._validate(n),Object.assign(Mp(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Mp();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Mp();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:p_(e);try{let t=e.slice(0,16),n=Eg.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),r=Eg.createDecipheriv(pj,n,t),i=e.slice(17),o=typeof i==="string"?lv(i):i;return p_(d_([r.update(o),r.final()]))}catch{}return e.toString()}_handleChange(e,t){let n=e(),r=()=>{let i=n,o=e();if(Lge(o,i))return;n=o,t.call(this,o,i)};return this.events.addEventListener("change",r),()=>{this.events.removeEventListener("change",r)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#r)return;if(this.#r(e)||!this.#r.errors)return;let n=this.#r.errors.map(({instancePath:r,message:i=""})=>`\`${r.slice(1)}\` ${i}`);throw Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){Fu.mkdirSync(dj.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let n=Eg.randomBytes(16),r=Eg.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),i=Eg.createCipheriv(pj,r,n);t=d_([n,lv(":"),i.update(lv(t)),i.final()])}if(uj.env.SNAP)Fu.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{K0(this.path,t,{mode:this.#e.configFileMode})}catch(n){if(n?.code==="EXDEV"){Fu.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw n}}_watch(){if(this._ensureDirectory(),!Fu.existsSync(this.path))this._write(Mp());if(uj.platform==="win32")Fu.watch(this.path,{persistent:!1},YD(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else Fu.watchFile(this.path,{persistent:!1},YD(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,n){let r=this._get(m_,"0.0.0"),i=Object.keys(e).filter((c)=>this._shouldPerformMigration(c,r,t)),o={...this.store};for(let c of i)try{if(n)n(this,{fromVersion:r,toVersion:c,finalVersion:t,versions:i});let l=e[c];l?.(this),this._set(m_,c),r=c,o={...this.store}}catch(l){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${l}`)}if(this._isVersionInRangeFormat(r)||!Lu.default.eq(r,t))this._set(m_,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===uv)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${uv}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return Lu.default.clean(e)===null}_shouldPerformMigration(e,t,n){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&Lu.default.satisfies(t,e))return!1;return Lu.default.satisfies(n,e)}if(Lu.default.lte(e,t))return!1;if(Lu.default.gt(e,n))return!1;return!0}_get(e,t){return bP(this.store,e,t)}_set(e,t){let{store:n}=this;F0(n,e,t),this.store=n}}var f_="com.sequenzy.cli",g_="api-key",A_=typeof globalThis.Bun<"u",Il=new dv({projectName:"sequenzy",schema:{userId:{type:"string"},userEmail:{type:"string"},_apiKey:{type:"string"}}});async function h_(){let e=process.env.SEQUENZY_API_KEY;if(e)return e;if(A_)try{let t=await globalThis.Bun.secrets.get({service:f_,name:g_});if(t)return t}catch{}return Il.get("_apiKey")}async function gj(e){if(A_)try{await globalThis.Bun.secrets.set({service:f_,name:g_,value:e,allowUnrestrictedAccess:!1});return}catch{}Il.set("_apiKey",e)}async function Aj(){if(A_)try{await globalThis.Bun.secrets.delete({service:f_,name:g_})}catch{}Il.delete("_apiKey")}async function j(){return!!await h_()}function pv(){return{userId:Il.get("userId"),userEmail:Il.get("userEmail")}}function hj(e){if(e.userId!==void 0)Il.set("userId",e.userId);if(e.userEmail!==void 0)Il.set("userEmail",e.userEmail)}function yj(){Il.clear()}function mv(e,t=Date.now()){if(!e?.trim())return;let n=e.trim();if(/^\d+$/.test(n)){let i=Number(n);return Number.isSafeInteger(i)?i:void 0}if(!/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} [A-Z][a-z]{2} \d{4} \d{2}:\d{2}:\d{2} GMT$/.test(n))return;let r=Date.parse(n);if(!Number.isFinite(r)||new Date(r).toUTCString().slice(5)!==n.slice(5))return;return Math.max(0,Math.ceil((r-t)/1000))}function bj(e,t,n){if(e&&/^[A-Z][A-Z0-9_]{1,95}$/.test(e))return e;switch(t){case 0:return"NETWORK_ERROR";case 400:case 422:return"VALIDATION_ERROR";case 401:return"UNAUTHORIZED";case 403:return"FORBIDDEN";case 404:return"NOT_FOUND";case 409:return"CONFLICT";case 429:return"RATE_LIMITED";default:return t!==void 0?t>=500?"SERVER_ERROR":"HTTP_ERROR":n}}var vj=!1;function y_(e){vj=e}function jp(){return vj}var Gge=new Set([502,503,504]),Hge=[250,1000,2000],Jge=5000,Kge=(e)=>new Promise((t)=>setTimeout(t,e));async function Ej(e,t,{delaysMs:n=Hge,sleep:r=Kge}={}){let i=e==="GET"?n.length:0;for(let o=0;o<i;o+=1){let c=n[o]??0,l;try{l=await t()}catch{await r(c);continue}if(!Gge.has(l.status))return l;let d=(mv(l.headers.get("Retry-After"))??0)*1000;if(d>Jge)return l;await l.body?.cancel().catch(()=>{return}),await r(Math.max(c,d))}return t()}var Vge=process.env.SEQUENZY_API_URL??"https://api.sequenzy.com";class g extends Error{statusCode;rawDetails;code;retryAfterSeconds;constructor(e,t,n,r,i){super(e);this.statusCode=t;this.rawDetails=n;this.code=r;this.retryAfterSeconds=i;this.name="ApiError"}}function Wge(e,t){if(typeof e!=="string")return;if(typeof t!=="string"||t==="root")return e;let n=t.slice(1).replaceAll("/",".");return e.includes(`'${n}'`)?e:`${n}: ${e}`}function Yge(e){if(!e.trim())return{message:"Request failed"};try{let t=JSON.parse(e);if(typeof t==="string")return{message:t};if(!t||typeof t!=="object"||Array.isArray(t))return{message:"Request failed"};let n=t,r=n.error&&typeof n.error==="object"?n.error:void 0,i=r?.code??n.code,o=n.type==="validation"?Wge(n.summary,n.property):void 0,c=typeof n.error==="string"?n.error:typeof o==="string"?o:r?.message??n.message;return{message:typeof c==="string"?c:"Request failed",...typeof i==="string"?{code:i}:{}}}catch{return{message:e}}}var Ij=!1;function Zge(e,t){if(t||Ij)return;if(e.headers.get("x-sequenzy-company-defaulted")!=="true")return;let n=e.headers.get("x-sequenzy-company-id");if(!n||jp())return;Ij=!0,console.error(`Note: no --company was given, so this account API key used its default company ${n}. Pass --company <id> to choose one (sequenzy companies list shows the options).`)}async function E(e,t,n,r,i){let o=await h_();if(!o)throw new g("Not logged in. Run `sequenzy login` first.",401);let c={"Content-Type":"application/json",Authorization:`Bearer ${o}`,"x-sequenzy-client":`cli/${Ky.version}`};if(r)c["x-company-id"]=r;Object.assign(c,i);let l;try{l=await Ej(e,()=>fetch(`${Vge}${t}`,{method:e,headers:c,body:n?JSON.stringify(n):void 0}))}catch(d){throw new g(d instanceof Error?d.message:"Failed to reach Sequenzy API",0,void 0,"NETWORK_ERROR")}if(Zge(l,r),!l.ok){let d=await l.text(),m=Yge(d);throw new g(m.message,l.status,d,m.code,mv(l.headers.get("Retry-After")))}return l.json()}var v_="https://docs.sequenzy.com",pc=`${v_}/concepts/cli`,b_=`${v_}/authentication`,Cj="https://sequenzy.com/dashboard";function wj(e){if(e instanceof g)return{message:e.message,statusCode:e.statusCode,code:e.code,rawDetails:e.rawDetails};if(e instanceof Error)return{message:e.message};return{message:String(e)}}function Xge(e){let t=e.match(/api key is missing required scopes?:\s*(.+)$/i);if(!t?.[1])return[];return[...new Set(t[1].match(/[a-z_]+:[a-z_]+/gi)??[])]}function Sj(e){let t=wj(e),n=t.message.trim()||"Unknown error",r=n.toLowerCase(),i=t.rawDetails?.trim()||n;if(t.code==="CLI_AUTH_REQUIRED"||r.includes("not logged in"))return{title:"Authentication required",description:"This command needs a Sequenzy API key, but the CLI could not find one in your local login state or environment.",howToFix:"Run `sequenzy login` and approve the session, or set `SEQUENZY_API_KEY` for non-interactive environments.",docsUrl:pc,details:i};if(r.includes("already logged in"))return{title:"CLI already authenticated",description:"The CLI already has a saved Sequenzy login for this machine.",howToFix:"Run `sequenzy logout` first if you want to switch accounts, then run `sequenzy login` again.",docsUrl:pc,details:i};if(t.statusCode===401||t.code==="UNAUTHORIZED")return{title:"Authentication failed",description:"The request reached Sequenzy, but the current API key was rejected.",howToFix:"Run `sequenzy login` again, or replace the key with a valid personal API key that still has access to your account.",docsUrl:b_,details:i};if(t.code==="COMPANY_CREATE_REQUIRES_PERSONAL_KEY")return{title:"Personal account key required",description:"Company creation is account-level and cannot be performed with a company/workspace-scoped API key.",howToFix:"Create or use a personal account key beginning with `seq_user_` from Account → API Keys, replace `SEQUENZY_API_KEY`, and retry the same command; alternatively, create the company in the Sequenzy dashboard. Widening the current company key or switching companies will not fix this restriction.",docsUrl:b_,details:i};let o=Xge(n);if(o.length>0){let c=o.map((m)=>`\`${m}\``).join(", "),l=o.every((m)=>m.endsWith(":read"))?"the Read-only or Safer agent access preset":"Safer agent access when it covers the task, or Custom permissions",d=o.includes("api_keys:manage")?` This command manages API keys, so the missing scope cannot be granted through the API by the key that is missing it. If the active key has \`account:read\`, run \`sequenzy api-keys handoff\` (add \`--replaces current\` when rotating) to get a dashboard link that opens the create-key form prefilled, then give it to the workspace owner. It creates nothing and never prints a key. If handoff is also denied because \`account:read\` is missing, open ${Cj} directly and choose the matching API Keys page.`:"";return{title:"API key permission required",description:`The current API key is valid, but this operation requires the missing ${o.length===1?"scope":"scopes"}: ${c}.`,howToFix:`Permissions can be widened on the key you are already using - no new key and no re-login. Run \`sequenzy account\` to see the active key, its type, and its API Keys settings URL, then have the key owner enable ${c} there. Personal keys open Account → API Keys; company keys open workspace Settings → API Keys. If account metadata is unavailable, open ${Cj} directly and choose the matching API Keys page. When the active key type is \`company\` and it holds \`api_keys:manage\`, run \`sequenzy api-keys list --json\` and then \`sequenzy api-keys update <api-key-id> --scopes\` with the current scopes plus ${c}, or \`--preset\` covering all of them (${l}). Personal keys cannot be changed through \`sequenzy api-keys update\`. Both options replace the whole selection rather than merging. Retry the same command once the key is updated. Issuing a replacement key and swapping \`SEQUENZY_API_KEY\` also works but is not required.${d}`,docsUrl:pc,details:i}}if(t.statusCode===403||r.includes("access denied"))return{title:"Access denied",description:"The current API key is valid, but it does not have permission to perform this action or access the requested company.",howToFix:"Use an API key with access to the target company, or switch to a company you can access before retrying.",docsUrl:b_,details:i};if(t.statusCode===404||r.includes("not found"))return{title:"Requested resource not found",description:"Sequenzy could not find the company, template, campaign, sequence, or subscriber you asked for.",howToFix:"Double-check the ID or email value and list the resource first before retrying the command.",docsUrl:pc,details:i};if(t.statusCode===429||r.includes("rate limit"))return{title:"Rate limited",description:"Sequenzy temporarily slowed this request because too many requests were sent in a short period.",howToFix:"Wait a moment and retry. If an agent is looping, reduce the retry frequency before calling the CLI again.",docsUrl:pc,details:i};if(t.code==="AB_TEST_VARIANT_CONTENT_EDIT"||r.includes("update_ab_test_variant")&&(r.includes("a/b test")||r.includes("ab test")))return{title:"A/B variant copy cannot be edited here",description:n,howToFix:"Use `sequenzy ab-tests update-variant` with the `abTestId` and `variantId` from `sequenzy sequences get` or `sequenzy ab-tests get`. Repeat once per variant for a whole-step rewrite. If the sequence is live or the test has activity, pass `--confirm-live-change`. Do not retry with `sequenzy templates update` or `sequenzy sequences update-node`.",docsUrl:`${v_}/concepts/cli#editing-the-copy-of-a-sequence-ab-step`,details:i};if(r.includes("--subject")||r.includes("--template")||r.includes("is required"))return{title:"Invalid command input",description:"The CLI command arguments are incomplete or incompatible for this action.",howToFix:"Review the flags you passed, add the missing values, and run the command again.",docsUrl:pc,details:i};if(t.code==="NETWORK_ERROR"||r.includes("fetch failed")||r.includes("failed to initiate login"))return{title:"Network or configuration error",description:"The CLI could not reach the Sequenzy API or app URL from this environment.",howToFix:"Check your network connection and verify `SEQUENZY_API_URL` or `SEQUENZY_APP_URL` if you override them locally.",docsUrl:pc,details:i};if(t.statusCode&&t.statusCode>=500)return{title:"Sequenzy server error",description:"The request reached Sequenzy, but the server could not complete it successfully.",howToFix:"Retry once. If the error persists, keep the details below and check the docs before escalating.",docsUrl:pc,details:i};return{title:"Command failed",description:"The CLI could not complete the requested operation.",howToFix:"Review the details below, adjust the command or credentials, and retry.",docsUrl:pc,details:i}}function z(){return new g("Not logged in. Run `sequenzy login` first.",401,void 0,"CLI_AUTH_REQUIRED")}function Ig(e){let t=Sj(e);return[`Sequenzy CLI error: ${t.title}`,`Description: ${t.description}`,`How to fix: ${t.howToFix}`,`Docs: ${t.docsUrl}`,`Details: ${t.details}`].join(`
|
|
334
334
|
`)}function eAe(e){let t=wj(e),n=Sj(e),r=(t.rawDetails===t.message?n.description:t.message.trim())||n.description;return{success:!1,error:{code:bj(t.code,t.statusCode,"CLI_ERROR"),message:r.replace(/\bBearer\s+[^\s]+/gi,"Bearer [redacted]").replace(/\bseq_(?:user_)?[A-Za-z0-9_-]{8,}\b/g,"[redacted key]"),...t.statusCode!==void 0?{statusCode:t.statusCode}:{},howToFix:n.howToFix,docsUrl:n.docsUrl,...e instanceof g&&e.retryAfterSeconds!==void 0?{retryAfterSeconds:e.retryAfterSeconds}:{}}}}function T(e,t={}){console.error(t.json??jp()?JSON.stringify(eAe(e)):Ig(e))}import{readFileSync as tAe}from"node:fs";import{isatty as Dj}from"node:tty";var Cl;function _j(){Cl=void 0}function E_(e){if(new Set(e).size>1)throw new g("Only one text input may read stdin (-) per command. Use regular files for the other inputs.",400,void 0,"CLI_INVALID_INPUT")}async function xj(){if(Dj(0))throw new g("Pipe text into stdin when using a text file '-'.",400,void 0,"CLI_INVALID_INPUT");try{process.stdin.setEncoding("utf8");let e="";for await(let t of process.stdin)e+=String(t);Cl={text:e}}catch(e){throw new g(`Failed to read stdin: ${e instanceof Error?e.message:"Unknown error"}`,400,void 0,"CLI_INPUT_READ_FAILED")}}function Bj(e,t){if(e==="-"){if(Cl){if(Cl.field)E_([Cl.field,t]);return Cl.field=t,Cl.text}if(Dj(0))throw new g(`Pipe text into stdin when using ${t} file '-'.`,400,void 0,"CLI_INVALID_INPUT")}try{let n=tAe(e==="-"?0:e,"utf8");if(e==="-")Cl={field:t,text:n};return n}catch(n){throw new g(`Failed to read ${t} file '${e}': ${n instanceof Error?n.message:"Unknown error"}`,400,void 0,"CLI_INPUT_READ_FAILED")}}function fv(e){return e.optsWithGlobals().json===!0||e.commands.some(fv)}async function nAe(e){y_(e.optsWithGlobals().json===!0),_j();let t=Object.entries(e.optsWithGlobals()).filter(([n,r])=>r==="-"&&n.endsWith("File")||n==="audienceJson"&&r==="@-").map(([n])=>n);if(e.parent?.name()==="subscribers"&&["import","events-import"].includes(e.name())&&e.args[0]==="-")t.push("subscriber import");if(E_(t),t.length>0)await xj()}function kj(e){let t=e.configureOutput().writeErr;e.configureOutput({writeErr:(n)=>{if(!fv(e))t?.(n)}}),e.exitOverride(),e.hook("preAction",(n,r)=>nAe(r))}async function Rj(e,t){y_(!1);try{await e.parseAsync(t)}catch(n){if(n instanceof AP){if(n.exitCode===0)return;if(fv(e))T(new g(n.message,400,void 0,"CLI_INVALID_INPUT"),{json:!0});process.exitCode=n.exitCode;return}T(n,{json:fv(e)}),process.exitCode=1}}var gv="Variant copy is edited with `sequenzy ab-tests update-variant`, not with `sequenzy sequences update-node`.";var Tj;function de(e,t,n){function r(l,d){if(!l._zod)Object.defineProperty(l,"_zod",{value:{def:d,constr:c,traits:new Set},enumerable:!1});if(l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let m=c.prototype,A=Object.keys(m);for(let y=0;y<A.length;y++){let b=A[y];if(!(b in l))l[b]=m[b].bind(l)}}let i=n?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function c(l){var d;let m=n?.Parent?new o:this;r(m,l),(d=m._zod).deferred??(d.deferred=[]);for(let A of m._zod.deferred)A();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:(l)=>{if(n?.Parent&&l instanceof n.Parent)return!0;return l?._zod?.traits?.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}var ZJe=Symbol("zod_brand");class mc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Cg extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Tj=globalThis).__zod_globalConfig??(Tj.__zod_globalConfig={});var zp=globalThis.__zod_globalConfig;function fc(e){if(e)Object.assign(zp,e);return zp}function hv(e){let t=Object.values(e).filter((r)=>typeof r==="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Sg(e,t){if(typeof t==="bigint")return t.toString();return t}function yv(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function bv(e){return e===null||e===void 0}function vv(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var Oj=Symbol("evaluating");function Cn(e,t,n){let r=void 0;Object.defineProperty(e,t,{get(){if(r===Oj)return;if(r===void 0)r=Oj,r=n();return r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Uu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function wl(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function C_(e){return JSON.stringify(e)}function Nj(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var w_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wg(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var $j=yv(()=>{if(zp.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Gp(e){if(wg(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let n=t.prototype;if(wg(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function S_(e){if(Gp(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Pj=new Set(["string","number","symbol"]);function Sl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Na(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function It(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Qj(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var rAe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function iAe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let o=wl(e._zod.def,{get shape(){let c={};for(let l in t){if(!(l in n.shape))throw Error(`Unrecognized key: "${l}"`);if(!t[l])continue;c[l]=n.shape[l]}return Uu(this,"shape",c),c},checks:[]});return Na(e,o)}function oAe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let o=wl(e._zod.def,{get shape(){let c={...e._zod.def.shape};for(let l in t){if(!(l in n.shape))throw Error(`Unrecognized key: "${l}"`);if(!t[l])continue;delete c[l]}return Uu(this,"shape",c),c},checks:[]});return Na(e,o)}function sAe(e,t){if(!Gp(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=e._zod.def.shape;for(let c in t)if(Object.getOwnPropertyDescriptor(o,c)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=wl(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Uu(this,"shape",o),o}});return Na(e,i)}function aAe(e,t){if(!Gp(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=wl(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return Uu(this,"shape",r),r}});return Na(e,n)}function cAe(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=wl(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Uu(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Na(e,n)}function lAe(e,t,n){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let c=wl(t._zod.def,{get shape(){let l=t._zod.def.shape,d={...l};if(n)for(let m in n){if(!(m in l))throw Error(`Unrecognized key: "${m}"`);if(!n[m])continue;d[m]=e?new e({type:"optional",innerType:l[m]}):l[m]}else for(let m in l)d[m]=e?new e({type:"optional",innerType:l[m]}):l[m];return Uu(this,"shape",d),d},checks:[]});return Na(t,c)}function uAe(e,t,n){let r=wl(t._zod.def,{get shape(){let i=t._zod.def.shape,o={...i};if(n)for(let c in n){if(!(c in o))throw Error(`Unrecognized key: "${c}"`);if(!n[c])continue;o[c]=new e({type:"nonoptional",innerType:i[c]})}else for(let c in i)o[c]=new e({type:"nonoptional",innerType:i[c]});return Uu(this,"shape",o),o}});return Na(t,r)}function Mu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function qj(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ev(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Av(e){return typeof e==="string"?e:e?.message}function gc(e,t,n){let r=e.message?e.message:Av(e.inst?._zod.def?.error?.(e))??Av(t?.error?.(e))??Av(n.customError?.(e))??Av(n.localeError?.(e))??"Invalid input",{inst:i,continue:o,input:c,...l}=e;if(l.path??(l.path=[]),l.message=r,t?.reportInput)l.input=c;return l}function Iv(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ju(...e){let[t,n,r]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:r};return{...t}}var Fj=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Sg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cv=de("$ZodError",Fj),D_=de("$ZodError",Fj,{Parent:Error});function Lj(e,t=(n)=>n.message){let n={},r=[];for(let i of e.issues)if(i.path.length>0)n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i));else r.push(t(i));return{formErrors:r,fieldErrors:n}}function Uj(e,t=(n)=>n.message){let n={_errors:[]},r=(i,o=[])=>{for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((l)=>r({issues:l},[...o,...c.path]));else if(c.code==="invalid_key")r({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")r({issues:c.issues},[...o,...c.path]);else{let l=[...o,...c.path];if(l.length===0)n._errors.push(t(c));else{let d=n,m=0;while(m<l.length){let A=l[m];if(m!==l.length-1)d[A]=d[A]||{_errors:[]};else d[A]=d[A]||{_errors:[]},d[A]._errors.push(t(c));d=d[A],m++}}}};return r(e),n}var wv=(e)=>(t,n,r,i)=>{let o=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new mc;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map((d)=>gc(d,o,fc())));throw w_(l,i?.callee),l}return c.value};var Sv=(e)=>async(t,n,r,i)=>{let o=r?{...r,async:!0}:{async:!0},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)c=await c;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map((d)=>gc(d,o,fc())));throw w_(l,i?.callee),l}return c.value};var Dg=(e)=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new mc;return o.issues.length?{success:!1,error:new(e??Cv)(o.issues.map((c)=>gc(c,i,fc())))}:{success:!0,data:o.value}},Mj=Dg(D_),_g=(e)=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)o=await o;return o.issues.length?{success:!1,error:new e(o.issues.map((c)=>gc(c,i,fc())))}:{success:!0,data:o.value}},jj=_g(D_),zj=(e)=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return wv(e)(t,n,i)};var Gj=(e)=>(t,n,r)=>wv(e)(t,n,r);var Hj=(e)=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return Sv(e)(t,n,i)};var Jj=(e)=>async(t,n,r)=>Sv(e)(t,n,r);var Kj=(e)=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return Dg(e)(t,n,i)};var Vj=(e)=>(t,n,r)=>Dg(e)(t,n,r);var Wj=(e)=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return _g(e)(t,n,i)};var Yj=(e)=>async(t,n,r)=>_g(e)(t,n,r);var Zj=/^[cC][0-9a-z]{6,}$/,Xj=/^[0-9a-z]+$/,ez=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tz=/^[0-9a-vA-V]{20}$/,nz=/^[A-Za-z0-9]{27}$/,rz=/^[a-zA-Z0-9_-]{21}$/,iz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var oz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,__=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var sz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var pAe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function az(){return new RegExp(pAe,"u")}var cz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var uz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,dz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,x_=/^[A-Za-z0-9_-]*$/;var mz=/^https?$/,fz=/^\+[1-9]\d{6,14}$/,gz="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Az=new RegExp(`^${gz}$`);function hz(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function yz(e){return new RegExp(`^${hz(e)}$`)}function bz(e){let t=hz({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${gz}T(?:${r})$`)}var vz=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Ez=/^[^A-Z]*$/,Iz=/^[^a-z]*$/;var No=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var Cz=de("$ZodCheckMaxLength",(e,t)=>{var n;No.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let i=r.value;return!bv(i)&&i.length!==void 0}),e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.length<=t.maximum)return;let c=Iv(i);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),wz=de("$ZodCheckMinLength",(e,t)=>{var n;No.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let i=r.value;return!bv(i)&&i.length!==void 0}),e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.length>=t.minimum)return;let c=Iv(i);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Sz=de("$ZodCheckLengthEquals",(e,t)=>{var n;No.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let i=r.value;return!bv(i)&&i.length!==void 0}),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=(r)=>{let i=r.value,o=i.length;if(o===t.length)return;let c=Iv(i),l=o>t.length;r.issues.push({origin:c,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),xg=de("$ZodCheckStringFormat",(e,t)=>{var n,r;if(No.init(e,t),e._zod.onattach.push((i)=>{let o=i._zod.bag;if(o.format=t.format,t.pattern)o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(i)=>{if(t.pattern.lastIndex=0,t.pattern.test(i.value))return;i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(r=e._zod).check??(r.check=()=>{})}),Dz=de("$ZodCheckRegex",(e,t)=>{xg.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_z=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ez),xg.init(e,t)}),xz=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Iz),xg.init(e,t)}),Bz=de("$ZodCheckIncludes",(e,t)=>{No.init(e,t);let n=Sl(t.includes),r=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((i)=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.includes(t.includes,t.position))return;i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),kz=de("$ZodCheckStartsWith",(e,t)=>{No.init(e,t);let n=new RegExp(`^${Sl(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.startsWith(t.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Rz=de("$ZodCheckEndsWith",(e,t)=>{No.init(e,t);let n=new RegExp(`.*${Sl(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.endsWith(t.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});var Tz=de("$ZodCheckOverwrite",(e,t)=>{No.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class B_{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
335
335
|
`).filter((o)=>o),r=Math.min(...n.map((o)=>o.length-o.trimStart().length)),i=n.map((o)=>o.slice(r)).map((o)=>" ".repeat(this.indent*2)+o);for(let o of i)this.content.push(o)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map((i)=>` ${i}`)];return new e(...t,r.join(`
|
|
@@ -523,4 +523,4 @@ ${o5}Quick Start${$i}
|
|
|
523
523
|
${Ja}$${$i} sequenzy websites guide --framework nextjs --use-case transactional`,c=`
|
|
524
524
|
${o5}Notes${$i}
|
|
525
525
|
${Ja}Generated content should be reviewed before sending.${$i}
|
|
526
|
-
${Ja}Use 'sequenzy --help' and '<command> --help' for detailed examples and caveats.${$i}`;console.log(n),console.log(r),console.log(),console.log(i),console.log(o),console.log(c),console.log()}var Ve=new hP;kj(Ve);Ve.name("sequenzy").description("Sequenzy CLI - Email marketing from the terminal").version(a5).showHelpAfterError().showSuggestionAfterError().action(Jqe);S(Ve,{notes:["Use --json on data commands when another tool or agent should parse structured output.","Dashboard-aware JSON responses include appUrls when a company ID can be resolved.","Company-scoped commands accept --company for personal API keys that can access multiple companies.","Content commands prefer file flags such as --html-file, --blocks-file, --steps-file, and --emails-file to avoid shell escaping issues.","Sequence creation supports --goal for AI generation or explicit step JSON."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy campaigns update camp_123 --subject "Updated subject" --html-file ./campaign.html',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy urls --company comp_123 --sequence seq_123 --settings-tab integrations","sequenzy websites guide --framework nextjs --use-case transactional",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var Kqe=Ve.command("login").description("Log in to your Sequenzy account").action(J4);S(Kqe,{notes:["Starts device authentication and prints a verification URL plus approval code."],examples:["sequenzy login"]});var Vqe=Ve.command("logout").description("Log out of your Sequenzy account").action(K4);S(Vqe,{examples:["sequenzy logout"]});var Wqe=Ve.command("whoami").description("Show the locally stored Sequenzy identity").action(r5);S(Wqe,{notes:["This checks local CLI credential state only. Use 'sequenzy account' to make a live request and verify the active key, permissions, and company access."],examples:["sequenzy whoami"]});var Yqe=Ve.command("stats").description("Show account, campaign, sequence, or transactional email metrics").option("-p, --period <period>","Time period (7d, 30d, 90d)").option("--start <iso>","Start of custom time range (ISO 8601)").option("--end <iso>","End of custom time range (ISO 8601)").option("--campaign <id>","Get stats for a specific campaign").option("--sequence <id>","Get stats for a specific sequence").option("--transactional <id-or-slug>","Get stats for a saved transactional email").option("--email-type <type>","Filter account stats by campaign, transactional, or sequence").option("--emails","List per-email metrics: one row per campaign and per sequence email step").option("--clients","Show mail client and device shares of unique opens (account or --campaign)").option("--links","Show clicks per link destination across every email in the account").option("--step <number>","With --emails, keep only this 1-based sequence email step").option("--sort <field>","With --emails, sort by sent, delivered, opened, clicked, openRate, clickRate, unsubscribed, conversions, revenue, step, or name").option("--order <order>","With --emails, sort order: asc or desc").option("--page <number>","With --emails, page number").option("--limit <number>","With --emails, emails per page (maximum 500); with --links, links to show (maximum 50); with --by, rows (maximum 100)").option("--mailbox-provider <provider>","Filter by recipient mailbox provider (gmail, microsoft, yahoo, ...)").option("--recipient-domain <domain>","Filter account stats or --by to one recipient domain (gmail.com, ...)").option("--source <type:id>","Filter account stats or --by to campaign:<id>, sequence:<id>, sequence_step:<id> or transactional:<id>").option("--outcome <outcome>","Filter account stats or --by to sends that had permanent_bounce, temporary_bounce, blocked or complaint").option("--by <dimension>","Break the funnel down by email, sequence, email_type, mailbox_provider or recipient_domain").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including poll and NPS results").action(dZ);S(Yqe,{notes:["Use exactly one of account-level stats, --campaign, --sequence, or --transactional. --email-type applies only to account-level stats.","--mailbox-provider scopes account or campaign engagement metrics to one recipient mailbox provider (e.g. gmail, microsoft, yahoo); replies, conversions, and revenue cannot be segmented per provider and report 0 under this filter.","Saved transactional email stats are all-time by default; pass --period for a window.","Use --email-type transactional for Send API open and click rates; use 'email-sends get <id>' for one delivery.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement.","Sequence stats include per-step sent/delivered/opened/clicked counts, a live active/waiting enrollment breakdown by current node, and per-step failures.","--emails lists one row per campaign and per sequence email step, with totals across every matching email. Combine with --sequence (comma-separated) and --step to answer questions like 'how many step-4 emails went out across these sequences'.","--emails counts come from the retained event stream, so they are not limited to the 14-day `email-sends list` history. Omit --period for all-time totals.","Campaign stats include a Poll & NPS Results section when the email collected answers; use --json for the full polls array. Sequence stats show the same results per email step (steps[].polls in --json); list one step's respondents with 'poll-responses --campaign <step nodeId>'.","--clients shows which mail clients and devices opened your emails, as shares of unique opens (each send counts once, by its first open). Gmail, Yahoo, and Apple Mail privacy proxies hide the device. With --campaign it covers the whole campaign; account-level stats default to 90 days.","--by breaks the funnel down by email, sequence, email_type, mailbox_provider or recipient_domain (default 30 days, top 25). Each row prints the --source, --email-type, --mailbox-provider or --recipient-domain flag that drills into it; every row includes attributed revenue.","--outcome limits account stats or --by to sends that bounced that way or drew a spam complaint: permanent_bounce, temporary_bounce, blocked or complaint. Use it with --by email to see which emails the complaints or bounces came from; filtered responses report replies as 0.","--links ranks link destinations by clicks across every email (default 90 days, top 10). Query strings, fragments and trailing slashes are ignored, so UTM-tagged variants of a page count as one link. For one campaign's links, read clickedLinks from 'stats --campaign <id> --json'."],examples:["sequenzy stats","sequenzy stats --period 30d","sequenzy stats --emails --step 4","sequenzy stats --emails --sequence seq_1,seq_2 --step 4 --json","sequenzy stats --emails --email-type sequence --sort openRate --limit 20","sequenzy stats --campaign camp_123","sequenzy stats --campaign camp_123 --json","sequenzy stats --campaign camp_123 --include-bots","sequenzy stats --sequence seq_123","sequenzy stats --transactional password-reset","sequenzy stats --transactional password-reset --period 30d","sequenzy stats --email-type transactional --period 30d","sequenzy stats --mailbox-provider gmail --period 30d","sequenzy stats --campaign camp_123 --mailbox-provider yahoo","sequenzy stats --clients --period 30d","sequenzy stats --by sequence --period 30d","sequenzy stats --by email --source sequence:seq_123","sequenzy stats --by recipient_domain --source sequence:seq_123 --mailbox-provider microsoft","sequenzy stats --source sequence:seq_123 --recipient-domain outlook.com --json","sequenzy stats --by email --outcome complaint --period 7d","sequenzy stats --clients --campaign camp_123 --json","sequenzy stats --links --period 30d","sequenzy stats --links --email-type campaign --limit 25 --json"]});var HR=Ve.command("events").description("List raw campaign or sequence email events, or read event payload schemas").option("--campaign <id>","List events for a campaign").option("--sequence <id>","List events for a sequence").option("--automation-node-id <id>","Scope a --sequence stream to one email step").option("--type <type>","Single event type to include, such as delivery, open, or click").option("--event-types <types>","Comma-separated event types to include (default: delivery)").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Start of custom time range (ISO 8601)").option("--end <iso>","End of custom time range (ISO 8601)").option("--page <number>","Page number").option("--limit <number>","Events per page, capped by the API").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(T3);S(HR,{notes:["Use exactly one of --campaign or --sequence.","Defaults to delivery events. Use --event-types delivery,open,click when you need engagement events too.","--automation-node-id narrows a sequence stream to one email step; take the node ID from `stats --sequence <id>`.","This is the per-recipient stream. For per-step send totals use `stats --sequence <id>` or `stats --emails`, not a count of these pages.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy events --campaign camp_123","sequenzy events --sequence seq_123 --limit 100 --json","sequenzy events --sequence seq_123 --automation-node-id node_email_4","sequenzy events --campaign camp_123 --event-types delivery,click --period 30d","sequenzy events schema ecommerce.order_placed"]});HR.command("sample <event>").description("Read the latest received event payload in this workspace").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e,t)=>D3(e,t));var Zqe=HR.command("schema [event]").description("Show the published payload of a built-in event, or list documented events").option("--provider <provider>",_3).option("--example","Print the full sample payload as JSON").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e,t)=>B3(e,t));S(Zqe,{notes:["Read this before writing {{event.*}} merge tags or event property filters: an unrecognized merge tag renders as an empty string rather than an error.","Fields ending in Cents are minor units (8850 = $88.50); price is a preformatted display string, and predictedLtv is whole currency units.","Custom event names are supported everywhere even though they have no published payload here - `documented: false` never means the name is invalid.","This is static reference data. Use `sequenzy events sample <event>` to read the latest actual received payload."],examples:["sequenzy events schema","sequenzy events schema ecommerce.order_placed --provider shopify","sequenzy events schema ecommerce.browse_abandoned --example","sequenzy events schema ecommerce.cart_abandoned --json"]});var c5=Ve.command("blocks [type]").description("Show the fields each email block type accepts, or list every block type").option("--creatable-only","Hide structural block types the editor manages for you").option("--example","Print the example block as formatted JSON").option("--conditions","Also print the condition field, operator, and value table for this block type").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e,t)=>b3(e,t));c5.command("preview-cart").description("Suggest cart fields and generate preview-only scenarios without saving or sending").option("--items <json>","JSON array of actual event items").option("--items-file <path>","Read event items from a JSON file").option("--fields <json>","Existing itemFields mapping").option("--price-unit <unit>","Numeric price units: minor or major").option("--scenario <name>","real, one, many, empty, missing-images, or long-names","real").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(o3);S(c5,{notes:["Read this before hand-authoring a blocks array: the blocks parameter accepts a 37-type union, so field names are not guessable from the endpoint schema alone.",'Lists are their own block type, not a text variant. A numbered list is {"type":"list","variant":"numbered","items":[{"content":"First"}]}; a visual numbered walkthrough is {"type":"steps","variant":"numbered","items":[{"title":"Step one"},{"title":"Step two"}]}.',"`list` items carry `content`; `steps` items carry `title` and an optional `description`. The two are not interchangeable.","A `list` item nests under the item above it with `indent` 1 or 2 (leave it out for the top level), up to three levels deep.","Every block also takes a `conditions` array, and each condition field accepts only its own operators. `blocks conditional-group` prints that table unprompted; any other type takes --conditions, since it is longer than the block reference itself.","This is static reference data derived from the same schemas that validate a write, so it cannot drift from what the API accepts."],examples:["sequenzy blocks","sequenzy blocks --creatable-only","sequenzy blocks list","sequenzy blocks steps --example","sequenzy blocks hero --json","sequenzy blocks conditional-group","sequenzy blocks text --conditions"]});var Xqe=Ve.command("poll-responses").description("List individual Poll and NPS responses for a campaign").option("--campaign <id>","Campaign ID (required)").option("--block-id <id>","Scope to one poll block").option("--has-comment","Only respondents who left a comment").option("--page <number>","Page number").option("--limit <number>","Responses per page (maximum 500)").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(eK);S(Xqe,{notes:["Returns each respondent's latest answer per poll block with the response time, so counts match `stats --campaign <id>`.","Block IDs come from the polls array of `stats --campaign <id> --json`.","For a sequence email step, pass the step's automation node ID as --campaign.","Polls with a comment box show each respondent's latest comment under their answer, with the answer it was written under when that differs; --has-comment lists only respondents who commented.","Do not scan subscribers for the poll attribute instead: the attribute carries no response time and reflects the latest answer to any email."],examples:["sequenzy poll-responses --campaign camp_123","sequenzy poll-responses --campaign camp_123 --block-id poll_1 --has-comment","sequenzy poll-responses --campaign camp_123 --block-id poll_1 --json","sequenzy poll-responses --campaign camp_123 --limit 500 --page 2"]});var eFe=Ve.command("replies").description("List who replied to a campaign, newest first").option("--campaign <id>","Campaign ID (required)").option("--page <number>","Page number").option("--limit <number>","Replies per page (maximum 500)").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(PJ);S(eFe,{notes:["Lists one row per reply with the subscriber, reply time and attachment count, so the total matches the replies count of `stats --campaign <id>` without a period or provider filter.","Each row names the inbox conversation holding the reply; read it with `sequenzy inbox get <conversationId>`. A reply with no inbox conversation shows 'not in the inbox'.","Reply text is not included."],examples:["sequenzy replies --campaign camp_123","sequenzy replies --campaign camp_123 --json","sequenzy replies --campaign camp_123 --limit 500 --page 2","sequenzy inbox get conv_123"]});var tFe=Ve.command("urls").description("Generate Sequenzy dashboard URLs for known resource IDs").option("-c, --company <id>","Company ID").option("--campaign <id>","Campaign ID for campaign editor URL").option("--landing-page <id>","Landing page ID for landing page editor URL").option("--sequence <id>","Sequence ID for sequence editor URL").option("--template <id>","Template/email ID for email editor URL").option("--email <id>","Email ID for email editor URL").option("--transactional <id>","Transactional email ID").option("--email-send <id>","Email send ID").option("--domain <id>","Sending domain ID").option("--status <status>","Status for campaign/sequence list URLs").option("--settings-tab <tab>","Settings tab slug; billing/subscription opens Account -> Subscription").option("--json","Print JSON").action(vJ);S(tFe,{notes:["Uses SEQUENZY_APP_URL when set, otherwise https://sequenzy.com.","If --company is omitted, the CLI tries the current company from `sequenzy account`.","Useful after creating a campaign or sequence when the user wants a review/edit link."],examples:["sequenzy urls --company comp_123","sequenzy urls --company comp_123 --sequence seq_123","sequenzy urls --company comp_123 --campaign camp_123","sequenzy urls --company comp_123 --landing-page lp_123","sequenzy urls --company comp_123 --email-send send_123","sequenzy urls --company comp_123 --settings-tab integrations","sequenzy urls --company comp_123 --settings-tab billing","sequenzy urls --company comp_123 --json"]});var Xi=Ve.command("subscribers").description("Manage subscribers").action(()=>Xi.help());S(Xi,{notes:["Subscriber list fetches every page by default so agents do not silently miss later results.","`subscribers get` includes tags, list memberships, sequence enrollments, email stats, and recent activity.","--attr expects repeated key=value pairs. Example: --attr firstName=Ana --attr plan=pro","--attr sends strings. Use --attrs-json on add and update for numbers, booleans, lists, or strings with leading zeros such as zip codes. `subscribers attributes` lists the names and types already in use."],examples:["sequenzy subscribers list --tag vip",'sequenzy subscribers list --list "Master List" --json',"sequenzy subscribers list --tag vip --limit 25 --json","sequenzy subscribers add user@example.com --tag trial --attr firstName=Ana","sequenzy subscribers attributes","sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed","sequenzy subscribers import-status import_123 --json","sequenzy subscribers get user@example.com --json",'sequenzy subscribers notes add user@example.com --body "Customer prefers quarterly reports"',"sequenzy subscribers remove user@example.com --hard"]});var JR=Xi.command("operations").description("Run and monitor background audience tagging");JR.command("start").requiredOption("--kind <kind>","add_tags").option("--audience-json <json>","Audience filters or subscriberIds as JSON (supports @file)").option("--tag <tags...>","Tags to add").option("--trigger-automations","Trigger tag automations (requires automations:trigger)").option("--request-key <key>","Idempotency key; reuse after an uncertain start response").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e)=>WI("start",e));JR.command("list").option("-c, --company <id>").option("--json").action((e)=>WI("list",e));for(let e of["get","cancel"])JR.command(`${e} <id>`).option("-c, --company <id>").option("--json").action((t,n)=>WI(e,{...n,id:t}));var nFe=Xi.command("list").description("List subscribers").option("-s, --segment <id>","Filter by segment").option("-t, --tag <tag>","Filter by tag").option("--list <id-or-name>","Filter by subscriber list ID or exact name").option("--status <status>","active, not_subscribed, unsubscribed, bounced, or all").option("--unsubscribed-after <date>","Only contacts whose opt-out is on or after this ISO 8601 date or zoned datetime").option("--unsubscribed-before <date>","Only contacts whose opt-out is on or before this ISO 8601 date or zoned datetime").option("--attribute <name>",'Filter by custom attribute name, e.g. "plan". The "name:value" form also works').option("--attribute-value <value>","Value the custom attribute must match").option("--attribute-operator <operator>","is, contains, gt, gte, lt, lte, or is_not_empty (default: is)").option("-l, --limit <number>","Maximum results to return").option("--offset <number>","Matches to skip (maximum 999999; use --cursor for deeper pagination)").option("--page <number>","1-based page number; requires --limit").option("--cursor <token>","pagination.nextCursor from the previous response; cheaper than --offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>yo("list",e));S(nFe,{notes:["Without --limit the command walks every page and returns all matches in one call.","With --limit, page through the audience by re-running with --cursor set to the previous response's pagination.nextCursor. Fall back to --offset (or --page) when nextCursor is null.","--attribute filters on ClickHouse-backed custom attributes and cannot be combined with --segment. Use a saved segment for compound or is_not/is_empty attribute filters.","--unsubscribed-after/--unsubscribed-before match the opt-out date and exclude contacts that have none: active contacts, and contacts imported as already unsubscribed. Bare dates use UTC midnight; datetimes must include Z or an explicit offset."],examples:["sequenzy subscribers list",'sequenzy subscribers list --list "Master List"',"sequenzy subscribers list --segment seg_123","sequenzy subscribers list --tag onboarding --limit 100","sequenzy subscribers list --status unsubscribed --unsubscribed-after 2026-07-01 --json","sequenzy subscribers list --limit 50 --json","sequenzy subscribers list --limit 50 --cursor NEXT_CURSOR --json","sequenzy subscribers list --limit 50 --offset 50 --json","sequenzy subscribers list --attribute plan --attribute-value pro","sequenzy subscribers list --attribute mrr --attribute-value 50 --attribute-operator gte","sequenzy subscribers list --attribute prem_rouge_sample_received --attribute-operator is_not_empty --json"]});var rFe=Xi.command("add [email]").description("Add or upsert a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--phone <phone>","Phone number (E.164 or national). With no email, creates a phone-only SMS contact").option("--phone-country <country>","Two-letter country used to read a national-format --phone (default US)").option("--sms-consent","Record express written SMS marketing consent for the phone number").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("--timezone <zone>","IANA timezone (e.g. America/New_York) used for recipient-local campaign delivery").option("-t, --tag <tags...>","Tags to apply").option("-l, --list <ids...>","List IDs to add the subscriber to").option("--no-lists","Add the subscriber to no lists").option("--skip-sequences","Do not enroll the subscriber in matching sequences").option("--enroll-sequences","Enroll matching sequences, including when --created-at is supplied (requires automations:trigger)").option("-a, --attr <attrs...>","Attributes (key=value)").option("--attrs-json <json>",`Attributes as a JSON object that keeps value types, e.g. '{"zip":"02134","seats":5}'`).option("--created-at <iso-date>","Original signup date when importing history from another platform (only ever moves an existing contact's date earlier; skips sequences unless --enroll-sequences is passed)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("add",{email:e,...t,noLists:t.lists===!1}));S(rFe,{examples:["sequenzy subscribers add user@example.com","sequenzy subscribers add user@example.com --first-name Ana --tag trial --attr plan=pro",`sequenzy subscribers add user@example.com --attrs-json '{"zip":"02134","seats":5,"vip":true}'`,"sequenzy subscribers add user@example.com --list list_123","sequenzy subscribers add user@example.com --skip-sequences","sequenzy subscribers add user@example.com --created-at 2019-03-14T09:30:00Z","sequenzy subscribers add user@example.com --created-at 2019-03-14T09:30:00Z --enroll-sequences","sequenzy subscribers add --phone '+14155550123' --sms-consent"],notes:["--attr values are always sent as strings. Use --attrs-json for numbers, booleans and lists, or to keep a value such as a zip code as a quoted string. When both set the same key, --attr wins. Run `sequenzy subscribers attributes` to see the names and types your other contacts use.","--created-at preserves a contact's real signup date so date-relative segments are correct right after a migration. It never moves an existing contact's date later, and it suppresses sequence enrollment by default because it describes the past, not a signup happening now. Pass --enroll-sequences to opt in explicitly. New-subscriber account notifications remain eligible when the signup date is at most one hour old; older dates do not notify on creation. Double opt-in confirmation can notify even for imported contacts. Your notification preferences, double opt-in and the daily cap still apply."]});var iFe=Xi.command("import [file]").description("Queue a full-record subscriber import from CSV or JSON").option("--records-json <json>","Inline JSON array (alternative to a CSV/JSON file)").option("--duplicate-strategy <strategy>","Existing contact behavior: skip, merge, or overwrite","skip").option("--file-name <name>","Source label shown in import history").option("-l, --list <ids...>","List IDs for every imported subscriber (requires lists:write)").option("--enroll-sequences","Enroll matching subscribers (requires automations:trigger)").option("--default-phone-country <country>","Two-letter country for national phone numbers").option("--sms-consent","Assert express written SMS consent for every imported phone").option("--opt-in-mode <mode>","Email consent mode: default, confirmed, or double_opt_in (default may require automations:trigger; double_opt_in always does)","default").option("--idempotency-key <key>","Caller-owned key (1-255 chars) that makes retrying this request safe: resending the same content returns the already-queued import, while changed content under the same key queues a new import").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("import",{file:e,...t}));S(iFe,{notes:["CSV columns for email, names, external ID, phone, status, and tags are detected automatically; other columns become custom attributes.","Status values from AWeber, Mailchimp, Kit, MailerLite, Brevo, ActiveCampaign, and beehiiv exports are mapped to active, unsubscribed, or bounced. A filled unsubscribe date column marks the row unsubscribed. Not-confirmed (pending double opt-in) and unrecognized values import as active; unrecognized ones are counted in the output.","Use --opt-in-mode confirmed only when these contacts already gave verified email consent.","Imports run asynchronously. Poll the returned ID with subscribers import-status.","Pass --idempotency-key from pipelines and retry loops so a timed-out request can be resent without double-queueing the batch.","If two identical keyed requests overlap, one may receive a retryable 503; honor Retry-After and resend the same request."],examples:["sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed",`sequenzy subscribers import --records-json '[{"email":"one@example.com","firstName":"Ana"}]' --opt-in-mode confirmed`,"sequenzy subscribers import contacts.csv --duplicate-strategy merge --idempotency-key nightly-sync-2026-08-25"]});var oFe=Xi.command("import-status <importId>").description("Get subscriber import progress and result counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("import:get",{importId:e,...t}));S(oFe,{notes:["A completed import can still contain failed rows; inspect failed counts and --json reason maps."],examples:["sequenzy subscribers import-status import_123","sequenzy subscribers import-status import_123 --json"]});var sFe=Xi.command("events-import [file]").description("Record events for many subscribers from a JSON file").option("--events-json <json>","Inline JSON array (alternative to a JSON file)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("events:import",{file:e,...t}));S(sFe,{notes:["Each event needs a name, an eventId, and an email or externalId; externalId-only rows must identify an existing contact because email is required for creation. At most 25 events per request.","History is classified per contact: only contacts whose events are all more than an hour old use the silent historical path. If any event for a contact is recent, every event for that contact uses the live path and can run sequences or webhooks.","Derive each required eventId from your source data so re-running the same file records nothing twice."],examples:["sequenzy subscribers events-import purchases.json",`sequenzy subscribers events-import --events-json '[{"email":"one@example.com","name":"purchase_completed","eventId":"order_1","occurredAt":"2026-08-01T12:00:00Z"}]'`]});var aFe=Xi.command("get [email]").description("Get subscriber details").option("--external-id <id>","Customer-owned subscriber ID").option("--include-bots","Include machine-classified bot/scanner opens and clicks in stats/activity").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("get",{email:e,...t}));S(aFe,{notes:["Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy subscribers get user@example.com","sequenzy subscribers get user@example.com --include-bots"]});var KA=Xi.command("notes").description("Manage subscriber notes").action(()=>KA.help());S(KA,{examples:["sequenzy subscribers notes list user@example.com",'sequenzy subscribers notes add user@example.com --body "Prefers monthly digest"',"sequenzy subscribers notes delete note_123"]});var cFe=KA.command("list [email]").description("List subscriber notes").option("--external-id <id>","Customer-owned subscriber ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("notes:list",{email:e,...t}));S(cFe,{examples:["sequenzy subscribers notes list user@example.com","sequenzy subscribers notes list --external-id user_123 --json"]});var lFe=KA.command("add [email]").description("Add a subscriber note").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-b, --body <body>","Note body").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("notes:add",{email:e,...t}));S(lFe,{examples:['sequenzy subscribers notes add user@example.com --body "Asked about enterprise plan"','sequenzy subscribers notes add --external-id user_123 --body "Imported from sales call"']});var uFe=KA.command("delete <noteId>").description("Delete a subscriber note").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("notes:delete",{noteId:e,...t}));S(uFe,{examples:["sequenzy subscribers notes delete note_123"]});var dFe=Xi.command("attributes").description("List the custom attributes your contacts use, with value types and examples").option("--include-nested","Also list nested paths such as profile.tier").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>yo("attributes",e));S(dFe,{notes:["Types and examples come from up to 100 recent contacts. Names that only older contacts use are listed too, with sampledContacts 0.",`A list attribute (isArray) holds several values. Set it with --attrs-json, e.g. --attrs-json '{"interests":["running"]}'.`],examples:["sequenzy subscribers attributes","sequenzy subscribers attributes --include-nested --json"]});var pFe=Xi.command("update [email]").description("Update subscriber status, name, phone, tags, or custom attributes").option("--external-id <id>","Customer-owned subscriber ID").option("--status <status>","active, not_subscribed, unsubscribed, bounced, or complained (records a spam complaint and unsubscribes)").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("--timezone <zone>","IANA timezone (e.g. America/New_York). Pass an empty string to clear it").option("--phone <phone>","Phone number (E.164 or national). Pass an empty string to clear it").option("--phone-country <country>","Two-letter country used to read a national-format --phone (default US)").option("--sms-consent","Record express written SMS marketing consent for the phone number").option("--no-sms-consent","Unsubscribe the contact from SMS").option("-t, --tag <tags...>","Replacement tags").option("-a, --attr <attrs...>","Attributes (key=value)").option("--attrs-json <json>",`Attributes as a JSON object that keeps value types, e.g. '{"seats":5}'`).option("--merge","Merge custom attributes instead of replacing them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("update",{email:e,...t}));S(pFe,{notes:["--phone writes the native phone field shown on the contact, not a custom attribute.","--attr values are always sent as strings. Use --attrs-json to set numbers, booleans and lists or to change an attribute's type. When both set the same key, --attr wins.","Changing --phone resets SMS consent unless --sms-consent is passed in the same command.","--status complained records a company spam-complaint suppression, unsubscribes the contact and cancels its sequence enrollments. The contact then reads as unsubscribed; the suppression shows in `sequenzy suppressions get <email>`."],examples:["sequenzy subscribers update user@example.com --status unsubscribed","sequenzy subscribers update user@example.com --status complained","sequenzy subscribers update user@example.com --first-name Ana --last-name Silva","sequenzy subscribers update user@example.com --phone '+390512345678'","sequenzy subscribers update user@example.com --phone '051 234 5678' --phone-country IT --sms-consent","sequenzy subscribers update user@example.com --tag churned --attr cancelReason=too_expensive","sequenzy subscribers update user@example.com --attr plan=pro --merge",`sequenzy subscribers update user@example.com --attrs-json '{"zip":"02134"}' --merge`]});var mFe=Xi.command("event [email]").description("Trigger an event for a subscriber").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-n, --name <event>","Event name").option("-p, --property <properties...>","Event properties (key=value)").option("-a, --attr <attrs...>","Subscriber attributes (key=value)").option("--account <externalId>","Attach the contact to this customer organization (ignored with a warning until the workspace has Organizations on)").option("--organization <externalId>","Same as --account").option("--account-json <json>","Account reference object with externalId and optional role, name, domain, attributes; cannot be combined with --account").option("--occurred-at <iso-date>","When the event actually happened; more than an hour ago records it as history without running sequences").option("--event-id <id>","Your own event ID, so re-sending the same event writes nothing new").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("event",{email:e,...t}));S(mFe,{examples:["sequenzy subscribers event user@example.com --name saas.purchase","sequenzy subscribers event user@example.com --name saas.purchase --property plan=pro --property amount=99","sequenzy subscribers event user@example.com --name saas.purchase --occurred-at 2024-11-02T10:00:00Z --event-id inv_9182"],notes:["Without --occurred-at the event is live and runs the full chain: sync rules, sequence enrollment, waiting steps, goal conversions.","--event-id is an idempotency key on both paths: re-sending an ID this contact already has for this event name records nothing and runs no side effects. It is best-effort for live events sent within a second of each other, so a producer that needs a strict guarantee should keep its own ledger.","With an --occurred-at more than an hour in the past the event is recorded as history: stored with its real timestamp and counted by segments, but no sequences enroll and no webhooks fire. The contact's signup date also moves back to when the event occurred (never later). Use it for backfills, never to fake a live event."]});var cC=Xi.command("tags").description("Many contacts, one or more tags: add or remove tags on existing subscribers").action(()=>cC.help());S(cC,{notes:["These commands only touch contacts that already exist. Unknown identifiers are reported, never created.","They call POST /api/v1/subscribers/bulk/tags/add and /remove (up to 500 contacts per request). The similarly named POST /api/v1/subscribers/tags/bulk is the opposite shape: one contact, several tags, and it creates the contact when missing.","Use `subscribers add` or `subscribers update` for single-contact tag changes."],examples:["sequenzy subscribers tags add --tag legacy-plan --emails-file ./backlog.csv","sequenzy subscribers tags remove --tag legacy-plan --emails-file ./backlog.csv"]});var fFe=cC.command("add").description("Add tags to many existing subscribers (never creates contacts)").requiredOption("-t, --tag <tags...>","Tags to add").option("-e, --email <emails...>","Subscriber emails to tag").option("--emails-json <json>","JSON array of subscriber emails").option("--emails-file <file>","CSV or newline-separated file of emails").option("--external-id <ids...>","Customer-owned subscriber IDs to tag").option("--subscriber-id <ids...>","Sequenzy subscriber IDs to tag").option("--trigger-automations","Allow tag_added sequences to enroll these contacts (requires automations:trigger)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>BR("add",e));S(fFe,{notes:["Tag automations are skipped by default, which is what historical backfills want.","Requests are chunked at 500 targets each; totals in the output are combined across chunks."],examples:["sequenzy subscribers tags add --tag vip --email a@example.com --email b@example.com","sequenzy subscribers tags add --tag derived-churn --emails-file ./backlog.csv --json","sequenzy subscribers tags add --tag welcome --emails-file ./new.csv --trigger-automations"]});var gFe=cC.command("remove").description("Remove tags from many existing subscribers (never creates contacts)").requiredOption("-t, --tag <tags...>","Tags to remove").option("-e, --email <emails...>","Subscriber emails to untag").option("--emails-json <json>","JSON array of subscriber emails").option("--emails-file <file>","CSV or newline-separated file of emails").option("--external-id <ids...>","Customer-owned subscriber IDs to untag").option("--subscriber-id <ids...>","Sequenzy subscriber IDs to untag").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>BR("remove",e));S(gFe,{examples:["sequenzy subscribers tags remove --tag legacy-plan --emails-file ./backlog.csv","sequenzy subscribers tags remove --tag vip --subscriber-id sub_1 sub_2"]});var AFe=Xi.command("remove [email]").description("Unsubscribe or permanently delete a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--hard","Permanently delete (not just unsubscribe); recorded data is erased or anonymized, suppressions are kept").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("remove",{email:e,...t}));S(AFe,{examples:["sequenzy subscribers remove user@example.com","sequenzy subscribers remove user@example.com --hard"]});var Dd=Ve.command("transactional").description("Manage transactional email templates").action(()=>Dd.help());S(Dd,{notes:["Use the top-level `sequenzy send` command to send email."],examples:["sequenzy transactional list","sequenzy transactional get welcome","sequenzy transactional update welcome --no-enabled","sequenzy transactional delete welcome --yes","sequenzy send user@example.com --template welcome --var firstName=Ana"]});var hFe=Dd.command("list").description("List transactional templates").option("--label <labels...>","Filter by label names (matches any)").option("--search <text>","Search name, slug, or email subject/title").option("--status <status>","Filter by all, active, or disabled","all").option("--sort <field>","Sort by date, sends, opens, open-rate, clicks, or ctr","date").option("--order <order>","Sort order: asc or desc","desc").option("--include-bots","Include machine opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qm("list",e));S(hFe,{examples:['sequenzy transactional list --search "password reset" --status active',"sequenzy transactional list --sort open-rate --order desc","sequenzy transactional list --company comp_123 --json"]});var yFe=Dd.command("get <slug>").description("Get transactional template details by slug").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("get",{slug:e,...t}));S(yFe,{examples:["sequenzy transactional get welcome"]});var bFe=Dd.command("create <name>").description("Create a transactional template").option("--label <labels...>","Label names to assign").option("--slug <slug>","API slug").option("-s, --subject <subject>","Subject (optional with --prompt)").option("--preview-text <text>","Preview text override").option("--prompt <prompt>","Generate branded transactional blocks").option("--style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("--tone <tone>","Prompt generation tone").option("--html <html>","Preserved HTML content").option("--html-file <file>","Read preserved HTML from file").option("--blocks-json <json>","Finished Sequenzy blocks JSON").option("--blocks-file <file>","Read finished Sequenzy blocks from file").option("--enabled","Enable immediately (prompt creates default disabled)").option("--no-enabled","Create the transactional template disabled").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("create",{name:e,...t}));S(bFe,{notes:["Provide exactly one of prompt, HTML, or blocks.",JA],examples:['sequenzy transactional create password-reset --prompt "Write a password reset email"']});var vFe=Dd.command("update <slug>").description("Update a transactional template by ID or slug").option("--label <labels...>","Replace label names").option("--clear-labels","Remove all label assignments").option("--name <name>","Transactional template name").option("-s, --subject <subject>","Subject line").option("--preview-text <text>","Preview text").option("--clear-preview-text","Remove the preview text").option("--html <html>","Replace the body with preserved HTML").option("--html-file <file>","Replace the body with HTML read from file").option("--blocks-json <json>","Replace the body with Sequenzy blocks JSON").option("--blocks-file <file>","Replace the body with blocks read from file").option("--enabled","Allow this template to be sent").option("--no-enabled","Stop this template from being sent").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("update",{slug:e,...t}));S(vFe,{notes:["Partial update: only the fields you pass change.","Replacing the body takes HTML or blocks, not both.","Use --no-enabled to stop sends while keeping the template and its stats.",JA],examples:["sequenzy transactional update password-reset --no-enabled",'sequenzy transactional update password-reset --subject "Reset your password"',"sequenzy transactional update password-reset --blocks-file ./reset.json"]});var EFe=Dd.command("delete <slug>").description("Delete a transactional template by ID or slug").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("delete",{slug:e,...t}));S(EFe,{notes:["Deleting frees the slug for reuse and stops any further sends through it.","Past deliveries and their stats are kept; only the saved template is removed.","Requires an API key with the transactional:delete scope."],examples:["sequenzy transactional delete password-reset --yes"]});var KR=Ve.command("widgets").description("Widget helper commands").action(()=>KR.help());S(KR,{examples:["sequenzy widgets preferences-token user@example.com"]});var IFe=KR.command("preferences-token <email>").description("Generate a subscription preferences iframe token").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>i5("preferences-token",{email:e,...t}));S(IFe,{examples:["sequenzy widgets preferences-token user@example.com"]});var lC=Ve.command("email-sends").alias("emailsends").description("Inspect sent email snapshots and delivery events").action(()=>lC.help());S(lC,{notes:["Email send rows are short-lived; if the row was cleaned up, this falls back to retained ClickHouse events.","The list command matches the dashboard's 14-day delivery history and supports subject, recipient, status, type, and source filters.","Use --html to print the stored HTML body when it is still available."],examples:['sequenzy email-sends list --search "Welcome" --status opened',"sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --json"]});var CFe=lC.command("list").description("List and filter recent sent email deliveries").option("--search <text>","Search subject or recipient email").option("--subject <text>","Filter by subject/title").option("--recipient <text>","Filter by recipient email").option("--status <status>","Filter by delivery status").option("--email-type <type>","Filter by campaign, transactional, or sequence").option("--bounce-type <type>","Filter bounced sends by Permanent, Transient, Soft or Blocked").option("--campaign <id>","Filter by campaign ID").option("--transactional <id>","Filter by saved transactional email ID").option("--sequence <id>","Filter by sequence ID").option("--automation-node-id <id>","Filter by one email step of a sequence").option("--mailbox-provider <provider>","Filter by recipient mailbox provider (e.g. gmail, orange, other)").option("--list <id>","Only sends to active subscribers currently on this list").option("--days <days>","History window in days (maximum 14)","14").option("--page <page>","Page number").option("--limit <limit>","Results per page (maximum 100)").option("--all","Fetch every result page").option("--csv [path]","Export CSV to stdout, or write it to an optional file path").option("--sort <field>","Sort by recipientEmail, subject, status, eventAt, sentAt, or createdAt","createdAt").option("--order <order>","Sort order: asc or desc","desc").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Rx("list",e));S(CFe,{notes:["The opened status includes clicked deliveries, matching the dashboard.","Use a returned ID with `sequenzy email-sends get <id>` for timestamps and the complete event timeline.","Use --all --csv email-sends.csv to export every matching delivery.","--automation-node-id lists the recipients of one sequence step; the node ID comes from `stats --sequence <id>`.","--mailbox-provider uses the same providers as `stats --mailbox-provider`, so it lists the sends behind a provider's numbers; `other` is every domain outside the named providers.","This history only reaches back 14 days. For per-step send totals over the full retained window use `stats --sequence <id>` or `stats --emails`."],examples:['sequenzy email-sends list --search "Welcome" --status opened',"sequenzy email-sends list --email-type transactional --days 7","sequenzy email-sends list --sequence seq_123 --automation-node-id node_email_4","sequenzy email-sends list --mailbox-provider orange --list list_123 --status opened","sequenzy email-sends list --transactional txn_123 --all --csv email-sends.csv","sequenzy email-sends list --subject receipt --recipient example.com --json"]});var wFe=lC.command("get <emailSendId>").description("Get an email send by ID").option("-c, --company <id>","Company ID override for personal API keys").option("--html","Print the full stored HTML body in text output").option("--html-only","Print only the stored HTML body").option("--json","Print raw JSON").action((e,t)=>Rx("get",{id:e,...t}));S(wFe,{examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --company comp_123 --json"]});var VA=Ve.command("suppressions").description("Inspect recipient suppression and clear workspace escalations").action(()=>VA.help());S(VA,{notes:["Suppression lookup is exact-address only because the SES account-level list is shared across companies.","Removal clears workspace soft-bounce escalations only; global invalid-recipient, workspace hard-bounce, SES, complaint, and unsubscribe protections are preserved."],examples:["sequenzy suppressions list","sequenzy suppressions get me@example.com","sequenzy suppressions remove me@example.com --yes"]});var SFe=VA.command("list").description("List recipients this workspace cannot reach").option("--search <query>","Filter by email substring").option("--page <page>","Page number (default 1)").option("--limit <limit>","Entries per page (max 100)").option("--sort <field>","Order by suppressedAt, email, or status").option("--order <direction>","asc or desc").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>XI("list",e));S(SFe,{notes:["Shows protected global invalid-recipient suppressions for associated addresses, protected workspace hard bounces without conclusive invalid-inbox evidence, workspace soft-bounce escalations, and recipients who reported an email as spam.","Only workspace soft-bounce escalations can be removed.","--sort status lists removable escalations before protected suppressions. An unrecognized --sort falls back to newest first, and the applied order is printed with the results."],examples:["sequenzy suppressions list","sequenzy suppressions list --search example.com --json","sequenzy suppressions list --sort status --order desc"]});var DFe=VA.command("get <email>").description("Check local and Amazon SES suppression for one recipient").option("--region <region>","Check one AWS SES region").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>XI("get",{email:e,...t}));S(DFe,{examples:["sequenzy suppressions get me@example.com","sequenzy suppressions get me@example.com --region us-east-1 --json"]});var _Fe=VA.command("remove <email>").description("Remove a workspace soft-bounce escalation").option("--region <region>","Inspect one AWS SES region after removal").option("-c, --company <id>","Company ID override for personal API keys").option("-y, --yes","Skip confirmation").option("--json","Print raw JSON").action((e,t)=>XI("remove",{email:e,...t}));S(_Fe,{examples:["sequenzy suppressions remove me@example.com","sequenzy suppressions remove me@example.com --region us-east-1 --yes"]});var xFe=L8(Ve.command("send <email...>").description("Send through the transactional email API")).option("-t, --template <slug>","Transactional template slug to use").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file, or - for stdin").option("--track-as <name>","Track --html sends under one code-managed transactional email (e.g. weekly-report)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").option("--email-type <type>","Delivery policy: transactional (default) or marketing").option("--from-email <email>","Send from this verified sender address instead of the company default").option("--from-name <name>","Existing sender display name on --from-email when the address has several identities").option("--sender-profile-id <id>","Existing sender profile ID; omit --from-email. See sequenzy sender-profiles list").option("--reply-to <address>","Reply-To address or Name <email> value").option("--reply-to-name <name>","Display name for a bare --reply-to address").option("--reply-profile <id>","Existing reply profile ID; omit --reply-to. See sequenzy sender-profiles list").option("--attachments-json <json>","Attachments as JSON objects with filename and content or path").option("--header <header>",'Extra email header as "Name: value", e.g. a List-Unsubscribe for a transactional send (repeatable)',(e,t=[])=>[...t,e]).option("--no-track-clicks","Disable click tracking for this send to keep iOS/Android universal links working").option("--no-track-opens","Disable the open-tracking pixel for this send").option("--idempotency-key <key>","Retry key that prevents duplicate sends for 14 days").option("--vars-json <json>","Variables as a JSON object, including nested arrays for repeat blocks").option("-v, --var <vars...>","Variables (key=value)").action(j8);S(xFe,{notes:["Use either --template or --html/--html-file.","Use --html-file - for piped HTML. --json prints the accepted API receipt; failures print structured JSON to stderr.","--template takes a transactional API slug and cannot be combined with --subject.","--subject is required when sending raw HTML.","--track-as names a raw-HTML email type (for example weekly-report): every send with the same value is counted under one code-managed transactional email that the first send creates. Use stable ASCII names (letters, digits, spaces and . _ - : /), not per-recipient values; a workspace can have 100. It cannot be combined with --template.","Pass several recipients, --cc, or --bcc to send one email with a shared recipient list instead of one email per address. Each list accepts up to 50 addresses; repeat --cc/--bcc or use comma-separated values for several copy recipients.","Addresses repeated across the lists are dropped from the lower-priority one: to beats cc beats bcc.","--email-type marketing adds the standard unsubscribe footer and RFC 8058 one-click-unsubscribe headers; it supports one recipient only and rejects --cc and --bcc.","When --from-email and --sender-profile-id are omitted, a template send keeps its saved From identity and a direct send uses the company default. Pass --from-email (and --from-name if that address has several identities) to send as a non-default verified brand without looking up IDs.","Use either --from-email or --sender-profile-id, not both. --from-name requires --from-email. --sender-profile-id already carries the display name.","When --reply-to and --reply-profile are omitted, the saved template or company Reply-To default is used. Use either --reply-to or --reply-profile, not both. --reply-to-name requires a bare --reply-to address.","--attachments-json accepts up to 10 objects with filename plus Base64 content or a public path; contentId embeds a CID image and contentType overrides MIME detection.",`--header adds an email header (up to 50). Transactional sends can carry your own List-Unsubscribe and List-Unsubscribe-Post; marketing sends always use Sequenzy's. Headers Sequenzy manages, such as From, To, Subject, Reply-To and Message-ID, are not applied; the receipt lists any header that was not applied and why. A --header without "Name:" or a name given twice is rejected before sending.`,"--no-track-clicks and --no-track-opens are opt-out only for this send; they cannot enable tracking the account has disabled.","--vars-json accepts nested objects and arrays; --var overrides individual scalar keys.","If the recipient matches a subscriber, saved first and last names fill omitted name variables; --var values override them.","For retryable automation, generate one --idempotency-key per logical email and reuse that same key on every retry. Reusing it with different content is rejected."],examples:["sequenzy send user@example.com --template welcome --var firstName=Ana","sequenzy send buyer@example.com ops@example.com --cc billing@example.com --bcc archive@example.com --template order-confirmation",`sequenzy send user@example.com --template welcome --vars-json '{"event":{"items":[{"title":"Plan","description":"Pro"}]}}'`,'sequenzy send user@example.com --subject "Welcome" --html-file ./welcome.html','sequenzy send user@example.com --subject "Your week" --html-file ./weekly.html --track-as weekly-report',`sequenzy send user@example.com --subject "Ticket" --html '<img src="cid:ticket-qr">' --attachments-json '[{"filename":"ticket.png","path":"https://example.com/ticket.png","contentId":"ticket-qr","contentType":"image/png"}]'`,"sequenzy send user@example.com --template trial-reminder --email-type marketing --var firstName=Ana",'sequenzy send user@example.com --subject "StudyBoost test" --html "<p>Hi</p>" --from-email hello@studyboost.com --from-name StudyBoost --reply-to support@studyboost.com --reply-to-name "StudyBoost Support"',"sequenzy send user@example.com --template receipt --idempotency-key order-123-receipt",'sequenzy send user@example.com --template weekly-digest --header "List-Unsubscribe: <https://example.com/unsubscribe/abc>" --header "List-Unsubscribe-Post: List-Unsubscribe=One-Click"']});var rr=Ve.command("campaigns").description("Manage campaigns").action(()=>rr.help());S(rr,{notes:["Campaign creation supports HTML, Sequenzy blocks, or prompt-generated content.","Campaign updates support HTML, Sequenzy blocks, subject, name, labels, and reply-to changes.","Campaign scheduling requires a future ISO timestamp and a verified sending domain.","Use unschedule to return a scheduled campaign to draft, cancel to stop one permanently, and pause/resume to control an active send.",JA],examples:["sequenzy campaigns list --status draft --company comp_123",'sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',"sequenzy campaigns test camp_123 --to you@example.com","sequenzy campaigns unschedule camp_123","sequenzy campaigns cancel camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test"]});rr.command("from-audience").description("Create a draft for a frozen selection of contacts or email activity").option("--name <name>","Draft name").option("--selection-json <json>","Selection object: source contacts or email_activity, with matching contacts or activity settings").option("--selection-file <path>","Read the selection JSON from a file, or - for stdin").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>fr("from-audience",e));var BFe=rr.command("list").description("List campaigns").option("-s, --status <status>","Filter by status").option("--label <labels...>","Filter by label name").option("--limit <count>","Page size from 1 to 100 (defaults to 50)").option("--offset <count>","Zero-based result offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>fr("list",e));S(BFe,{notes:["Results are paginated: the default page size is 50 and --limit is capped at 100.","Read the pagination object (--json) or the trailing hint to page through every campaign with --offset."],examples:["sequenzy campaigns list","sequenzy campaigns list --status draft --company comp_123","sequenzy campaigns list --label edm","sequenzy campaigns list --limit 100 --offset 100"]});var kFe=rr.command("get <id>").description("Get campaign details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("get",{id:e,...t}));S(kFe,{examples:["sequenzy campaigns get camp_123 --company comp_123"]});var RFe=rr.command("audience <id>").description("Show who a campaign will reach, with a live recipient count").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("audience",{id:e,...t}));S(RFe,{notes:["Resolves list and segment names and recomputes the recipient count at read time.","Warns when targeting is unset, because scheduling then sends to every active subscriber."],examples:["sequenzy campaigns audience camp_123 --company comp_123"]});function l5(e){return e.option("--subscriber <id>","Personalize as a stored subscriber").option("--email <email>","Personalize as an ad-hoc contact").option("--first-name <name>","First name for --email").option("--last-name <name>","Last name for --email").option("--attr <key=value...>","Custom attribute for the --email contact (repeatable)").option("--attrs-json <json>","Custom attributes for the --email contact as a JSON object").option("--tag <tags...>","Tag the --email contact carries, for previewing tag conditions (repeatable)").option("--empty-tags","State that the --email contact carries no tags, for previewing empty-tag conditions").option("--var <key=value...>","Extra merge variable (repeatable)").option("--vars-json <json>","Extra merge variables as a JSON object").option("--locale <locale>","Force a localization locale")}function VR(e){return l5(e).option("--tracking","Apply the company's auto-UTM link decoration").option("--out <file>","Write the HTML to a file, or - for stdout").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON")}function WR(e){return l5(e).option("--no-links","Skip live link and image verification").option("--fail-on <severity>","Exit with code 1 when an issue of this severity or worse is found: error or warning").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON")}var YR=["Runs the same checks as the editor's email checker against the saved content, plus live verification of every link and image: broken pages, dead domains, certificate problems, redirect loops, missing https://, localhost/staging/preview URLs, placeholder domains, link shorteners, misleading link text, invalid mailto/tel links, and broken or oversized images.","Also flags leftover placeholder copy (lorem ipsum, [First Name], TODO), name merge tags without a fallback, missing alt text, spam-trigger wording, Gmail clipping risk and email-client compatibility problems.",'Links built from per-recipient merge tags are listed as "personalized" and only syntax-checked. {{company.url}} links are resolved from your company website.',`"Couldn't verify" means the site refused an automated check (for example 401, 403 or 429). It may work in a browser, so it is never counted as broken.`,"Sender settings are not part of this check. Use --fail-on error in CI or scripts to stop on problems."],ZR=["Renders the email exactly as it would be sent, so an external builder or dashboard can show a true preview.","Without --subscriber or --email the email renders for a sample contact and contact-specific merge tags resolve to empty values.","Unresolved merge tags are listed in the summary and under unresolvedMergeTags with --json. Nothing is called unrecognized unless the render knows the contact's attributes, since a bare {{plan}} reads the same attributes as {{subscriber.plan}}, so pass --subscriber, or --email with --attr/--attrs-json, to catch typos. Rendering a transactional email also needs --var/--vars-json, since its tags come from the variables of each send call.",'Conditional blocks that read stored subscriber state (tag, segment, list, status, event, purchases, engagement) can only be evaluated for --subscriber, or for a tag condition with --email plus --tag/--empty-tags. Anything the render cannot evaluate is rendered as false and listed under "Conditions not evaluated", because an else branch in the HTML looks the same either way.',"Links are clean by default. Pass --tracking to apply the company's auto-UTM decoration.","Per-send click redirects and the open pixel are added at send time against a real email send record, so they never appear in a render."],TFe=VR(rr.command("render <id>").description("Render a campaign to email-ready HTML").option("--variant <id>","Render a specific A/B test variant").option("--variation <id>","Render a design variation of the email (from variations list)")).action((e,t)=>Jv({type:"campaign",id:e},t));S(TFe,{notes:ZR,examples:["sequenzy campaigns render camp_123 --out preview.html","sequenzy campaigns render camp_123 --subscriber sub_123 --out -","sequenzy campaigns render camp_123 --email you@example.com --first-name Ada --var plan=Pro","sequenzy campaigns render camp_123 --email you@example.com --tag extended","sequenzy campaigns render camp_123 --email you@example.com --empty-tags","sequenzy campaigns render camp_123 --email you@example.com --attr plan=pro --attr mrr=99 --json","sequenzy campaigns render camp_123 --variant var_123 --tracking --json"]});var OFe=WR(rr.command("check <id>").description("Check a campaign before sending: broken links and images, placeholders, content and client issues").option("--variant <id>","Check a specific A/B test variant")).action((e,t)=>Kv({type:"campaign",id:e},t));S(OFe,{notes:YR,examples:["sequenzy campaigns check camp_123","sequenzy campaigns check camp_123 --fail-on error","sequenzy campaigns check camp_123 --no-links --json"]});var NFe=rr.command("create <name>").description("Create a campaign").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--status <status>","Initial status: draft or sent").option("--sent-at <iso-date>","Sent timestamp when creating with --status sent").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--prompt <prompt>","Generate campaign blocks from a prompt").option("--style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("--tone <tone>","Prompt generation tone: professional, casual, friendly").option("--email-preset <preset>","Style > Format for native blocks: branded or minimal").option("--from-email <email>","Campaign From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>","Existing sender profile ID; carries its own name, so omit --from-email and --from-name").option("--reply-to <email>","Campaign Reply-To address").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile <id>","Existing Reply-To profile ID").option("--label <labels...>","Label names to assign").option("--segment <id>","Target a saved segment").option("--lists <ids...>","Target one or more lists by ID (shorthand for targetLists type 'lists')").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--attach <files...>","Local files to attach to every email (uploaded as Base64)").option("--attachments-json <json>","JSON array of attachments: filename plus Base64 content or a public path URL").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("create",{name:e,...t}));S(NFe,{notes:["--subject is required unless --prompt is provided. With --prompt, the generated subject is used unless --subject is also provided.","Use --preview-text or --preheader-text to set the inbox preview text. With --prompt, the generated preview is used unless one of these flags is provided.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --email-preset branded or minimal to set Style > Format on native blocks. This is not --style, which is a prompt-generation hint.","Use --status sent only to archive an already-sent campaign; it does not send email or create per-recipient delivery history.","Do not combine prompt, HTML flags, and blocks flags in the same request.","Use --segment, --lists, or --target-lists-json to save the audience on the draft. Omit them to set targeting later with campaigns update or campaigns schedule. These audience flags are mutually exclusive.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.',"Use --attach for local files or --attachments-json for URLs: up to 10 files, 5MB in total, sent with every recipient's email. Inline images (contentId) are not supported on campaigns."],examples:['sequenzy campaigns create "April Launch" --prompt "Announce our new analytics dashboard"','sequenzy campaigns create "Weekly Report" --subject "This week" --html-file ./weekly.html --attach ./report.pdf','sequenzy campaigns create "April Launch" --subject "We shipped" --preheader-text "Your quick product update" --html-file ./campaign.html','sequenzy campaigns create "Imported launch" --subject "We shipped" --status sent --sent-at "2026-05-01T14:00:00Z" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns create "Segmented Launch" --subject "We shipped" --blocks-file ./campaign-blocks.json','sequenzy campaigns create "Research note" --subject "Quick question" --blocks-file ./note.json --email-preset minimal',`sequenzy campaigns create "Partner Update" --subject "This month at HolaRuta" --target-lists-json '{"type":"lists","listIds":["list_123"]}'`]});var $Fe=rr.command("update <id>").description("Update a draft campaign").option("-n, --name <name>","Campaign name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--email-preset <preset>","Style > Format for native blocks: branded or minimal").option("--campaign-data-json <json>","Inline campaignData JSON object").option("--campaign-data-file <file>","Path to a JSON file with campaignData").option("--computed-lists-json <json>","Inline computedLists JSON array").option("--computed-lists-file <file>","Path to a JSON file with computedLists").option("--from-email <email>","Campaign From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>","Existing sender profile ID; carries its own name, so omit --from-email and --from-name").option("--reply-to <email>","Set reply-to using an existing reply profile email").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile <id>","Set reply-to using a reply profile ID").option("--label <labels...>","Replace label names").option("--segment <id>","Retarget the draft at a saved segment").option("--lists <ids...>","Retarget the draft at one or more lists by ID (shorthand for targetLists type 'lists')").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--clear-target-lists","Clear saved targeting so the audience is chosen when scheduling").option("--send-time-optimization","Enable per-recipient send-time optimization and clear other saved pacing modes").option("--disable-send-time-optimization","Disable send-time optimization on the draft").option("--send-time-window-hours <hours>","Set the send-time optimization window from 1-24 hours").option("--max-recipients <count>","Send to at most this many audience members (the first N by subscriber id) when the campaign is sent").option("--clear-max-recipients","Remove the recipient limit so the campaign goes to the whole audience").option("--attach <files...>","Replace the attachments with these local files (uploaded as Base64)").option("--attachments-json <json>","Replace the attachments: JSON array of filename plus Base64 content or a public path URL").option("--clear-attachments","Remove every attachment from the draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("update",{id:e,...t}));S($Fe,{notes:["Provide at least one update flag, including subject, preview text, content, email preset, labels, reply-to, campaign data, computed lists, audience, or STO pacing.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --email-preset branded or minimal to change Style > Format on native blocks without rewriting copy.","Use --campaign-data-file and --computed-lists-file to upload personalization data for repeat blocks.","Do not combine HTML flags with blocks flags in the same request.","Use either --reply-to or --reply-profile, not both.","Use --segment, --lists, or --target-lists-json to replace the saved audience, or --clear-target-lists to choose it later at schedule time. These audience flags are mutually exclusive.","Use --send-time-optimization with optional --send-time-window-hours (1-24, default 12), or --disable-send-time-optimization to turn STO off. Enabling STO clears a saved spread or recipient-timezone mode.","Use --max-recipients to send to only the first N matching subscribers (for example while ramping up a new domain), or --clear-max-recipients to remove the cap. The cap is applied when the audience is resolved at send time.","Use --attach or --attachments-json to replace the draft's attachments (up to 10 files, 5MB in total), or --clear-attachments to remove them."],examples:['sequenzy campaigns update camp_123 --subject "Updated subject"','sequenzy campaigns update camp_123 --preheader-text "Updated preview"',"sequenzy campaigns update camp_123 --html-file ./campaign-v2.html","sequenzy campaigns update camp_123 --blocks-file ./campaign-v2-blocks.json","sequenzy campaigns update camp_123 --email-preset minimal","sequenzy campaigns update camp_123 --campaign-data-file ./campaign-data.json --computed-lists-file ./computed-lists.json","sequenzy campaigns update camp_123 --reply-to support@example.com","sequenzy campaigns update camp_123 --label edm api","sequenzy campaigns update camp_123 --segment seg_123","sequenzy campaigns update camp_123 --clear-target-lists","sequenzy campaigns update camp_123 --send-time-optimization --send-time-window-hours 8","sequenzy campaigns update camp_123 --max-recipients 100","sequenzy campaigns update camp_123 --attach ./report.pdf ./terms.pdf","sequenzy campaigns update camp_123 --clear-attachments"]});var PFe=rr.command("schedule <id>").description("Schedule a draft or scheduled campaign").requiredOption("--at <datetime>","Future ISO date/time to send, for example 2026-06-01T14:00:00Z").option("--segment <id>","Target a saved segment").option("--lists <ids...>","Target one or more lists by ID (shorthand for targetLists type 'lists')").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--send-time-optimization","Enable send-time optimization for the scheduled send").option("--disable-send-time-optimization","Disable send-time optimization for the scheduled send").option("--send-time-window-hours <hours>","Set the send-time optimization window from 1-24 hours").option("--spread-over-hours <hours>","Spread delivery over 1-72 hours. Disables send-time optimization when set.").option("--max-recipients <count>","Send to at most this many audience members (the first N by subscriber id). Omit to keep the draft's saved cap.").option("--clear-max-recipients","Remove a saved recipient limit for this send").option("--repeat <interval>","Repeat the campaign weekly or monthly starting at --at. Audience membership is re-evaluated at every run.").option("--in-recipient-timezone","Deliver at --at's wall-clock time in each recipient's own timezone. Requires --scheduled-timezone.").option("--no-in-recipient-timezone","Disable recipient-timezone delivery and use the selected fixed-time pacing strategy.").option("--scheduled-timezone <zone>","IANA zone the --at wall-clock time refers to, for example America/New_York").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("schedule",{id:e,...t}));S(PFe,{notes:["The campaign must be draft or already scheduled.","Omit --segment, --lists, and target lists to reuse saved campaign targeting, or default to all active subscribers.","--segment, --lists, and the target list flags are mutually exclusive.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.',"With --repeat, the campaign becomes a recurring template: each run is duplicated and sent automatically. Use campaigns unschedule to stop the series and return it to draft, or re-schedule without --repeat to keep a one-shot send.","With --in-recipient-timezone, every contact receives the campaign at --at's wall-clock time in their own timezone; contacts without a stored timezone get it at --at in --scheduled-timezone. Not combinable with --repeat or --spread-over-hours.","Use --send-time-optimization with optional --send-time-window-hours (1-24, default 12), or --disable-send-time-optimization to turn STO off. A spread or recipient-timezone send disables STO.","Use --max-recipients to send to only the first N matching subscribers; recipients already reached by this campaign count against the cap on resume. Duplicate the campaign and exclude contacts who already received it to send the next batch."],examples:['sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --segment seg_123','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --lists list_123',`sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-json '{"type":"all"}'`,'sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-file ./target-lists.json','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --spread-over-hours 6','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --max-recipients 100','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --send-time-optimization --send-time-window-hours 8','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --repeat monthly','sequenzy campaigns schedule camp_123 --at "2026-06-01T20:00:00-04:00" --in-recipient-timezone --scheduled-timezone America/New_York']});var QFe=rr.command("test <id>").description("Send a test email for a campaign").requiredOption("--to <email>","Recipient email for the test").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("test",{id:e,...t}));S(QFe,{examples:["sequenzy campaigns test camp_123 --to you@example.com"]});var qFe=rr.command("cancel <id>").description("Cancel a scheduled, paused, or sending campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("cancel",{id:e,...t}));S(qFe,{notes:["Cancelling stops scheduled, paused, waiting-approval, and actively sending campaigns immediately.","No confirmation prompt is shown so a bad send can be stopped fast."],examples:["sequenzy campaigns cancel camp_123"]});var FFe=rr.command("unschedule <id>").description("Return a scheduled campaign to draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("unschedule",{id:e,...t}));S(FFe,{notes:["Only scheduled campaigns can be unscheduled.","Unscheduling removes the pending send and recurrence, then returns the campaign to an editable draft."],examples:["sequenzy campaigns unschedule camp_123"]});var LFe=rr.command("pause <id>").description("Pause a campaign that is currently sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("pause",{id:e,...t}));S(LFe,{notes:["Only campaigns in sending status can be paused."],examples:["sequenzy campaigns pause camp_123"]});var UFe=rr.command("resume <id>").description("Resume a paused campaign").option("--spread-over-hours <hours>","Spread the remaining delivery over 1-72 hours").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("resume",{id:e,...t}));S(UFe,{notes:["Only paused campaigns can be resumed."],examples:["sequenzy campaigns resume camp_123","sequenzy campaigns resume camp_123 --spread-over-hours 6"]});var MFe=rr.command("delete <id>").description("Delete a campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("delete",{id:e,...t}));S(MFe,{notes:["Sending, scheduled, and paused campaigns must be cancelled before they can be deleted."],examples:["sequenzy campaigns delete camp_123 --yes"]});var jFe=rr.command("share <id>").description("Create or fetch the campaign's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("share",{id:e,...t}));S(jFe,{notes:["The hosted page is anonymized: sample contact, inert unsubscribe link, no open/click tracking.","Idempotent - rerunning returns the same URL until you run `campaigns unshare`."],examples:["sequenzy campaigns share camp_123"]});var zFe=rr.command("unshare <id>").description("Revoke the campaign's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("unshare",{id:e,...t}));S(zFe,{notes:["The shared URL returns 404 immediately after revocation."],examples:["sequenzy campaigns unshare camp_123"]});var GFe=rr.command("duplicate <id>").description("Duplicate a campaign as a new draft").option("--mode <mode>","Duplicate mode: campaign, ab_test, or variant","campaign").option("--variant-id <id>","A/B test variant to copy when --mode is variant").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("duplicate",{id:e,...t}));S(GFe,{notes:["Mode campaign copies the campaign email, ab_test also copies the A/B test with all variants, and variant copies one variant's content as a plain campaign."],examples:["sequenzy campaigns duplicate camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test","sequenzy campaigns duplicate camp_123 --mode variant --variant-id var_b"]});var HFe=rr.command("resend-to-non-openers <id>").description("Create a draft resend to subscribers who didn't open a sent campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("resend-to-non-openers",{id:e,...t}));S(HFe,{notes:["Only available 6 hours after a sent campaign finishes sending.","Unavailable for imported already-sent campaigns because Sequenzy has no opens for a send it did not deliver.",`Creates a draft targeting the same audience plus a "didn't open this campaign" rule. Review the draft, then schedule or send it.`,"The response includes an estimate of how many subscribers haven't opened the original.","Every audience format keeps hard opener exclusions across manual additions and repeated resends. Live audience membership can include new subscribers.","Recreate older drafts missing excludedCampaignOpenerIds from the original campaign and review before scheduling."],examples:["sequenzy campaigns resend-to-non-openers camp_123"]});function u5(e){return e.option("--description <text>","Goal description").option("--trigger-type <type>","Goal signal: event, attribute_change, or tag_added").option("--trigger-event-name <event>","Event goal signal name").option("--trigger-tag-name <tag>","Tag name for tag_added goals").option("--attribute-path <path>","Subscriber attribute goal path").option("--attribute-condition <condition>","changed, changed_to, or changed_from_to").option("--attribute-value <value>","Target subscriber attribute value").option("--attribute-previous-value <value>","Previous subscriber attribute value").option("--event-property-name <name>","Optional event property whose value is tracked").option("--event-property-label <label>","Display label for the tracked event property").option("--attribution-window-hours <hours>","Goal attribution window in hours")}var uC=rr.command("goals").description("Manage persisted campaign conversion goals");uC.command("list <campaignId>").description("List campaign goals").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>fr("goals",{id:e,...t}));u5(uC.command("create <campaignId> <name>").description("Create a campaign conversion goal")).option("--active","Create the goal with conversion tracking on (default)").option("--inactive","Create the goal with conversion tracking off").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>fr("goal-create",{id:e,name:t,isActive:n.active,notActive:n.inactive,...n}));u5(uC.command("update <campaignId> <goalId>").description("Update a campaign conversion goal").option("--name <name>","Goal name")).option("--active","Enable the goal").option("--inactive","Disable the goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>fr("goal-update",{id:e,goalId:t,isActive:n.active,notActive:n.inactive,...n}));uC.command("delete <campaignId> <goalId>").description("Delete a campaign conversion goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>fr("goal-delete",{id:e,goalId:t,...n}));var ps=rr.command("variations").description("Compare alternative versions of a campaign email (the editor's Canvas tab)").action(()=>ps.help());S(ps,{notes:["Variations never change what the campaign sends until you run `use`.","`generate` returns at once with variations in the generating state; pass --wait to block until each one is ready or failed.","`section-options` saves nothing: apply an option by swapping its replacement blocks into the variation and running `update`.","`edit` changes one variation with the AI and saves it (optionally only --sections).","--style close keeps the source's style, fresh takes different directions, bold designs each version anew with its own layout, colors and fonts."],examples:['sequenzy campaigns variations generate camp_123 --prompt "Three shorter, warmer versions" --wait','sequenzy campaigns variations generate camp_123 --prompt "Completely new style" --count 2 --style bold --parent var_456','sequenzy campaigns variations edit camp_123 var_456 --prompt "Make the hero dark" --sections hero_1',"sequenzy campaigns variations use camp_123 var_456"]});function d5(e){return e.option("--blocks-json <json>","Email blocks as JSON").option("--blocks-file <path>","Read email blocks JSON from a file").option("--html <html>","HTML content, converted to blocks").option("--html-file <path>","Read HTML content from a file").option("--subject <subject>","Subject this variation uses").option("--preview-text <text>","Preview text this variation uses").option("--summary <text>","What this version changes").option("--email-theme-json <json>","The variation's own email theme as JSON (partial themes are completed; null uses the email's)").option("--email-theme-file <path>","Read the variation's email theme JSON from a file").option("--font-family <family>","The variation's own body font (null uses the email's)")}var p5="close (edit, keep the source's style), fresh (default; new structure, brand look) or bold (new structure, colors and fonts)";ps.command("list <campaignId>").description("List a campaign's variations").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("list",{id:e,...t}));ps.command("get <campaignId> <variationId>").description("Show one variation").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("get",{id:e,variationId:t,...n}));ps.command("generate <campaignId>").description("Generate variations with AI").requiredOption("--prompt <text>","Direction for the new versions").option("--count <n>","How many variations, 1-4 (default 3)").option("--parent <variationId>","Branch from this variation").option("--style <style>",`How far to move: ${p5}`).option("--wait","Wait until every variation is ready or failed").option("--timeout <seconds>","How long --wait waits (default 300)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("generate",{id:e,...t}));d5(ps.command("create <campaignId>").description("Save content as a new variation").requiredOption("--name <name>","Variation name").option("--parent <variationId>","Save it as a branch of this variation")).option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("create",{id:e,...t}));d5(ps.command("update <campaignId> <variationId>").description("Rename a variation, replace its content or move it").option("--name <name>","New name").option("--position <x,y>","Place it on the canvas at these coordinates").option("--reset-position","Let the canvas place it automatically")).option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("update",{id:e,variationId:t,...n}));ps.command("discard <campaignId> <variationId>").description("Discard a variation (restorable)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("discard",{id:e,variationId:t,...n}));ps.command("restore <campaignId> <variationId>").description("Bring back a discarded variation").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("restore",{id:e,variationId:t,...n}));ps.command("use <campaignId> <variationId>").description("Put a variation's content in the campaign email (draft campaigns; the previous content is kept as a variation)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("use",{id:e,variationId:t,...n}));ps.command("edit <campaignId> <variationId>").description("Change one variation with AI and save it").requiredOption("--prompt <text>","What should change").option("--sections <ids>","Only change these comma-separated top-level block ids").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("edit",{id:e,variationId:t,...n}));ps.command("section-options <campaignId>").description("Generate options for selected sections (nothing is saved)").requiredOption("--prompt <text>","What should change").requiredOption("--sections <ids>","Comma-separated top-level block ids").option("--variation <variationId>","Vary this variation instead of the email").option("--count <n>","How many options, 1-4 (default 3)").option("--style <style>",`How far to move: ${p5}`).option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("section-options",{id:e,...t}));var WA=Ve.command("forms").description("Inspect and update saved signup forms").action(()=>WA.help());S(WA,{notes:["Run `forms list --json` before replacing blocks so you can preserve the complete current block array.","Saved-form updates are partial: only the options you pass change.","When Webflow is connected, custom form embeds and their submission endpoints are disabled for that workspace; configure selected native forms in Settings -> Integrations -> Webflow."],examples:["sequenzy forms list --json",'sequenzy forms update form_123 --button-text "Join now"',"sequenzy forms update form_123 --theme-file ./theme.json"]});var JFe=WA.command("list").description("List saved forms and their current content").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including content blocks").action((e)=>Qg("list",e));S(JFe,{examples:["sequenzy forms list","sequenzy forms list --json"]});Ve.command("submissions <type> <id>").description("Read form, popup or landing_page submission payloads").option("-c, --company <id>","Company ID override").option("--field <name>","Exact custom field name (requires --value)").option("--value <value>","Exact answer or array member (requires --field)").option("--limit <count>","Page size, 1 to 100 (default 50)").option("--cursor <cursor>","Resume from nextCursor").option("--json","Print complete JSON payloads and labels").option("--csv","Export all matching pages to stdout").action((e,t,n)=>Qg("submissions",{type:e,id:t,...n}));WA.command("submissions <id>").description("Read saved submitted answers and payloads; --csv exports all matching pages").option("-c, --company <id>","Company ID override").option("--field <name>","Exact custom field name (requires --value)").option("--value <value>","Exact answer or array member (requires --field)").option("--limit <count>","Page size, 1 to 100 (default 50)").option("--cursor <cursor>","Resume from nextCursor").option("--json","Print the complete page including labels and payloads").option("--csv","Export matching pages as CSV to stdout").action((e,t)=>Qg("submissions",{id:e,...t}));var KFe=WA.command("update <id>").description("Update a saved form").option("-n, --name <name>","Saved form name").option("-l, --list <ids...>","Replacement list IDs").option("-t, --tag <ids...>","Replacement tag IDs").option("--clear-tags","Remove every saved form tag").option("--duplicate-strategy <strategy>","Existing subscriber handling: skip, merge, or overwrite").option("--resubscribe-behavior <behavior>","Unsubscribed contacts who submit again: reactivate (default) or double_opt_in").option("--bot-protection","Run a Cloudflare bot check before each signup; failed checks confirm by email").option("--no-bot-protection","Turn the bot check off").option("--headline <text>","First main-form heading text").option("--description <text>","First main-form paragraph text").option("--button-text <text>","Submit button label").option("--success-message <text>","Success screen message").option("--redirect-url <url>","HTTP/HTTPS success redirect; pass an empty string to clear").option("--theme-json <json>","Inline partial capture theme JSON").option("--theme-file <file>","Path to partial capture theme JSON").option("--blocks-json <json>","Inline complete content blocks JSON").option("--blocks-file <file>","Path to complete content blocks JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qg("update",{id:e,...t}));S(KFe,{notes:["Use `forms list --json` and send the complete blocks array when replacing blocks.","The form must retain exactly one email field and one submit button.",'Group sibling blocks with { id, kind: "group", label, layout: "stack" | "row" | "grid" | "overlay", columns, gap, padding, overlayColor, overlayPosition, overlayShade, children }. In Overlay, gap spaces the foreground children while the direct image remains the background. Overlay needs exactly one direct image; nested images only enable their subgroup. Groups may nest three levels; IDs stay unique across the full tree.','Input blocks are { id, kind: "form-field", fieldType, name, label, required, mapsTo, options }. fieldType: text, email, phone, number, textarea, select, radio, checkbox, consent, hidden. mapsTo: email, firstName, lastName, phone, customAttribute (default; stores the answer under `name`). Choice fields need options: [{ value, label, id }] - label and id default to value.',"A hidden field with a defaultValue stores that server-owned value and ignores submitted values; a hidden field without one stores the value the page submits.",'Each block kind accepts only its own properties, and anything else is rejected by name: a custom-html block carries markup in "html" with a pixel "height", not "content".',"Use --clear-tags to replace the current tag targeting with an empty list."],examples:['sequenzy forms update form_123 --headline "Weekly planning" --button-text "Get the planner"',"sequenzy forms update form_123 --list list_123 list_456 --clear-tags","sequenzy forms update form_123 --theme-file ./form-theme.json --blocks-file ./form-blocks.json --json"]});var kc=Ve.command("popups").description("Manage on-site signup popups").action(()=>kc.help());S(kc,{notes:["Popups are the on-site overlay capture surface; `forms` covers inline embedded forms.","A popup is deployed with one script tag - `popups embed <id>` prints it.","When Webflow is connected, `popups embed` returns the native Webflow configuration path instead of custom code, and existing popup scripts stop submitting for that workspace.","Popup updates are partial: only the options you pass change.","Trigger, targeting, schedule, frequency, visual, and reward patches are merged key by key, so setting one key keeps the rest.","A reward turns the popup into a scratch card: the visitor scratches a teaser, claims it with their email, and sees the reward value and code after submitting. The same value is saved to the subscriber's `discount` attribute for {{discount.code}} in emails."],examples:["sequenzy popups list --json",'sequenzy popups create --name "Welcome offer" --template discount-offer --list list_123',"sequenzy popups update pop_123 --status draft","sequenzy popups duplicate pop_123","sequenzy popups embed pop_123"]});var VFe=kc.command("list").description("List saved popups with their status and conversion stats").option("-c, --company <id>","Company ID override for personal API keys").option("--include-content","Include every popup's full content blocks (large)").option("--json","Print raw JSON").action((e)=>Tl("list",e));S(VFe,{notes:["Content blocks are omitted by default because each popup adds roughly 1.8k characters. Use `popups get <id> --json` for one popup's full content."],examples:["sequenzy popups list","sequenzy popups list --json","sequenzy popups list --include-content --json"]});var WFe=kc.command("get <id>").description("Show one popup with its complete content").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including content blocks").action((e,t)=>Tl("get",{id:e,...t}));S(WFe,{notes:["Run this with --json before replacing blocks so you can preserve the complete current block array."],examples:["sequenzy popups get pop_123 --json"]});var YFe=kc.command("create").description("Create a popup and print its embed script").requiredOption("-n, --name <name>","Internal popup name").option("--template <id>","Starting design: newsletter-modal, discount-offer, scratch-to-reveal, countdown-launch, minimal-slide-in, exit-lead-magnet, live-demo, launch-modal, paper-digest, stark-takeover, top-bar, announcement-bar, or fullscreen-welcome").option("--status <status>","draft or published (default: published)").option("-l, --list <ids...>","List IDs every signup is added to").option("--all-lists","Capture into every list (the default)").option("-t, --tag <ids...>","Tag IDs applied to every signup").option("--duplicate-strategy <strategy>","Existing subscriber handling: skip, merge, or overwrite").option("--resubscribe-behavior <behavior>","Unsubscribed contacts who submit again: reactivate (default) or double_opt_in").option("--bot-protection","Run a Cloudflare bot check before each signup; failed checks confirm by email").option("--no-bot-protection","Turn the bot check off").option("--headline <text>","First heading text").option("--description <text>","First paragraph text").option("--button-text <text>","Submit button label").option("--success-message <text>","Success screen message").option("--redirect-url <url>","HTTP/HTTPS success redirect").option("--presentation <mode>","modal, slide-in, floating-bar, or fullscreen").option("--placement <spot>","center, left, right, top, or bottom").option("--trigger-json <json>","Inline partial trigger JSON").option("--trigger-file <file>","Path to partial trigger JSON").option("--targeting-json <json>","Inline partial targeting JSON").option("--targeting-file <file>","Path to partial targeting JSON").option("--schedule-json <json>","Inline partial schedule JSON").option("--schedule-file <file>","Path to partial schedule JSON").option("--frequency-json <json>","Inline partial frequency JSON").option("--frequency-file <file>","Path to partial frequency JSON").option("--visual-json <json>","Inline partial visual JSON").option("--visual-file <file>","Path to partial visual JSON").option("--reward-json <json>","Inline partial scratch-to-reveal reward JSON").option("--reward-file <file>","Path to partial scratch-to-reveal reward JSON").option("--theme-json <json>","Inline partial capture theme JSON").option("--theme-file <file>","Path to partial capture theme JSON").option("--blocks-json <json>","Inline complete content blocks JSON").option("--blocks-file <file>","Path to complete content blocks JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Tl("create",e));S(YFe,{notes:["Popups are published by default, so the embed script is live as soon as you paste it. Use --status draft to stage one.","Omit --list (or pass --all-lists) to capture into every list, matching the dashboard default.",`Trigger example: --trigger-json '{"type":"exit-intent"}' or '{"type":"delay","delaySeconds":10}'.`,`Reward example: --reward-json '{"enabled":true,"value":"10% off your first order","code":"WELCOME10","coverStyle":"gold"}'. The value and code are not in the embed script; the submit response returns them.`],examples:['sequenzy popups create --name "Welcome offer" --template discount-offer --list list_123',`sequenzy popups create --name "Scratch card" --template scratch-to-reveal --reward-json '{"value":"10% off your first order","code":"WELCOME10"}'`,`sequenzy popups create --name "Exit capture" --trigger-json '{"type":"exit-intent"}' --status draft`]});var ZFe=kc.command("update <id>").description("Update a popup, including publishing and unpublishing it").option("-n, --name <name>","Internal popup name").option("--status <status>","draft or published").option("-l, --list <ids...>","Replacement list IDs").option("--all-lists","Capture into every list").option("-t, --tag <ids...>","Replacement tag IDs").option("--clear-tags","Remove every popup tag").option("--duplicate-strategy <strategy>","Existing subscriber handling: skip, merge, or overwrite").option("--resubscribe-behavior <behavior>","Unsubscribed contacts who submit again: reactivate (default) or double_opt_in").option("--bot-protection","Run a Cloudflare bot check before each signup; failed checks confirm by email").option("--no-bot-protection","Turn the bot check off").option("--headline <text>","First heading text").option("--description <text>","First paragraph text").option("--button-text <text>","Submit button label").option("--success-message <text>","Success screen message").option("--redirect-url <url>","HTTP/HTTPS success redirect; pass an empty string to clear").option("--presentation <mode>","modal, slide-in, floating-bar, or fullscreen").option("--placement <spot>","center, left, right, top, or bottom").option("--trigger-json <json>","Inline partial trigger JSON").option("--trigger-file <file>","Path to partial trigger JSON").option("--targeting-json <json>","Inline partial targeting JSON").option("--targeting-file <file>","Path to partial targeting JSON").option("--schedule-json <json>","Inline partial schedule JSON").option("--schedule-file <file>","Path to partial schedule JSON").option("--frequency-json <json>","Inline partial frequency JSON").option("--frequency-file <file>","Path to partial frequency JSON").option("--visual-json <json>","Inline partial visual JSON").option("--visual-file <file>","Path to partial visual JSON").option("--reward-json <json>","Inline partial scratch-to-reveal reward JSON").option("--reward-file <file>","Path to partial scratch-to-reveal reward JSON").option("--theme-json <json>","Inline partial capture theme JSON").option("--theme-file <file>","Path to partial capture theme JSON").option("--blocks-json <json>","Inline complete content blocks JSON").option("--blocks-file <file>","Path to complete content blocks JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Tl("update",{id:e,...t}));S(ZFe,{notes:["Use `popups get <id> --json` and send the complete blocks array when replacing blocks.","The popup must retain exactly one email field and one submit button.",'Group sibling blocks with { id, kind: "group", label, layout: "stack" | "row" | "grid" | "overlay", columns, gap, padding, overlayColor, overlayPosition, overlayShade, children }. In Overlay, gap spaces the foreground children while the direct image remains the background. Overlay needs exactly one direct image; nested images only enable their subgroup. Groups may nest three levels; IDs stay unique across the full tree.','Each block kind accepts only its own properties, and anything else is rejected by name: a custom-html block carries markup in "html" with a pixel "height", not "content".',"`--status draft` stops a popup showing without deleting it or changing the embed script; `--status published` puts it back.","Use --clear-tags to replace the current tag targeting with an empty list, and --all-lists to capture into every list."],examples:['sequenzy popups update pop_123 --headline "Take 10% off" --button-text "Send my code"',"sequenzy popups update pop_123 --status draft",`sequenzy popups update pop_123 --targeting-json '{"paths":["/pricing"],"device":"desktop"}'`]});var XFe=kc.command("duplicate <id>").description("Copy a popup into a new draft with its own stats").option("-n, --name <name>",'Name for the copy (default: "... (copy)")').option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Tl("duplicate",{id:e,...t}));S(XFe,{notes:["The copy starts as a draft with its own view and conversion counts, so the original keeps showing and keeps its stats.","Publish the copy with `popups update <new-id> --status published`."],examples:["sequenzy popups duplicate pop_123",'sequenzy popups duplicate pop_123 --name "Welcome offer v2"']});var e1e=kc.command("embed <id>").description("Print a published popup's embed snippets").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including React, WordPress, and Shopify").action((e,t)=>Tl("embed",{id:e,...t}));S(e1e,{notes:["The popup must be published; publish it with `popups update <id> --status published`.","The snippet carries no API key - trigger, targeting, and audience rules stay server-side."],examples:["sequenzy popups embed pop_123","sequenzy popups embed pop_123 --json"]});var t1e=kc.command("delete <id>").description("Permanently delete a popup and its stats").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Tl("delete",{id:e,...t}));S(t1e,{notes:["This also deletes the popup's view and conversion counts. To stop it showing while keeping its stats, use `popups update <id> --status draft`.","Subscribers the popup already captured are not affected."],examples:["sequenzy popups delete pop_123"]});var eo=Ve.command("landing-pages").description("Manage landing pages").action(()=>eo.help());S(eo,{notes:["Landing pages are created as drafts. Publish only after reviewing the page.","Use landing-pages render to open a signed, unlisted preview of a draft without publishing.","Use --content-json or --content-file for full editor-compatible landing page content.","Custom subdomains require a CNAME record pointing to pages.sequenzydns.com; root domains require an A record pointing to 76.76.21.21."],examples:["sequenzy landing-pages list --company comp_123",'sequenzy landing-pages create "Product Waitlist" --template waitlist',"sequenzy landing-pages render lp_123","sequenzy landing-pages stats lp_123 --period 30d","sequenzy landing-pages publish lp_123","sequenzy landing-pages connect-domain pages.example.com"]});var n1e=eo.command("list").description("List landing pages").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ao("list",e));S(n1e,{examples:["sequenzy landing-pages list --company comp_123"]});var r1e=eo.command("get <id>").description("Get landing page details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("get",{id:e,...t}));S(r1e,{examples:["sequenzy landing-pages get lp_123 --company comp_123"]});var i1e=eo.command("stats <id>").description("Get landing page visit analytics").option("-c, --company <id>","Company ID override for personal API keys").option("--period <period>","Time window: 7d, 30d, 90d, or all").option("--start <timestamp>","Custom range start, ISO 8601").option("--end <timestamp>","Custom range end, ISO 8601").option("--include-bots","Include known crawlers in visit totals").option("--json","Print raw JSON").action((e,t)=>Ao("stats",{id:e,...t}));S(i1e,{notes:["Reports visits, unique visits, clicks, subscribes, conversion rate, referrers, and crawler hits. Preview URLs and the editor are never counted."],examples:["sequenzy landing-pages stats lp_123 --period 30d"]});var o1e=eo.command("render <id>").description("Preview a landing page without publishing it").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("render",{id:e,...t}));S(o1e,{notes:["Returns a signed, unlisted preview URL that works for drafts. Signup forms do not collect contacts until you publish."],examples:["sequenzy landing-pages render lp_123"]});var s1e=eo.command("create [name]").description("Create a draft landing page").option("--slug <slug>","Landing page URL slug").option("--template <template>","Template key, e.g. waitlist").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("create",{name:e,...t}));S(s1e,{notes:["When --content-json/--content-file is omitted, a valid default page is generated from --template."],examples:['sequenzy landing-pages create "Product Waitlist" --template waitlist','sequenzy landing-pages create "Launch Page" --slug launch --content-file ./landing-page.json']});var a1e=eo.command("update <id>").description("Edit a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("update",{id:e,...t}));S(a1e,{examples:['sequenzy landing-pages update lp_123 --name "Updated page"',"sequenzy landing-pages update lp_123 --content-file ./landing-page.json"]});var c1e=eo.command("publish <id>").description("Publish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("publish",{id:e,...t}));S(c1e,{examples:["sequenzy landing-pages publish lp_123"]});var l1e=eo.command("unpublish <id>").description("Unpublish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("unpublish",{id:e,...t}));S(l1e,{examples:["sequenzy landing-pages unpublish lp_123"]});var u1e=eo.command("duplicate <id>").description("Duplicate a landing page as a new draft").option("-n, --name <name>","Name for the copy").option("--slug <slug>","URL slug for the copy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("duplicate",{id:e,...t}));S(u1e,{notes:["The copy is always created as a draft with its own slug, views, and conversions.",'Without --name, the copy is named "<original name> (copy)".'],examples:["sequenzy landing-pages duplicate lp_123",'sequenzy landing-pages duplicate lp_123 --name "Spring Sale v2" --slug spring-sale-v2']});var d1e=eo.command("delete <id>").description("Delete a landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("delete",{id:e,...t}));S(d1e,{examples:["sequenzy landing-pages delete lp_123"]});var p1e=eo.command("connect-domain <domain>").description("Connect a workspace or dedicated landing page domain").option("--landing-page <id>","Connect the domain only to this landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("connect-domain",{domain:e,...t}));S(p1e,{examples:["sequenzy landing-pages connect-domain pages.example.com --company comp_123","sequenzy landing-pages connect-domain offer.example.com --landing-page lp_123","sequenzy landing-pages connect-domain example.com --landing-page lp_123"]});var m1e=eo.command("update-domain-settings").description("Update or verify landing page domain settings").option("--domain <domain>","Replace the connected landing page domain").option("--verify","Refresh domain verification state").option("--landing-page <id>","Target a dedicated landing page domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ao("update-domain-settings",e));S(m1e,{examples:["sequenzy landing-pages update-domain-settings --domain pages.example.com","sequenzy landing-pages update-domain-settings --verify","sequenzy landing-pages update-domain-settings --landing-page lp_123 --verify"]});var f1e=eo.command("remove-domain <landing-page-id>").description("Remove a dedicated domain from one landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("remove-domain",{landingPage:e,...t}));S(f1e,{examples:["sequenzy landing-pages remove-domain lp_123"]});var xt=Ve.command("sequences").description("Manage email sequences").action(()=>xt.help());S(xt,{notes:["The CLI supports both AI goal-based sequence creation and explicit-step creation.","Trigger-specific options depend on --trigger. For example: contact_added needs --list-id (or --list-ids for several lists), tag_added needs --tag-name (or --tag-names), inactivity needs --event-name and --inactive-days.","Use --goal for AI generation, or --steps-file / --emails-file with JSON arrays that match the API step objects.","Use --enrollment-mode matching_field for product- or variant-specific event sequences.",'Explicit --steps-file input can include dynamic Stripe or Shopify discount actions with {"type":"create_discount","discount":{"provider":"stripe","discountType":"percent","percentOff":20,"duration":"once","appliesToAllPlans":true}}; the code is created when each subscriber reaches the step, and later emails can use {{discount.code}}.',"Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling.",JA],examples:["sequenzy sequences list --company comp_123",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation"',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json","sequenzy sequences enable seq_123","sequenzy sequences simulate seq_123","sequenzy sequences simulate seq_123 --email maya@example.com"]});var g1e=xt.command("list").description("List sequences").option("--status <status>","Filter by draft, active, paused, or archived").option("--search <text>","Search sequence names and descriptions").option("--label <labels...>","Filter by dashboard label names").option("--limit <count>","Page size from 1 to 100").option("--offset <count>","Zero-based result offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Bn("list",e));S(g1e,{examples:["sequenzy sequences list --company comp_123"]});var A1e=xt.command("get <id>").description("Get sequence details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("get",{id:e,...t}));S(A1e,{examples:["sequenzy sequences get seq_123 --company comp_123"]});var h1e=xt.command("pull [key]").description("Save sequence definitions as YAML or JSON files").option("--id <sequenceId>","Pull a sequence that has no key yet, by its id").option("--key <key>","With --id: the key to give the pulled definition").option("--all","Pull every sequence that has a key").option("--dir <dir>","Directory to write files to (default: current directory)").option("--format <format>","yaml (default) or json").option("--stdout","Print the definition instead of writing a file").option("--raw","Pull the explicit form (every step plus a connections list) instead of the readable one").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>p9(e,t));S(h1e,{notes:["A definition is one document per sequence: settings, steps and connections, addressed by keys you choose.","Pushing a pulled file back unchanged changes nothing."],examples:["sequenzy sequences pull onboarding --dir sequences","sequenzy sequences pull --all --dir sequences","sequenzy sequences pull --id seq_123 --key onboarding --dir sequences"]});var y1e=xt.command("new <key>").description("Write a starter sequence definition file").option("--dir <dir>","Directory to write it to (default: current directory)").option("--name <name>","Sequence name (default: from the key)").action((e,t)=>f9(e,t));S(y1e,{examples:["sequenzy sequences new onboarding --dir sequences","sequenzy sequences push sequences/onboarding.yaml --dry-run"]});var b1e=xt.command("push <paths...>").description("Create or update sequences from definition files").option("--dry-run","Show what would change without saving").option("--confirm-live-change","Allow changes to active sequences (they affect current and future recipients)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>m9(e,t));S(b1e,{notes:["Accepts .yaml, .yml and .json files or directories of them. A file without a key uses its file name.","A push never turns a sequence on or off. New sequences start as drafts managed by code, so their steps are read-only in the dashboard.","Steps are matched by key. Contacts waiting on a removed step continue to the next step."],examples:["sequenzy sequences push sequences --dry-run","sequenzy sequences push sequences/onboarding.yaml","sequenzy sequences push sequences --confirm-live-change"]});var v1e=xt.command("edit-emails <id>").description("Change the sequence's emails with AI in one request: every email, the ones the prompt names, or the ones you list").requiredOption("--prompt <text>","What should change").option("--emails <ids>","Only these comma-separated email IDs (from sequences get)").option("--sections <ids>","Only these comma-separated top-level block IDs; needs exactly one --emails ID").option("--dry-run","Return the changes without saving them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>A9({id:e,...t}));S(v1e,{notes:['Without --emails, the prompt decides: it changes every email unless it names some ("change the structure of email 2").',"A look change (background, colors, fonts) is made identical across the emails it touches.","A/B test steps, HTML emails and steps without an email are skipped and listed.","Each email succeeds or fails on its own; changed emails are saved unless --dry-run is set. One request edits up to 12 emails; edit longer sequences in batches with --emails. If the command times out, run sequences get before retrying: changes may already be saved."],examples:['sequenzy sequences edit-emails seq_123 --prompt "Make the background cream"','sequenzy sequences edit-emails seq_123 --prompt "Remove the header" --dry-run --json','sequenzy sequences edit-emails seq_123 --prompt "New structure" --emails email_2','sequenzy sequences edit-emails seq_123 --prompt "Stronger headline" --emails email_2 --sections hero_1']});var Lm=xt.command("variations").description("Design variations of one email of a sequence, then use one for it or every email (the editor's Emails view)").action(()=>Lm.help());S(Lm,{notes:["Variations never change the email until you run `use`.","`generate` returns at once with variations in the generating state; pass --wait to block until each one is ready or failed.","`use` saves the variation's design (blocks, theme, font) into the email, which keeps its subject and preview text. With --all, every other email takes its style too, keeping its own words.","Preview one with: sequenzy sequences render <id> --node <nodeId> --variation <variationId>"],examples:['sequenzy sequences variations generate seq_123 --email email_1 --prompt "A few bolder versions" --wait',"sequenzy sequences variations list seq_123 --email email_1","sequenzy sequences variations use seq_123 var_456 --email email_1 --all --dry-run","sequenzy sequences variations discard seq_123 var_456 --email email_1"]});Lm.command("list <id>").description("List an email's variations").requiredOption("--email <emailId>","The email's ID (from sequences get)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>UA("list",{id:e,...t}));Lm.command("generate <id>").description("Design variations of an email with AI").requiredOption("--email <emailId>","The email's ID (from sequences get)").requiredOption("--prompt <text>","What the variations should explore").option("--count <n>","How many variations, 1-4 (default 3)").option("--style <style>","close (keep its style), fresh (default; other structures, brand look) or bold (also its own look)").option("--wait","Wait until every variation is ready or failed").option("--timeout <seconds>","How long --wait waits (default 300)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>UA("generate",{id:e,...t}));Lm.command("use <id> <variationId>").description("Save a variation's design into the email, or with --all every email's style").requiredOption("--email <emailId>","The email's ID (from sequences get)").option("--all","Every other email takes the variation's style too").option("--dry-run","Show what would change without saving").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>UA("use",{id:e,variationId:t,...n}));Lm.command("discard <id> <variationId>").description("Discard a variation").requiredOption("--email <emailId>","The email's ID (from sequences get)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>UA("discard",{id:e,variationId:t,...n}));var E1e=VR(xt.command("render <id>").description("Render one sequence email step to email-ready HTML").requiredOption("--node <nodeId>","Email step node ID from sequences get").option("--variant <id>","Render a specific A/B test variant").option("--variation <id>","Render a design variation of the email (from variations list)")).action((e,t)=>Jv({type:"sequence-step",sequenceId:e,nodeId:t.node},t));S(E1e,{notes:ZR,examples:["sequenzy sequences render seq_123 --node node_1 --out preview.html","sequenzy sequences render seq_123 --node node_1 --subscriber sub_123 --json","sequenzy sequences render seq_123 --node node_1 --email you@example.com --tag extended"]});var I1e=WR(xt.command("check <id>").description("Check one sequence email step: broken links and images, placeholders, content and client issues").requiredOption("--node <nodeId>","Email step node ID from sequences get").option("--variant <id>","Check a specific A/B test variant")).action((e,t)=>Kv({type:"sequence-step",sequenceId:e,nodeId:t.node},t));S(I1e,{notes:YR,examples:["sequenzy sequences check seq_123 --node node_1","sequenzy sequences check seq_123 --node node_1 --fail-on warning --json"]});var C1e=xt.command("test <id>").description("Send a test email for one saved sequence step").requiredOption("--node <nodeId>","Email step node ID from sequences get").requiredOption("--to <emails...>","One or more reviewer email addresses (maximum 10)").option("--attr <key=value...>","Render as a contact with this custom attribute (repeatable); contacts are not changed").option("--attrs-json <json>","Render as a contact with these custom attributes, as a JSON object").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("test",{id:e,...t,nodeId:t.node}));S(C1e,{notes:["This sends only the selected saved email step; it does not enable the sequence or enroll subscribers.","Use sequences get first to find the email step nodeId.","--attr/--attrs-json override the recipients' stored attributes for this render only (merge tags and block conditions), so reviewers see the version a contact with those values gets. --attr wins over --attrs-json for the same key; values from --attr are strings. When a reviewer is a stored contact, email and name keys such as firstName or name come from that contact and are ignored."],examples:["sequenzy sequences test seq_123 --node node_email_2 --to reviewer@example.com","sequenzy sequences test seq_123 --node node_email_2 --to reviewer-one@example.com reviewer-two@example.com",`sequenzy sequences test seq_123 --node node_email_2 --to reviewer@example.com --attrs-json '{"trader_type":"prop_firm","goals":["bias","ai"]}'`]});xt.command("test-run <id>").description("Run real sequence actions for one subscriber with optional event properties").requiredOption("--subscriber <id>","Active subscriber ID").option("--event-properties <json>","Trigger event properties as a JSON object, including arrays and nested objects").option("--speed-multiplier <number>","Delay acceleration, 60 to 10000","120").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("test-run",{id:e,...t}));xt.command("test-run-get <id> <runId>").description("Inspect live sequence test status and step logs").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON including step logs").action((e,t,n)=>Bn("test-run-get",{id:e,runId:t,...n}));var w1e=xt.command("simulate <id>").description("Preview who a sequence would enroll and, optionally, one contact's path. Does not send mail or enroll anyone.").option("--subscriber <id>","Walk the graph for this stored subscriber").option("--email <address>","Walk the graph for this stored subscriber email").option("--limit <number>","Maximum current matches to sample (1-25)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("simulate",{id:e,...t,simulateEmail:typeof t.email==="string"?t.email:void 0}));S(w1e,{notes:["Without --subscriber/--email this reports who currently matches and whether the sequence is ready. Nobody is auto-enrolled when you activate; list, tag, and segment matches can still be enrolled by hand.","This does not send mail, mint discounts, or write tags. Use sequences test to send one saved email step to a reviewer.","Readiness errors are the same checks that should be fixed before sequences enable."],examples:["sequenzy sequences simulate seq_123","sequenzy sequences simulate seq_123 --email maya@example.com","sequenzy sequences simulate seq_123 --subscriber sub_123 --limit 25 --json"]});function m5(e){return e.option("--description <text>","Goal description").option("--trigger-type <type>","Goal signal: event, attribute_change, or tag_added").option("--trigger-event-name <event>","Event goal signal name").option("--trigger-tag-name <tag>","Tag name for tag_added goals").option("--attribute-path <path>","Subscriber attribute goal path").option("--attribute-condition <condition>","changed, changed_to, or changed_from_to").option("--attribute-value <value>","Target subscriber attribute value").option("--attribute-previous-value <value>","Previous subscriber attribute value").option("--event-property-name <name>","Optional event property whose value is tracked").option("--event-property-label <label>","Display label for the tracked event property").option("--attribution-window-hours <hours>","Goal attribution window in hours")}var dC=xt.command("goals").description("Manage persisted sequence conversion goals");dC.command("list <sequenceId>").description("List sequence goals").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("goals",{id:e,...t}));m5(dC.command("create <sequenceId> <name>").description("Create a sequence conversion goal")).option("--active","Create the goal with conversion tracking on (default)").option("--inactive","Create the goal with conversion tracking off").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>Bn("goal-create",{id:e,name:t,isActive:n.active,notActive:n.inactive,...n}));m5(dC.command("update <sequenceId> <goalId>").description("Update a sequence conversion goal").option("--name <name>","Goal name")).option("--active","Enable the goal").option("--inactive","Disable the goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>Bn("goal-update",{id:e,goalId:t,isActive:n.active,notActive:n.inactive,...n}));dC.command("delete <sequenceId> <goalId>").description("Delete a sequence conversion goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>Bn("goal-delete",{id:e,goalId:t,...n}));var XR=xt.command("webhook").description("Manage a sequence inbound webhook endpoint");XR.command("get <sequenceId>").description("Read a sequence inbound webhook URL and setup status").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("webhook-get",{id:e,...t}));XR.command("configure <sequenceId>").description("Create or update a sequence inbound webhook endpoint").option("--field-mapping-json <json>","Inline mapping with email, optional names, and property paths").option("--field-mapping-file <file>","JSON file containing the webhook field mapping").option("--sample-payload-json <json>","Inline representative webhook payload").option("--sample-payload-file <file>","JSON file containing a representative webhook payload").option("--clear-field-mapping","Clear the saved mapping and return the endpoint to pending setup").option("--clear-sample-payload","Clear the saved sample payload").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("webhook-configure",{id:e,...t}));XR.command("rotate <sequenceId>").description("Rotate a sequence inbound webhook secret and URL").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("webhook-rotate",{id:e,...t}));var S1e=xt.command("create <name>").description("Create a blank, AI-generated, or explicit-step sequence").option("-t, --trigger <trigger>","Sequence trigger type (defaults to contact_added; manual never auto-enrolls)").option("--description <text>","Sequence description").option("--label <labels...>","Dashboard label names to assign").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>",X9).option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile-id <id>","Existing reply profile ID; carries its own name, so omit --reply-to and --reply-to-name").option("--bcc-emails <emails>","Comma-separated sequence-level BCC addresses (max 10)").option("-g, --goal <goal>","AI generation goal for the sequence").option("--email-count <count>","Number of AI-generated emails when using --goal (1-10)").option("--duration-days <days>","Total duration in days for AI-generated sequence delays when using --goal").option("--email-style <style>","Style for AI-generated emails when using --goal: visual (designed) or plain (text-first)").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--respect-frequency-cap","Skip email steps for contacts already at the company frequency cap").option("--active-subscribers-only","Only enroll active contacts; unsubscribed and bounced contacts do not enter").option("--send-to-not-subscribed <mode>","Send marketing emails to not subscribed contacts too: on, off, or default (on for ecommerce.checkout_started triggers, off otherwise)").option("--key-date <entries...>",'Key date as "Label=2026-11-27T00:00:00" (repeatable; zone-less times are read in --key-dates-timezone); optionally "key:Label=..." to pin the key. Requires --key-dates-timezone').option("--key-dates-timezone <timezone>","IANA timezone the key dates are written in, e.g. America/New_York").option("--key-dates-json <json>",'Inline key dates: {"timezone":"America/New_York","dates":[{"label":"Black Friday starts","at":"2026-11-27T00:00:00-05:00"}]}').option("--key-dates-file <file>","JSON file with the key dates object").option("--send-spread-hours <hours>","Spread each countdown email over this many hours so contacts get it at different times (default 4; 0 sends everyone at the exact time)").option("--list-id <id>","List ID for contact_added triggers").option("--list-ids <ids...>","Several list IDs for contact_added; joining any one of them enrols the contact").option("--list-scope <scope>","contact_added with no list: any_contact (default, includes contacts in no list) or any_list").option("--tag-name <name>","Tag name for tag_added triggers").option("--tag-names <names...>","Several tag names for tag_added; receiving any one of them enrols the contact").option("--segment-id <id>","Segment ID for segment_entered and segment_exited triggers").option("--stop-on-segment-exit","Cancel active enrollments when a contact leaves the trigger segment").option("--event-name <name>","Event name for event_received, inbound_webhook, inactivity, and frequency triggers").option("--integration-slug <slug>","Inbound webhook integration slug").option("--integration-event-key <key>","Inbound webhook integration event key").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file with a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline JSON array of event property filters for event_received triggers").option("--property-filters-file <file>","Path to a JSON file with event property filters").option("--inactive-days <days>","Days of inactivity for inactivity triggers").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum event count for frequency triggers").option("--time-window-days <days>","Time window for frequency triggers").option("--steps-json <json>","Inline JSON array of sequence steps").option("--steps-file <file>","Path to a JSON file with sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("create",{name:e,...t}));S(S1e,{notes:["Provide --goal for AI generation, --steps-json/--steps-file for explicit content, or omit both for a blank dashboard-compatible draft.","Each explicit email step needs subject plus either html or blocks. Discount action steps use type=create_discount to dynamically create a code before an email that references {{discount.code}}.",'SMS steps use type="sms" with a plain-text "text" field (optional label, ineligibleAction skip|exit, imageUrls). Generate copy with `sequenzy generate sms` and check `sequenzy sms settings` first.','Update Subscriber steps use type="update_subscriber", nodeType="action_update_attributes", and config values such as {{event.plan}}, {{event.amount}}, or {{event.active}}.',"For migrated provider flows, put the exact provider HTML in each step's html field; Sequenzy stores it as raw HTML. Use delay or delayMs for waits.",'A step may use waitUntilWeekday to hold until the next weekday window, e.g. {"waitUntilWeekday":{"day":"sunday","startTime":"09:00","endTime":"12:00","timezone":"America/Los_Angeles"},"subject":"Weekly digest","html":"..."}. Contacts already inside the window continue immediately; put it before the first email to guarantee the send day at the graph level. Add "timezoneSource":"subscriber" to use the timezone of each contact; timezone is then the fallback for contacts without one. Add "minimumWait":{"days":6} to wait at least 6 days first, then release at the next window, in one step.',"Prefer --steps-file for anything non-trivial. The CLI passes the JSON through to the API.","Shopify replenishment and back-in-stock event sequences default to matching_field.","Use --enrollment-field-path for custom event keys such as order.id or product.providerVariantId.",'Calendar countdowns: use --trigger manual with --key-date entries (plus --key-dates-timezone) and give steps a waitUntilKeyDate, e.g. {"subject":"7 days to go","waitUntilKeyDate":{"key":"black_friday_starts","days":7}}. Keys are slugs of the labels. Then enable the sequence and run sequenzy sequences enroll-audience.',"Use --property-filters-json/--property-filters-file with event_received triggers to only start the sequence when the event properties match, e.g. scope a purchase sequence to one product.","Use --sending-window-start/--sending-window-end/--sending-window-timezone to hold every email step until the allowed local send window. Add --sending-window-days weekdays for working days only.","Use --trigger segment_exited --segment-id <id> to enroll active contacts who stop matching a saved segment, for example a win-back flow. Unsubscribing or bouncing does not count as leaving, and nobody is enrolled when the sequence is turned on.","Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling.","For customer lifecycle state (customer, trial, past-due, cancelled, churned, refunded, visited-payment-page) prefer --trigger tag_added on the tag over the matching saas.* event: the tag is the contact's current state, also covers imported or hand-tagged contacts, and removing it ends the run. These tags start sequences only when the company's sync rules add them; check `sequenzy sync-rules get` and ask before turning the preset on. Keep event_received when emails need that occurrence's data ({{event.hostedInvoiceUrl}}) or must run once per occurrence."],examples:["sequenzy sequences create dunning --trigger tag_added --tag-name past-due --enrollment-mode unlimited --steps-file ./steps.json",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation" --email-count 4 --duration-days 10','sequenzy sequences create trial --trigger tag_added --tag-name trial --goal "Convert trial users" --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays',"sequenzy sequences create restock --trigger event_received --event-name ecommerce.back_in_stock --enrollment-mode matching_field --steps-file ./steps.json",`sequenzy sequences create deliver-ebook --trigger event_received --event-name ecommerce.order_placed --property-filters-json '[{"path":"lineItems[].providerProductId","operator":"equals","value":"prod_123"}]' --steps-file ./steps.json`,"sequenzy sequences create post-purchase --trigger event_received --event-name ecommerce.order_placed --enrollment-mode matching_field --enrollment-field-path order.id --steps-file ./steps.json",'sequenzy sequences create "Black Friday countdown" --trigger manual --enrollment-mode one_time --key-dates-timezone America/New_York --key-date "Black Friday starts=2026-11-27T00:00:00" --key-date "Black Friday ends=2026-11-29T23:59:00" --steps-file ./countdown-steps.json',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json",`sequenzy sequences create purchase-profile --trigger event_received --event-name saas.purchase --steps-json '[{"type":"update_subscriber","nodeType":"action_update_attributes","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}},{"subject":"Thanks","html":"<p>Purchase received.</p>"}]'`,"sequenzy sequences create rescue --trigger inactivity --event-name login --inactive-days 14 --steps-file ./steps.json"]});var D1e=xt.command("from-example <example>").description("Clone an email gallery sequence into a draft sequence written for your brand").option("--brief <text>","Extra direction for every email (takes priority over the example)").option("--name <name>","Sequence name (defaults to the sequence type)").option("--steps <numbers>","Which of the example's emails to clone, by position, e.g. 1,2,4 (default: the first 12)").option("--email-style <style>","Generated email style: visual or plain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>U3(e,t));S(D1e,{notes:["<example> is a gallery sequence URL (https://sequenzy.com/email-examples/brands/{brand}/sequences/{sequence}) or brand/sequence.","Copies the trigger family and send timing (up to 12 emails; --steps picks which, and each kept email keeps its original timing). AI writes each email in your brand in the background; check progress with sequenzy sequences get <id>.","The sequence is created as a draft and sends nothing until you enable it. Running the command again creates another sequence."],examples:["sequenzy sequences from-example https://sequenzy.com/email-examples/brands/linear/sequences/onboarding",'sequenzy sequences from-example linear/onboarding --brief "Push people to invite a teammate"',"sequenzy sequences from-example linear/onboarding --steps 1,2,4"]});var _1e=xt.command("templates").description("List ready-made sequence templates for your company category (including push-first mobile app journeys)").option("--category <type>","company (default), all, saas, content, ecommerce, offline, mobile_app or other").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>v9(e));S(_1e,{notes:["Defaults to your company category (sequenzy companies get), with templates built for it first. Set the category with sequenzy companies update <id> --category mobile_app.","Mobile journeys (mobile_app) trigger on RevenueCat, Superwall and Adapty events (saas.trial_started, saas.payment_failed, saas.cancelled, saas.churn, saas.purchase.yearly) and on app activity (paywall_viewed, app.screen_viewed)."],examples:["sequenzy sequences templates","sequenzy sequences templates --category mobile_app --json"]});var x1e=xt.command("create-from-template <templateId>").description("Create a draft sequence from a template, as the dashboard does").option("--name <name>","Sequence name (defaults to the template name)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>E9(e,t));S(x1e,{notes:["Push-first journeys branch on whether the contact is reachable by push (an active device on a platform with APNs, FCM or web push set up): those contacts get push and in-app, everyone else gets email. Waits land between 09:00 and 21:00 in each contact's timezone.","Emails are written by AI from your brand; push and in-app copy comes from the template, so review it in the dashboard or with sequenzy sequences get <id> before enabling.","Calendar templates that count down to key dates (Black Friday) are created in the dashboard or with sequenzy sequences create --key-dates."],examples:["sequenzy sequences create-from-template mobile-trial-conversion",'sequenzy sequences create-from-template mobile-billing-recovery --name "Billing recovery"']});var B1e=xt.command("preview-example <example>").description("Preview the first emails of an email gallery sequence written for your brand, without saving").option("--website <site>","Write it for another website instead of your brand, e.g. acme.com").option("--brief <text>","Extra direction for every email (takes priority over the example)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including each email's HTML").action((e,t)=>H3(e,t));S(B1e,{notes:["<example> is a gallery sequence URL (https://sequenzy.com/email-examples/brands/{brand}/sequences/{sequence}) or brand/sequence.","Rewrites the first 3 emails and saves nothing. Clone the sequence with sequenzy sequences from-example to write every email."],examples:["sequenzy sequences preview-example linear/onboarding","sequenzy sequences preview-example linear/onboarding --website acme.com --json"]});var k1e=xt.command("update <id>").description("Update sequence metadata, email step content, stop conditions, or paths").option("-n, --name <name>","Sequence name").option("--description <text>","Sequence description").option("--label <labels...>","Replace dashboard label names").option("--clear-labels","Remove all dashboard labels from the sequence").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--trigger <trigger>","Replace the sequence trigger type").option("--list-id <id>","List ID for contact_added").option("--list-ids <ids...>","Several list IDs for contact_added; joining any one of them enrols the contact").option("--list-scope <scope>","contact_added with no list: any_contact (default, includes contacts in no list) or any_list").option("--tag-name <name>","Tag name for tag_added").option("--tag-names <names...>","Several tag names for tag_added; receiving any one of them enrols the contact").option("--segment-id <id>","Segment ID for segment_entered or segment_exited").option("--stop-on-segment-exit","Stop active enrollments when a contact leaves the trigger segment").option("--no-stop-on-segment-exit","Keep active enrollments running when a contact leaves the trigger segment").option("--event-name <event>","Event name for event, webhook, inactivity, or frequency triggers").option("--integration-slug <slug>","Catalog integration slug for inbound_webhook").option("--integration-event-key <key>","Catalog event key for inbound_webhook").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file containing a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline event trigger property filters").option("--property-filters-file <file>","JSON file containing event trigger property filters").option("--inactive-days <days>","Days required for inactivity").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum frequency event count").option("--time-window-days <days>","Frequency lookback window").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>",eZ).option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile-id <id>","Existing reply profile ID; carries its own name, so omit --reply-to and --reply-to-name").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--pause-new-enrollments","Stop new sequence enrollments while current recipients continue").option("--resume-new-enrollments","Resume new sequence enrollments while current recipients continue").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--clear-sending-window","Disable the sequence sending window").option("--respect-frequency-cap","Skip email steps for contacts already at the company frequency cap").option("--ignore-frequency-cap","Stop applying the company frequency cap to this sequence").option("--active-subscribers-only","Only enroll active contacts; unsubscribed and bounced contacts do not enter").option("--send-to-not-subscribed <mode>","Send marketing emails to not subscribed contacts too: on, off, or default (on for ecommerce.checkout_started triggers, off otherwise)").option("--include-suppressed-subscribers","Let unsubscribed and bounced contacts enter again (marketing emails stay skipped)").option("--key-date <entries...>",'Key date as "Label=2026-11-27T00:00:00" (repeatable; zone-less times are read in --key-dates-timezone); optionally "key:Label=..." to pin the key. Requires --key-dates-timezone').option("--key-dates-timezone <timezone>","IANA timezone the key dates are written in, e.g. America/New_York").option("--key-dates-json <json>",'Inline key dates: {"timezone":"America/New_York","dates":[{"label":"Black Friday starts","at":"2026-11-27T00:00:00-05:00"}]}').option("--key-dates-file <file>","JSON file with the key dates object").option("--send-spread-hours <hours>","Spread each countdown email over this many hours so contacts get it at different times (default 4; 0 sends everyone at the exact time)").option("--clear-key-dates","Remove every key date from the sequence").option("--auto-enroll-all","Keep enrolling every new contact until the last key date (manual countdowns)").option("--auto-enroll-list-ids <ids...>","Keep enrolling people who join these lists until the last key date").option("--auto-enroll-segment-id <id>","Keep enrolling people who enter this segment until the last key date").option("--auto-enroll-json <json>","Keep enrolling later joiners of this audience object until the last key date").option("--auto-enroll-starts-at <datetime>","With --auto-enroll-*, do not sync before this ISO 8601 date-time (match a scheduled enroll-audience start)").option("--clear-auto-enroll","Stop auto-enrolling later joiners").option("--bcc-emails <emails>","Comma-separated BCC addresses copied on every email this sequence sends, e.g. a support inbox (max 10)").option("--clear-bcc-emails","Remove the sequence BCC addresses").option("--confirm-structural-change","Confirm an insertSteps or branch structural edit to an active sequence").option("--confirm-live-change","Confirm node config edits to an active sequence").option("--steps-json <json>","Inline JSON array of step updates").option("--steps-file <file>","Path to a JSON file with step updates").option("--emails-json <json>","Inline JSON array of email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal, and emailTheme patches that one step's theme (null clears the override)").option("--emails-file <file>","Path to a JSON file with email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal, and emailTheme patches that one step's theme (null clears the override)").option("--sms-steps-json <json>","Inline JSON array of SMS step content updates (targeted by nodeId)").option("--sms-steps-file <file>","Path to a JSON file with SMS step content updates").option("--subscriber-update-steps-json <json>","Inline JSON array of Update Subscriber configs targeted by nodeId").option("--subscriber-update-steps-file <file>","Path to a JSON file with Update Subscriber configs targeted by nodeId").option("--branch-json <json>","Inline JSON object for inserting an if/else branch, or a random A/B split, with path steps and/or existing target node IDs").option("--branch-file <file>","Path to a JSON file for inserting an if/else branch with path steps and/or existing target node IDs").option("--insert-steps-json <json>","Inline JSON object for inserting new linear steps").option("--insert-steps-file <file>","Path to a JSON file for inserting new linear steps").option("--node-updates-json <json>","Inline typed nodeUpdates array from sequences get; action_email changes accept emailTheme to restyle one step without touching the company theme").option("--node-updates-file <file>","JSON file containing typed nodeUpdates").option("--graph-edit-json <json>","Inline graphEdit object using the current graphRevision").option("--graph-edit-file <file>","JSON file containing a graphEdit operation").option("--stop-condition-json <json>","Inline JSON object for updating the sequence stop condition").option("--stop-condition-file <file>","Path to a JSON file for updating the sequence stop condition").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("update",{id:e,...t}));S(k1e,{notes:["Use either the steps form or the emails form, not both.","Each update entry can target a step by nodeId, emailId, or by array order.","Use --insert-steps-json/--insert-steps-file to add new linear steps, including outbound webhooks and AI steps; use --steps-* or --emails-* to edit existing email steps.",'AI steps generate a short per-contact fragment at send time (a sentence or two that a later email inserts, not a whole email): {"nodeType":"action_ai","config":{"prompt":"Write a winback subject for {{first_name}}","resultKey":"winback","outputFields":[{"key":"subject_line","fallback":"We miss you"}]}}. Later steps use {{ai.winback.subject_line}}. Opt into context with includeTags, includeEventProperties, includeRecentEvents (plus recentEventLimit, 1-50), and includeAttributes.','Inserted steps can be SMS steps: {"type":"sms","text":"...","delay":{"days":1}}. Generate copy with `sequenzy generate sms`.','Edit existing SMS steps with --sms-steps-json/--sms-steps-file: [{"nodeId":"node_sms","text":"New message"}]. Entries may also update label and ineligibleAction.','Edit existing Update Subscriber steps with --subscriber-update-steps-json/--subscriber-update-steps-file: [{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}}].',"For migrated provider flow steps, use html/htmlContent to preserve exact HTML as raw HTML and use delay or delayMs for waits.",'A step may use waitUntilWeekday to hold until the next weekday window, e.g. {"type":"delay","waitUntilWeekday":{"day":"sunday","startTime":"09:00","endTime":"12:00","timezone":"America/Los_Angeles"}}. Contacts already inside the window continue immediately. Add "timezoneSource":"subscriber" to use the timezone of each contact, with timezone as the fallback for contacts without one. Add "minimumWait":{"days":6} to wait at least that long before the window. Place it before the first email to guarantee the send day at the graph level (a sequence sendingWindow only shifts send times).',"When inserting steps or branches into an active sequence, pass --confirm-structural-change after confirming the live-flow impact.",'Use --stop-condition-json/--stop-condition-file with values like {"type":"has_tag","value":"customer"}; use {"type":"none","value":null} to clear it.','event_received stop conditions only match events received after enrollment. Add matchConfig to narrow them: {"type":"event_received","value":"product.quota_used","matchConfig":{"mode":"event_property_filter","propertyFilters":[{"path":"quota_used","operator":"greater_than","value":1}]}} stops only when a later event matches every filter (operators: exists, not_exists, equals, not_equals, one_of, contains, greater_than, less_than). {"mode":"event_property","rules":[{"entryFieldPath":"orderId","eventFieldPath":"orderId"}]} stops only when the stop event matches the enrolling event on that field. For field_changed, {"mode":"field_value","operator":"equals","value":"pro"} stops only when the field changes to a matching value.','Stop conditions are re-evaluated before every step, including the first, so {"type":"does_not_have_tag","value":"allowlist"} and {"type":"removed_from_list","value":"list_123"} act as an allowlist: contacts without that tag or list are cancelled before any step sends. Use this to point a live trigger at a chosen set of contacts without editing the graph. Guarded-out contacts still enroll and are then cancelled at the trigger node, so they appear as cancellations there rather than in the active or waiting enrollment counts.',"Clearing the guard does not retry the contacts it already cancelled: nothing re-enrolls them, so they only receive the sequence if the trigger fires for them again, which one-shot triggers never do. On the one_time enrollment mode a repeated trigger is ignored too, because enrollment is blocked by the existence of any earlier run rather than by its outcome. Guard a duplicate sequence and leave the real one ungated, or enroll the missed contacts afterwards with `sequenzy sequences enroll`, which skips the one_time check.","Branch condition types include has_tag, does_not_have_tag, in_list, in_segment, event_received, link_clicked, and field_* comparisons. Use activityScope (this_sequence, previous_email, ever) for event and click checks.","Branch paths may set targetNodeId and elseTargetNodeId to wire directly to existing nodes from sequences get, including the completion node. If path steps are also provided, they run before that target.",'Set "splitMode":"random" with "randomPercentages" to route by percentage instead of by condition, which runs a concurrent A/B test inside the flow (for example two abandoned-cart offers at once instead of one after the other). Each branch then omits conditionType and condition-specific fields, the percentages must sum to 100, and no else path is allowed. To A/B test the content of a single existing email step and have a winner picked automatically, use `sequenzy ab-tests create --automation-node-id` instead.',"Use --clear-sending-window to remove a configured send window.","Use --respect-frequency-cap to skip an email step for contacts already at the company frequency cap (they continue to the next step; set the cap with `sequenzy frequency-cap set`); --ignore-frequency-cap turns it off. Transactional steps are never skipped.","Use --active-subscribers-only to keep unsubscribed and bounced contacts out of the sequence entirely; --include-suppressed-subscribers restores the default, where they still enter on tag, event, list or contact triggers so non-marketing steps run, and only their marketing emails are skipped.","Use --send-to-not-subscribed on to also send marketing emails to contacts with status not_subscribed (known to you, never opted in, never unsubscribed, such as shoppers who started a checkout); off limits them to subscribers; default follows the trigger (on for ecommerce.checkout_started, off otherwise). Unsubscribed and bounced contacts never get marketing emails.","Use --key-date/--key-dates-json to set the key dates a countdown sequence waits for; changing them re-times contacts already waiting. --clear-key-dates removes them (rejected while a step still waits for one). --send-spread-hours sets how many hours each countdown email is spread over (default 4; 0 sends at the exact time).","Use --bcc-emails with a comma-separated list to blind-copy team inboxes on every sequence email; use --clear-bcc-emails to remove them."],examples:['sequenzy sequences update seq_123 --name "User Onboarding"',"sequenzy sequences update seq_123 --pause-new-enrollments","sequenzy sequences update seq_123 --resume-new-enrollments","sequenzy sequences update seq_123 --enrollment-mode matching_field","sequenzy sequences update seq_123 --enrollment-field-path order.id","sequenzy sequences update seq_123 --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays","sequenzy sequences update seq_123 --clear-sending-window","sequenzy sequences update seq_123 --active-subscribers-only","sequenzy sequences update seq_123 --send-to-not-subscribed on","sequenzy sequences update seq_123 --respect-frequency-cap",'sequenzy sequences update seq_123 --key-dates-timezone America/New_York --key-date "Black Friday starts=2026-11-27T00:00:00" --key-date "Black Friday ends=2026-11-29T23:59:00"',"sequenzy sequences update seq_123 --send-spread-hours 6",'sequenzy sequences update seq_123 --bcc-emails "cs-team@yourcompany.com, founder@yourcompany.com"',"sequenzy sequences update seq_123 --clear-bcc-emails","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json",`sequenzy sequences update seq_123 --stop-condition-json '{"type":"has_tag","value":"customer"}'`,`sequenzy sequences update seq_123 --stop-condition-json '{"type":"does_not_have_tag","value":"allowlist"}'`,`sequenzy sequences update seq_123 --stop-condition-json '{"type":"event_received","value":"product.quota_used","matchConfig":{"mode":"event_property_filter","propertyFilters":[{"path":"quota_used","operator":"greater_than","value":1}]}}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"delay":{"days":1},"subject":"Migration check-in","html":"<p>Need help migrating?</p>"}]}' --confirm-structural-change`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"nodeType":"logic_wait_for_event","config":{"label":"Wait for reply","eventName":"email.replied","timeoutDays":5,"timeoutAction":"continue"}}]}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_trigger","steps":[{"nodeType":"action_ai","config":{"prompt":"Write a short winback subject line for {{first_name}} who cancelled because {{event.reason}}.","resultKey":"winback","outputFields":[{"key":"subject_line","maxLength":60,"fallback":"We miss you"}],"includeEventProperties":true}}]}' --confirm-structural-change`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email","branches":[{"conditionType":"link_clicked","linkUrl":"project-invites","activityScope":"previous_email","steps":[{"subject":"Invite accepted","html":"<p>Thanks for accepting.</p>"}]}],"elseSteps":[{"subject":"Reminder","html":"<p>Please accept your invite.</p>"}]}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email_1","branches":[{"id":"replied","conditionType":"event_received","eventName":"email.replied","activityScope":"this_sequence","targetNodeId":"node_complete"}],"elseTargetNodeId":"node_email_2"}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_cart_wait","splitMode":"random","randomPercentages":[50,50],"branches":[{"id":"discount","label":"10% off","steps":[{"subject":"Here is 10% off","html":"<p>Complete your order.</p>"}]},{"id":"bonus","label":"Free shipping + gift","steps":[{"subject":"Free shipping on us","html":"<p>Complete your order.</p>"}]}]}' --confirm-structural-change`,"sequenzy sequences update seq_123 --branch-file ./branch.json",`sequenzy sequences update seq_123 --sms-steps-json '[{"nodeId":"node_sms","text":"Hey {{FIRST_NAME}}, your order shipped!"}]'`,`sequenzy sequences update seq_123 --subscriber-update-steps-json '[{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"mrr","value":"{{event.amount}}","valueType":"number"}]}}]'`]});var R1e=xt.command("enable <id>").description("Enable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("enable",{id:e,...t}));S(R1e,{examples:["sequenzy sequences enable seq_123"]});var T1e=xt.command("disable <id>").description("Disable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("disable",{id:e,...t}));S(T1e,{examples:["sequenzy sequences disable seq_123"]});var O1e=xt.command("duplicate <id>").description("Create an independent draft copy of a sequence").option("-n, --name <name>","Name for the copied sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("duplicate",{id:e,...t}));S(O1e,{notes:["Email templates, graph topology, and sequence A/B tests are copied independently."],examples:["sequenzy sequences duplicate seq_123",'sequenzy sequences duplicate seq_123 --name "Welcome Series v2"']});var N1e=xt.command("archive <id>").description("Archive a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("archive",{id:e,...t}));S(N1e,{examples:["sequenzy sequences archive seq_123"]});var $1e=xt.command("unarchive <id>").description("Restore an archived sequence as a draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("unarchive",{id:e,...t}));S($1e,{examples:["sequenzy sequences unarchive seq_123"]});var P1e=xt.command("enrollments <id>").description("List the contacts currently enrolled in a sequence").option("--status <statuses...>","Enrollment statuses to include (active, waiting, paused, completed, failed, cancelled); defaults to active, waiting, and paused").option("--node-id <nodeIds...>","Only show enrollments sitting on these sequence node IDs").option("--subscriber-id <ids...>","Only show enrollments for these subscriber IDs").option("--email <email>","Only show enrollments for this email address").option("--sort <sort>","enrolled_at_desc (default), enrolled_at_asc, wait_until_asc, or wait_until_desc").option("--stop-condition-match","Also report whether each in-flight enrollment's stop condition already matches (caps the page at 100)").option("--limit <n>","Enrollments per page, 1-500 (default 50)").option("--offset <n>","Number of enrollments to skip").option("--all","Fetch every page").option("--csv [file]","Print CSV, or write it to a file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>R9(e,t));S(P1e,{notes:["Defaults to active, waiting, and paused enrollments, which is every contact still in the sequence.","Get node IDs from sequenzy sequences get <id>, or from enrollmentCounts.byCurrentNode in sequenzy stats --sequence <id>.","waitUntil is when a waiting enrollment resumes; it is empty for enrollments that are not scheduled.","A stop condition does not cancel a waiting enrollment when its event arrives. It is re-checked when the enrollment next runs a step, so a matching contact keeps reporting waiting until its delay expires. Use --stop-condition-match to inspect the current match. The result is a non-atomic snapshot; a step already past its stop check may still finish."],examples:["sequenzy sequences enrollments seq_123","sequenzy sequences enrollments seq_123 --node-id node_wave_1","sequenzy sequences enrollments seq_123 --status waiting --sort wait_until_asc","sequenzy sequences enrollments seq_123 --subscriber-id sub_123 --stop-condition-match","sequenzy sequences enrollments seq_123 --all --csv enrollments.csv"]});var Q1e=xt.command("enrollment <sequenceId> <enrollmentId>").description("Show how one enrollment entered and which branches it already took").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>T9(e,t,n));S(Q1e,{notes:["Use list_sequence_enrollments / sequenzy sequences enrollments to get enrollmentId.","nodeHistory is the recorded graph walk. Compared field values are redacted summaries, never the raw recipient value."],examples:["sequenzy sequences enrollment seq_123 tok_abc","sequenzy sequences enrollment seq_123 tok_abc --json"]});var q1e=xt.command("move-enrollments <id>").description("Release a bounded batch of enrolled contacts from one sequence step onto another").requiredOption("--from-node <nodeId>","Node ID the contacts are currently waiting on").option("--to-node <nodeId>","Node ID to move them onto; defaults to the source step's only next step").option("--limit <n>","Maximum enrollments to move, 1-500 (default 100)").option("--sort <sort>","wait_until_asc (default), wait_until_desc, enrolled_at_asc, or enrolled_at_desc").option("--subscriber-ids <ids...>","Only move these subscriber IDs, up to 500").option("--daily-limit <n>","Refuse to move more than this many onto the target step in a rolling 24 hours").option("--tag <tags...>","Existing tag names to apply to the moved contacts").option("--reason <reason>","Note stored on every moved enrollment").option("--apply","Actually move the batch; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>P9(e,t));S(q1e,{notes:["Use this instead of cancelling and re-enrolling: the enrollment keeps its entry event properties, stop-condition snapshots, and start date.","Moved contacts become active on the target step immediately, so the sequence emails them as soon as the worker picks them up.","Without --apply, this command only reports which enrollments would move.","The batch is deliberately not auto-drained: re-run the command to release the next batch while remainingCount is above zero.","This works even while the sequence has new enrollment paused, because the contacts are already enrolled.","Get node IDs from sequenzy sequences enrollments <id> (currentNodeId) or sequenzy sequences get <id>."],examples:["sequenzy sequences move-enrollments seq_123 --from-node node_delay_2","sequenzy sequences move-enrollments seq_123 --from-node node_delay_2 --limit 180 --apply","sequenzy sequences move-enrollments seq_123 --from-node node_delay_2 --to-node node_email_3 --limit 180 --daily-limit 500 --tag wave-3-released --reason 'Wave 3' --apply"]});var F1e=xt.command("pause-subscribers <id>").description("Hold specific subscribers on their current sequence step until you resume them").option("--subscriber-ids <ids...>","Subscriber IDs to pause").option("-e, --email <emails...>","Subscriber email addresses to pause").option("--reason <reason>","Note stored on each paused enrollment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>L9(e,t));S(F1e,{notes:["Provide --subscriber-ids, --email, or both (up to 500 combined). Applies immediately; there is no dry run.","A paused contact gets no further steps from this sequence, keeps its place and entry data, and cannot be enrolled in it again while paused. Unsubscribes, bounces, and cancel-enrollments still end the enrollment.","A wait-for-event step does not react while paused; if its event arrived meanwhile, the step continues as soon as the contact is resumed.","An enrollment whose current step is running at that moment is reported as in_progress; run the command again shortly.","This is per contact. pause-enrollments only stops new contacts from entering the whole sequence."],examples:["sequenzy sequences pause-subscribers seq_123 --email ada@example.com --reason 'Project blocked'","sequenzy sequences pause-subscribers seq_123 --subscriber-ids sub_123 sub_456"]});var L1e=xt.command("resume-subscribers <id>").description("Continue paused subscribers from the sequence step they were paused on").option("--subscriber-ids <ids...>","Subscriber IDs to resume").option("-e, --email <emails...>","Subscriber email addresses to resume").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>U9(e,t));S(L1e,{notes:["Nothing restarts or is skipped. Waits keep their original wall-clock time: a wait that ran out while paused continues right away, one that has not still ends when it would have.","If the sequence itself is disabled, resumed contacts continue once it is enabled again."],examples:["sequenzy sequences resume-subscribers seq_123 --email ada@example.com","sequenzy sequences resume-subscribers seq_123 --subscriber-ids sub_123 sub_456 --json"]});var U1e=xt.command("pause-enrollments <id>").description("Stop new enrollments while current sequence recipients continue").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("pause-enrollments",{id:e,...t}));S(U1e,{notes:["The sequence must already be active. Existing active and waiting recipients keep moving through the sequence.","Use sequences disable when you want to freeze current recipients too."],examples:["sequenzy sequences pause-enrollments seq_123"]});var M1e=xt.command("resume-enrollments <id>").description("Resume new enrollments for an active sequence without changing current recipients").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("resume-enrollments",{id:e,...t}));S(M1e,{notes:["The sequence must already be active. Use sequences enable to resume a fully disabled sequence."],examples:["sequenzy sequences resume-enrollments seq_123"]});var j1e=xt.command("enroll <id>").description("Manually enroll subscribers in a sequence").option("-e, --email <emails...>","Email addresses to enroll").option("--subscriber-ids <ids...>","Subscriber IDs to enroll").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--target-node-id <nodeId>","Sequence node to enroll at; defaults to the first step after the trigger").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("enroll",{id:e,...t}));S(j1e,{notes:["Provide at least one target using --subscriber-ids or exactly one email source: --email, --emails-json, or --emails-file.","Subscribers must be active; unknown emails are reported as not found and inactive, unavailable, or already enrolled subscribers are skipped.","Enrollment requires the sequence to be accepting entrants (enabled and not paused for enrollment)."],examples:["sequenzy sequences enroll seq_123 --email one@example.com two@example.com","sequenzy sequences enroll seq_123 --subscriber-ids sub_123 sub_456 --target-node-id node_email_2","sequenzy sequences enroll seq_123 --emails-file ./vips.csv","sequenzy sequences enroll seq_123 --email one@example.com --target-node-id node_email_2"]});var z1e=xt.command("enroll-audience <id>").description("Enroll a whole audience (everyone, lists, or a segment) in a sequence as a background run").option("--all","Enroll every active contact with an email").option("--list-ids <ids...>","Enroll members of these lists").option("--segment-id <id>","Enroll members of this segment").option("--audience-json <json>",'Campaign-style audience object, e.g. {"type":"rules","include":[{"type":"lists","listIds":["list_1"]}],"exclude":[{"type":"segments","segmentIds":["seg_2"]}]}').option("--audience-file <file>","JSON file with the audience object").option("--target-node-id <nodeId>","Sequence node to start at; defaults to the first step after the trigger").option("--apply","Start enrolling; otherwise only report the estimate").option("--schedule-at <datetime>","With --apply, start at this ISO 8601 date-time instead of now").option("--keep-enrolling","With --apply, also enroll people who join this audience later, until the last key date").option("--data-json <json>",'With --apply, run-level data shared by everyone in this run and read in emails as {{enrollment.<field>}}, e.g. {"sale_ends_at":"2026-11-29T23:59:00Z","discount_percent":20} (JSON object, up to 8 KB)').option("--data-file <file>","With --apply, JSON file with the run-level data object").option("--wait","With --apply, poll until the run finishes").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>I9(e,t));S(z1e,{notes:["Without --apply the command only estimates: matching contacts, how many are already in the sequence, and how many would be enrolled.","The sequence must be enabled and accepting entrants. Contacts already active, waiting, or paused in it are skipped; one_time sequences also skip anyone who completed or was cancelled before. Unsubscribed and bounced contacts are never enrolled.","Late enrollees in a countdown sequence skip the steps whose key date already passed and continue from the next one.","Only one audience enrollment per sequence can be queued or running at a time; use sequenzy sequences audience-enrollments (or audience-enrollment <id> <runId>) to watch it and cancel-audience-enrollment to stop it.","--data-json/--data-file attach run-level values that are the same for everyone in the run (a sale end time, a discount percentage). Every enrolled contact keeps a copy, and the sequence's emails and conditions read them as {{enrollment.<field>}}. Auto-enroll syncs (--keep-enrolling) do not carry run data."],examples:["sequenzy sequences enroll-audience seq_123 --all","sequenzy sequences enroll-audience seq_123 --segment-id seg_past_buyers --apply --wait","sequenzy sequences enroll-audience seq_123 --list-ids list_1 list_2 --apply","sequenzy sequences enroll-audience seq_123 --audience-file ./audience.json --apply --json",`sequenzy sequences enroll-audience seq_123 --segment-id seg_past_buyers --apply --data-json '{"sale_ends_at":"2026-11-29T23:59:00Z","discount_percent":20,"order_cutoff_utc":"2026-11-29T22:00:00Z"}'`]});var G1e=xt.command("audience-enrollments <id>").description("List audience enrollment runs for a sequence").option("--limit <n>","Runs to return, 1-100 (default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>C9(e,t));S(G1e,{notes:["Each run reports its status (queued, running, completed, cancelled, failed) and how many contacts were enrolled or skipped."],examples:["sequenzy sequences audience-enrollments seq_123","sequenzy sequences audience-enrollments seq_123 --limit 5 --json"]});var H1e=xt.command("audience-enrollment <id> <runId>").description("Show one audience enrollment run with its progress").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>w9(e,t,n));S(H1e,{notes:["Poll this while the status is queued or running; enroll-audience --wait does the polling for you."],examples:["sequenzy sequences audience-enrollment seq_123 run_abc --json"]});var J1e=xt.command("cancel-audience-enrollment <id> <runId>").description("Stop a queued or running audience enrollment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>S9(e,t,n));S(J1e,{notes:["A queued run is cancelled immediately; a running run stops after the batch it is enrolling. Contacts already enrolled stay in the sequence (use cancel-enrollments to remove them)."],examples:["sequenzy sequences cancel-audience-enrollment seq_123 run_abc"]});var K1e=xt.command("schedule <id>").description("Show or set a recurring schedule that re-enrolls an audience into a manual-trigger sequence").option("--daily","Run every day").option("--weekly <days>","Run on these weekdays, comma-separated: mon,fri or 1,5 (0 = Sunday)").option("--monthly <days>","Run on these days of the month, comma-separated: 1,15,last").option("--at <time>",'24-hour run time, e.g. "10:00"').option("--timezone <zone>","IANA timezone the time is read in (default: this machine's timezone)").option("--all","Enroll every contact at each run").option("--list-ids <ids...>","Enroll members of these lists at each run").option("--segment-id <id>","Enroll members of this segment at each run").option("--audience-json <json>","Campaign-style audience object").option("--audience-file <file>","JSON file with the audience object").option("--disable","Save the schedule switched off").option("--until <datetime>",'ISO 8601 date-time after which no run starts (e.g. 2027-06-30T23:59:00Z); "none" removes the end date').option("--enrollment-mode <mode>","Who enters at each run: unlimited (everyone who matches) or one_time (only people who never entered); changes the sequence's enrollment mode").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>j9(e,t));S(K1e,{notes:["Without --daily, --weekly or --monthly the command shows the current schedule and its next runs.","Only manual-trigger sequences can repeat (--trigger manual), and not while --keep-enrolling is on. The sequence must be enabled for runs to happen; occurrences while it is paused, disabled or closed to new entrants are skipped.","Each run is an audience enrollment run (source recurring): contacts who finished an earlier run enter again, contacts still in the sequence are skipped, and one_time sequences never re-enroll anyone. Nothing is enrolled until the first scheduled time.","Days past the end of a shorter month run on its last day; use last for the end of every month. A run that cannot start within 6 hours of its time is skipped.","Saving replaces the existing schedule (an omitted --until means no end date); use sequenzy sequences unschedule to remove it.","--enrollment-mode sets the sequence's enrollment mode, which also applies to enrollments you start by hand; omit it to keep the current mode."],examples:["sequenzy sequences schedule seq_123","sequenzy sequences schedule seq_123 --monthly 1,last --at 10:00 --timezone Europe/London --all","sequenzy sequences schedule seq_123 --daily --at 09:30 --segment-id seg_low_balance","sequenzy sequences schedule seq_123 --weekly mon,thu --at 18:00 --list-ids list_members --json","sequenzy sequences schedule seq_123 --monthly last --at 09:00 --all --until 2027-06-30T23:59:00Z --enrollment-mode one_time"]});var V1e=xt.command("unschedule <id>").description("Remove a sequence's recurring schedule").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>z9(e,t));S(V1e,{notes:["Stops future runs. Runs already started and contacts already enrolled are not affected."],examples:["sequenzy sequences unschedule seq_123"]});var W1e=xt.command("cancel-enrollments <id>").description("Cancel active, waiting, or paused subscriber enrollments in a sequence").option("--all","Cancel every active, waiting, or paused enrollment in the sequence").option("--subscriber-id <id>","Cancel enrollments for one subscriber ID").option("--subscriber-ids <ids...>","Cancel enrollments for up to 500 subscriber IDs").option("--field-path <path>","Entry event property dot path to match, such as order.id").option("--field-values <values>","Comma-separated entry field values to match").option("--reason <reason>","Reason stored on cancelled enrollments").option("--apply","Actually cancel matches; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("cancel-enrollments",{id:e,...t}));S(W1e,{notes:["sequenceId is always required. Provide exactly one target: --all, --subscriber-id, --subscriber-ids, or --field-values.","Use --all to fully stop a live sequence when enrollments came from a segment and share no entry field value.","Without --apply, this command only reports matching enrollments.","With --apply, the command keeps calling the API until every match is drained and prints running progress.","When --field-path is omitted, the API uses the sequence enrollmentFieldPath if configured."],examples:["sequenzy sequences cancel-enrollments seq_123 --all","sequenzy sequences cancel-enrollments seq_123 --all --apply --reason 'Lifecycle cutover'","sequenzy sequences cancel-enrollments seq_123 --subscriber-id sub_123 --apply","sequenzy sequences cancel-enrollments seq_123 --subscriber-ids sub_1 sub_2 --apply","sequenzy sequences cancel-enrollments seq_123 --field-path order.id --field-values ord_123,ord_456"]});var Y1e=xt.command("realign-enrollments <id>").description("Move waiting enrollments to the start of the sequence sending window on the day they are already scheduled for").option("--node-ids <ids...>","Only realign enrollments sitting on these step IDs").option("--subscriber-ids <ids...>","Only realign enrollments for up to 500 subscriber IDs").option("--cursor <cursor>","Continue a capped scan from the cursor returned by the previous run").option("--job-id <job-id>","Check a previously queued realignment job instead of starting one").option("--apply","Actually move the wait times; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("realign-enrollments",{id:e,...t}));S(Y1e,{notes:["Run this after changing a live sequence's sending window: existing waits keep their original time, so a widened window never reaches them and a narrowed one defers them to the next allowed day.","A wait only ever moves earlier, never onto a different local day, and never before now. Nobody is cancelled or re-enrolled.","Without --apply, this command only reports the new wait times.","When more enrollments remain, run the complete continuation command printed in the result; applied runs retain --apply and any targeting filters.","Applied realignments run in the background. Use the printed --job-id command to read the result.","Use `sequenzy sequences enrollments <id> --status waiting --sort wait_until_asc` first to see who is affected."],examples:["sequenzy sequences realign-enrollments seq_123","sequenzy sequences realign-enrollments seq_123 --apply","sequenzy sequences realign-enrollments seq_123 --node-ids node_week_2 --apply","sequenzy sequences realign-enrollments seq_123 --subscriber-ids sub_1 sub_2 --apply","sequenzy sequences realign-enrollments seq_123 --job-id realign-sequence-enrollments-seq_123-..."]});var Z1e=xt.command("delete <id>").description("Delete a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("delete",{id:e,...t}));S(Z1e,{examples:["sequenzy sequences delete seq_123"]});var bo=Ve.command("ab-tests").description("Inspect and edit A/B test variants").action(()=>bo.help());S(bo,{notes:["Use get to discover variant IDs, then update-variant to edit a specific A/B variant.","Campaign test time and audience can change during testing. Variant content stays locked after sending starts.","create, add-variant, and delete-variant work on campaign and sequence A/B tests; delete works on campaign A/B tests only."],examples:["sequenzy ab-tests list --sequence seq_123","sequenzy ab-tests get ab_123","sequenzy ab-tests update ab_123 --winner-criteria open_rate","sequenzy ab-tests stats ab_123 --period 7d","sequenzy ab-tests create camp_123 --test-percentage 20 --winner-criteria open_rate",'sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"',"sequenzy ab-tests restart ab_123 --source-variant var_b","sequenzy ab-tests select-winner ab_123 var_b","sequenzy ab-tests resume ab_123",'sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --blocks-file ./variant-b.json"]});var X1e=bo.command("list").description("List A/B tests").option("--sequence <id>","Filter by sequence ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Po("list",e));S(X1e,{examples:["sequenzy ab-tests list --sequence seq_123"]});var eLe=bo.command("get <id>").description("Get A/B test details and variants").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("get",{id:e,...t}));S(eLe,{examples:["sequenzy ab-tests get ab_123"]});var tLe=bo.command("update <id>").description("Update campaign or sequence A/B test settings").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Campaign test audience share (5-50)").option("--duration-minutes <minutes>","Campaign test duration before winner selection (15-1440)").option("--winner-criteria <criteria>","Winner criteria: open_rate, click_rate, goal_conversion_rate, goal_value, or event_rate").option("--winner-goal <goalId>",'Goal for goal_conversion_rate or goal_value: a goal ID or "default-revenue" for purchase revenue').option("--winner-event <eventName>","Event for event_rate").option("--test-type <type>","Sequence variant strategy: subject or content").option("--winner-threshold <count>","Sequence recipients before winner selection (10-1000)").option("--auto-select-winner","Sequence tests: pick the leading variant once the sample size is reached").option("--no-auto-select-winner","Sequence tests: keep splitting contacts until you select a winner").option("--confirm-live-change","Confirm a settings change to an active or already-used sequence test").option("--cancel-sample-update","Discard a failed campaign sample change").option("--end-now","End a running campaign test now and pick the winner by its criteria").option("--expected-updated-at <timestamp>","Reject settings changes if the test has changed since this timestamp").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("update",{id:e,...t}));S(tLe,{notes:["During campaign testing, duration is measured from the original start (from when the last test email is due when delivery is spread); a past deadline starts winner selection immediately. Audience changes are queued and preserve committed sends. Retry the same percentage after a queue failure, or use --cancel-sample-update to discard a failed request. --end-now stops a running campaign test early: the winner is picked by its criteria from the results so far and sent to the rest of the audience.","Sequence tests use --test-type, --winner-threshold, --winner-criteria, and --auto-select-winner / --no-auto-select-winner.","Use --confirm-live-change when sequence settings affect an active test or a test with recorded activity.","goal_conversion_rate and goal_value judge variants by conversions of --winner-goal attributed to each variant (an open or click within the goal's window; for campaigns, revenue and campaign goals also credit a recipient who received the email in that window); default-revenue is built-in purchase revenue. event_rate judges by recipients who fire --winner-event after receiving the variant. When no variant converts, campaign tests fall back to click rate and sequence tests keep splitting. Campaign criteria are locked once testing starts."],examples:["sequenzy ab-tests update ab_123 --test-percentage 30 --duration-minutes 120 --winner-criteria open_rate","sequenzy ab-tests update ab_123 --test-type content --winner-criteria open_rate --winner-threshold 150 --confirm-live-change","sequenzy ab-tests update ab_123 --no-auto-select-winner --confirm-live-change","sequenzy ab-tests update ab_123 --winner-criteria goal_value --winner-goal default-revenue","sequenzy ab-tests update ab_123 --winner-criteria event_rate --winner-event trial.converted","sequenzy ab-tests update ab_123 --end-now"]});var nLe=bo.command("stats <id>").description("Get A/B test variant stats").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Custom range start as ISO 8601").option("--end <iso>","Custom range end as ISO 8601").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("stats",{id:e,...t}));S(nLe,{notes:["Use --period or both --start and --end. Custom ranges max at 90 days.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy ab-tests stats ab_123","sequenzy ab-tests stats ab_123 --period 30d","sequenzy ab-tests stats ab_123 --include-bots"]});var rLe=bo.command("select-winner <id> <variantId>").description("Select a campaign A/B winner, or select or change a sequence A/B winner").option("--confirm-live-change","Confirm changing the winner of a test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Po("select-winner",{id:e,variantId:t,...n}));S(rLe,{notes:["Campaign A/B tests must be in the testing phase; selection immediately queues winner delivery for the remaining audience.","Sequence A/B tests can change an existing winner, including one picked automatically. Contacts who already got a variant keep it; everyone who reaches the step afterwards gets the new winner.","Use --confirm-live-change when the sequence is active."],examples:["sequenzy ab-tests select-winner ab_123 var_b","sequenzy ab-tests select-winner ab_123 var_c --confirm-live-change"]});var iLe=bo.command("resume <id>").description("Clear a sequence A/B winner and keep testing until you select one").option("--confirm-live-change","Confirm resuming a test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("resume",{id:e,...t}));S(iLe,{notes:["Contacts reaching the step are split across the variants again. Results collected so far are kept.","Automatic selection stays off for this test; finish it with `sequenzy ab-tests select-winner <id> <variantId>`.","Use --confirm-live-change when the sequence is active."],examples:["sequenzy ab-tests resume ab_123","sequenzy ab-tests resume ab_123 --confirm-live-change"]});var oLe=bo.command("restart <id>").description("Run another sequence A/B test from an existing variant").option("--source-variant <id>","Variant to use as the new control. Defaults to the selected winner.").option("--test-type <type>","Test type for generated variants: subject or content").option("--winner-threshold <count>","Subscribers before selecting a winner (10-1000)").option("--variant-count <count>","Total variants including control (2-4)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("restart",{id:e,...t}));S(oLe,{notes:["Only sequence A/B tests with a selected winner can be restarted.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:["sequenzy ab-tests restart ab_123","sequenzy ab-tests restart ab_123 --source-variant var_b --test-type content --variant-count 3"]});var sLe=bo.command("update-variant <id> <variantId>").description("Update an A/B test variant").option("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--html <html>","Replacement HTML body").option("--html-file <file>","Read replacement HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm a sequence variant edit that may affect A/B test accuracy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Po("update-variant",{id:e,variantId:t,...n}));S(sLe,{notes:["Provide either HTML or blocks, not both.","Campaign variants remain editable only in draft.","Use --confirm-live-change when a sequence is active or its test already has activity; earlier sends stay unchanged and combined results may be inaccurate.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:['sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --html-file ./variant-b.html",'sequenzy ab-tests update-variant ab_123 var_b --subject "Revised future send" --confirm-live-change']});var aLe=bo.command("create [campaignId]").description("Create a campaign or sequence-node A/B test").option("--automation-node <nodeId>","Convert this sequence email node into an A/B test node").option("--confirm-live-change","Confirm conversion of an email node in an active sequence").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Campaign test audience share (5-50, default 20)").option("--duration-minutes <minutes>","Campaign test duration before winner selection (15-1440, default 240)").option("--winner-criteria <criteria>","Winner criteria: open_rate, click_rate, goal_conversion_rate, goal_value, or event_rate (campaign default open_rate; overrides sequence test-type default)").option("--winner-goal <goalId>",'Goal for goal_conversion_rate or goal_value: a goal ID or "default-revenue" for purchase revenue').option("--winner-event <eventName>","Event for event_rate").option("--test-type <type>","Sequence variant strategy: subject or content (default content)").option("--winner-threshold <count>","Sequence test sample size (10-1000, default 100)").option("--variants-json <json>","Inline JSON array of extra variants ({subject, previewText?, blocks?})").option("--variants-file <file>","Path to a JSON file with extra variants ({subject, previewText?, blocks?})").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("create",{campaignId:e,automationNodeId:t.automationNode,...t}));S(aLe,{notes:["Provide either a campaign ID or --automation-node, but not both.","Campaigns must be in draft or rejected status. Sequence node IDs must reference an email node.","Campaigns use --test-percentage and --duration-minutes; sequences use --winner-threshold.","Variant A is created automatically from the campaign email; provided variants are added after it."],examples:["sequenzy ab-tests create camp_123",`sequenzy ab-tests create --automation-node node_123 --test-type content --winner-threshold 100 --variants-json '[{"subject":"Variant B"}]'`,"sequenzy ab-tests create camp_123 --test-percentage 30 --duration-minutes 120 --winner-criteria click_rate",`sequenzy ab-tests create camp_123 --variants-json '[{"subject":"Alternative subject"}]'`]});var cLe=bo.command("add-variant <id>").description("Add a variant to a draft campaign or sequence A/B test").requiredOption("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm adding a variant to an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("add-variant",{id:e,...t}));S(cLe,{notes:["Variants can only be added while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:['sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"','sequenzy ab-tests add-variant ab_123 --subject "Alternative subject" --blocks-file ./variant.json']});var lLe=bo.command("delete-variant <id> <variantId>").description("Remove a variant from a draft campaign or sequence A/B test").option("-y, --yes","Skip the confirmation prompt").option("--confirm-live-change","Confirm deleting a variant from an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Po("delete-variant",{id:e,variantId:t,...n}));S(lLe,{notes:["Variant A is the control variant and cannot be deleted.","Variants can only be removed while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:["sequenzy ab-tests delete-variant ab_123 var_b --yes"]});var uLe=bo.command("delete <id>").description("Delete a campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("delete",{id:e,...t}));S(uLe,{notes:["Running A/B tests cannot be deleted; the linked campaign must be draft or rejected."],examples:["sequenzy ab-tests delete ab_123 --yes"]});var Rc=Ve.command("components").description("Manage reusable email components and the default email footer").action(()=>Rc.help());S(Rc,{notes:["Components are saved block groups you can reuse across emails.","The component pinned to the footer slot is the footer every new sequence, campaign, and AI-generated email gets. Edit it here to change the footer everywhere at once - editing one email's blocks only changes that email.","A default footer always keeps its unsubscribe link enabled. Transactional sends hide it at render time.","Existing emails change only with explicit --apply-to scopes and a reviewed --preview-token. Use footer preview first; --output-dir exports before/after HTML for visual inspection."],examples:["sequenzy components footer get --json > footer.json","sequenzy components footer set --blocks-file ./footer.json --yes","sequenzy components list --company comp_123","sequenzy components create 'Promo banner' --blocks-file ./banner.json"]});var pC=Rc.command("footer").description("Read or replace the company's default email footer").action(()=>pC.help()),dLe=pC.command("get").description("Print the current default email footer").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qa("footer-get",void 0,e));S(dLe,{notes:["Exits with a not-found error when no default footer is set, which means emails fall back to the footer generated from the company profile.","Pipe --json to a file, edit the blocks, then write it back with `components footer set`."],examples:["sequenzy components footer get","sequenzy components footer get --json > footer.json"]});var pLe=pC.command("preview").description("Preview a footer change and optionally export before/after HTML without saving").option("--blocks-json <json>","Proposed footer blocks as inline JSON").option("--blocks-file <path>","Proposed footer blocks as a JSON file").option("--name <name>","Proposed component name").option("--description <text>","Proposed component description").option("--apply-to <scopes>","Comma-separated sequences,campaigns,transactional,templates; omit for future emails only").option("--include-customized","Also replace customized footers").option("--render-preview","Include footer and before/after HTML in JSON output").option("--output-dir <path>","Write visual HTML previews to this directory").option("--sample-id <id>","Render a specific affected item instead of category samples").option("--sample-kind <kind>","Sample kind: email, ab_variant, localization").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including the preview token").action((e)=>qa("footer-preview",void 0,e));S(pLe,{notes:["The preview does not save or send. Dynamic content is not personalized. Open exported HTML in a browser to inspect it visually.","Use the same blocks, metadata and scope options when applying the returned token. Stale previews return a conflict; review a fresh preview before retrying."],examples:["sequenzy components footer preview --blocks-file footer.json --apply-to sequences,campaigns,transactional,templates --output-dir ./footer-preview --json"]});var mLe=pC.command("set").description("Create or replace the company's default email footer").option("--blocks-json <json>","Footer blocks as inline JSON").option("--blocks-file <path>","Footer blocks as a JSON file").option("--apply-to <scopes>","Comma-separated sequences,campaigns,transactional,templates").option("--include-customized","Also replace customized footers, matching the preview").option("--preview-token <token>","Reviewed footer preview token; required with --apply-to").option("--name <name>","Component name (default: Default Footer)").option("--description <text>","Component description").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").option("-y, --yes","Skip the confirmation prompt").action((e)=>qa("footer-set",void 0,e));S(mLe,{notes:["Replaces the whole footer. Read the current one with `components footer get --json` first if you only mean to change part of it.","The unsubscribe link is always re-enabled on save."],examples:["sequenzy components footer set --blocks-file ./footer.json --yes",'sequenzy components footer set --blocks-file ./footer.json --name "2026 Footer"']});var fLe=Rc.command("list").description("List email components, newest first").option("--type <type>","Filter by component type (section, footer)").option("--defaults-only","Only components pinned as a company default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qa("list",void 0,e));S(fLe,{examples:["sequenzy components list","sequenzy components list --defaults-only --json"]});var gLe=Rc.command("get <componentId>").description("Show one email component").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("get",e,t));S(gLe,{examples:["sequenzy components get cmp_123 --json"]});var ALe=Rc.command("create <name>").description("Create a reusable email component").option("--blocks-json <json>","Component blocks as inline JSON").option("--blocks-file <path>","Component blocks as a JSON file").option("--description <text>","Component description").option("--type <type>","Component type (section, footer). Default: section").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("create",e,t));S(ALe,{notes:["Component names are unique per company.","Creating one with --type footer does not pin it as the default footer. Use `components footer set` for that."],examples:["sequenzy components create 'Promo banner' --blocks-file ./banner.json"]});var hLe=Rc.command("update <componentId>").description("Update an email component's metadata or blocks").option("--name <name>","New component name").option("--description <text>","New description").option("--type <type>","New component type (section, footer)").option("--blocks-json <json>","Replacement blocks as inline JSON").option("--blocks-file <path>","Replacement blocks as a JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("update",e,t));S(hLe,{notes:["Replacing blocks bumps the component version. Emails built earlier keep the copy they were created with."],examples:["sequenzy components update cmp_123 --name 'Promo banner v2'","sequenzy components update cmp_123 --blocks-file ./banner-v2.json"]});var yLe=Rc.command("duplicate <componentId>").description("Copy an email component into a new component").option("-n, --name <name>",'Name for the copy (default: "<name> (Copy)", numbered if taken)').option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("duplicate",e,t));S(yLe,{notes:["The copy keeps the description, type and blocks. It is never pinned as a default, so duplicating the default footer gives you a regular component to edit."],examples:["sequenzy components duplicate cmp_123","sequenzy components duplicate cmp_123 --name 'Promo banner (winter)'"]});var bLe=Rc.command("delete <componentId>").description("Delete an email component").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").option("-y, --yes","Skip the confirmation prompt").action((e,t)=>qa("delete",e,t));S(bLe,{notes:["Emails that already rendered the component keep their copied blocks.","Deleting the pinned default footer makes new emails fall back to the generated footer."],examples:["sequenzy components delete cmp_123 --yes"]});var vo=Ve.command("templates").description("Manage email templates").action(()=>vo.help());S(vo,{notes:["Template content can be provided as raw HTML or as Sequenzy blocks JSON.","Templates can be assigned labels and listed by label for integration dashboards.","Use blocks when you need conditional content, per-block styles, or an exact editor-compatible structure.",JA],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123",'sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json','sequenzy templates update tmpl_123 --subject "Updated" --html-file ./welcome-v2.html','sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr"]});var vLe=vo.command("list").description("List templates, newest first").option("--label <labels...>","Filter by label name").option("--templates-only","Only reusable master designs (emails marked as templates)").option("-l, --limit <number>","Templates per page, 1-100 (default: 50)").option("--offset <number>","Templates to skip before returning results").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ha("list",e));S(vLe,{notes:["Returns 50 templates per call by default. When pagination.hasMore is true, re-run with --offset advanced by pagination.count to read the rest.","Templates are every saved email body - standalone templates plus the bodies behind campaigns and transactional emails - so the count grows with your campaign history."],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123","sequenzy templates list --templates-only --json","sequenzy templates list --limit 100 --json","sequenzy templates list --limit 100 --offset 100 --json"]});var ELe=vo.command("get <id>").description("Get template details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("get",{id:e,...t}));S(ELe,{examples:["sequenzy templates get tmpl_123 --company comp_123"]});var ILe=VR(vo.command("render <id>").description("Render a template to email-ready HTML")).action((e,t)=>Jv({type:"template",id:e},t));S(ILe,{notes:ZR,examples:["sequenzy templates render tmpl_123 --out preview.html","sequenzy templates render tmpl_123 --email you@example.com --var plan=Pro --json"]});var CLe=WR(vo.command("check <id>").description("Check a template: broken links and images, placeholders, content and client issues")).action((e,t)=>Kv({type:"template",id:e},t));S(CLe,{notes:YR,examples:["sequenzy templates check tmpl_123","sequenzy templates check tmpl_123 --var resetUrl=https://acme.io/reset --json"]});var wLe=vo.command("create <name>").description("Create a template").option("-s, --subject <subject>","Email subject (optional with --prompt)").option("--preview-text <text>","Email preview text override").option("--prompt <prompt>","Generate branded native blocks from a prompt").option("--style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("--tone <tone>","Prompt generation tone").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Label names to assign").option("--template","Save as a reusable master design that sequence steps and campaigns can start from").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("create",{name:e,...t}));S(wLe,{notes:["Provide exactly one of prompt, HTML, or blocks JSON content.","Use blocks when you need conditional content, per-block styles, or exact editor parity."],examples:['sequenzy templates create welcome --prompt "Welcome new customers"','sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json']});var SLe=vo.command("from-example <example>").description("Remix an email gallery example into a new template written for your brand").option("--brief <text>","Extra direction for the new email (takes priority over the example)").option("--name <name>","Template name (defaults to the generated subject)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>L3(e,t));S(SLe,{notes:["<example> is a gallery email URL (https://sequenzy.com/email-examples/brands/{brand}/emails/{email}, or a sequence page URL ending in #email-{email} for an email in a sequence) or brand/email.","Keeps the example's exact layout; every word is rewritten for your company and your logo, brand color and links are swapped in. Saved as an HTML template. The example brand is never named in the new email.","Saved as a reusable template. Nothing is saved if generation fails; running the command again creates another template."],examples:["sequenzy templates from-example https://sequenzy.com/email-examples/brands/linear/emails/welcome-to-linear",'sequenzy templates from-example linear/welcome-to-linear --brief "Mention our 14-day trial"']});var DLe=vo.command("preview-example <example>").description("Preview an email gallery example written for your brand, without saving").option("--website <site>","Write it for another website instead of your brand, e.g. acme.com").option("--brief <text>","Extra direction for the email (takes priority over the example)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including the HTML").action((e,t)=>G3(e,t));S(DLe,{notes:["<example> is a gallery email URL (https://sequenzy.com/email-examples/brands/{brand}/emails/{email}, or a sequence page URL ending in #email-{email}) or brand/email.","Same rewrite as sequenzy templates from-example, but nothing is saved. Run from-example to keep it as a template."],examples:["sequenzy templates preview-example linear/welcome-to-linear","sequenzy templates preview-example linear/welcome-to-linear --website acme.com --json"]});var _Le=vo.command("update <id>").description("Update a template").option("-n, --name <name>","Template name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Replace label names").option("--template","Mark as a reusable master design").option("--no-template","Remove the reusable master design mark").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("update",{id:e,...t}));S(_Le,{notes:["Provide at least one of --name, --subject, --preview-text, --label, --template/--no-template, --html, --html-file, --blocks-json, or --blocks-file.","Do not combine HTML flags with blocks flags in the same request.","To edit the double opt-in confirmation email, pass its ID from `sequenzy tracking settings` (Confirmation email). New content must keep {{DOUBLE_OPT_IN_URL}}, or the update is rejected."],examples:['sequenzy templates update tmpl_123 --subject "Updated"','sequenzy templates update tmpl_123 --preview-text "A warmer inbox preview"',"sequenzy templates update tmpl_123 --label edm template","sequenzy templates update tmpl_123 --html-file ./welcome-v2.html","sequenzy templates update tmpl_123 --blocks-file ./welcome-v2-blocks.json"]});var Um=vo.command("localizations").description("Manage localized template variants").action(()=>Um.help());S(Um,{notes:["Set stores caller-supplied localized content immediately.","Sync queues AI translation for selected locales, or every enabled non-primary locale when --locale is omitted.","Coverage and translate-missing work across every sequence email and enabled transactional email at once."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123","sequenzy templates localizations coverage","sequenzy templates localizations translate-missing --locale fr"]});var xLe=Um.command("coverage").description("Show how many sequence and transactional emails are translated into each language").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>LR("coverage",{company:e.company,json:e.json}));S(xLe,{notes:["Counts cover every email step and A/B variant in sequences that are not archived, plus enabled transactional emails.","Outdated translations were made before the original changed; they still send."],examples:["sequenzy templates localizations coverage","sequenzy templates localizations coverage --json"]});var BLe=Um.command("translate-missing").description("Queue AI translation for every sequence and transactional email missing a language").option("--locale <locales...>","Enabled locales to translate into; omit for every non-primary locale").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>LR("translate-missing",{locales:e.locale,company:e.company,json:e.json}));S(BLe,{notes:["Translates emails that have no translation in a language yet, or whose last translation failed.","Edited, up-to-date and outdated translations are left alone. Use sync on one template to retranslate it.","Adding a language in the dashboard runs this automatically for that language."],examples:["sequenzy templates localizations translate-missing","sequenzy templates localizations translate-missing --locale fr de"]});var kLe=Um.command("set <id> <locale>").description("Create or replace a localized template variant").requiredOption("-s, --subject <subject>","Localized email subject").option("--preview-text <text>","Localized email preview text").option("--html <html>","Localized email HTML content").option("--html-file <file>","Read localized HTML from file").option("--blocks-json <json>","Inline JSON array of localized Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with localized Sequenzy email blocks").option("--keep-edits","Protect this localization from automatic translation on save").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Ha("set-localization",{id:e,locale:t,...n}));S(kLe,{notes:["The locale must be enabled in the company's localization settings and cannot be the primary locale.","Provide exactly one HTML or blocks content source.","Without --keep-edits, saving the template retranslates it when automatic translation is on."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html','sequenzy templates localizations set tmpl_123 fr-CA --subject "Bienvenue" --blocks-file ./welcome-fr-ca.json']});var RLe=Um.command("sync <id>").description("Queue AI translation for template locales").option("--locale <locales...>","Enabled locales to sync; omit to sync every non-primary locale").option("--skip-edited","Keep localizations someone edited instead of retranslating them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("sync-localizations",{id:e,locales:t.locale,...t.skipEdited===!0&&{skipEdited:!0},company:t.company,json:t.json}));S(RLe,{examples:["sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123","sequenzy templates localizations sync tmpl_123 --skip-edited"]});var TLe=vo.command("delete <id>").description("Delete a template").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("delete",{id:e,...t}));S(TLe,{notes:["Deletion fails when the template is still referenced by a campaign or sequence."],examples:["sequenzy templates delete tmpl_123"]});var OLe=vo.command("share <id>").description("Create or fetch the email's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("share",{id:e,...t}));S(OLe,{notes:["Accepts an email ID or a transactional email's ID or slug, so transactional and sequence emails can be shared with the ID you already hold.","The hosted page is anonymized: sample contact, inert unsubscribe link, no open/click tracking.","Idempotent - rerunning returns the same URL until you run `templates unshare`.","Campaigns have their own link that follows the A/B winner - use `campaigns share`."],examples:["sequenzy templates share tmpl_123","sequenzy templates share order-confirmation"]});var NLe=vo.command("unshare <id>").description("Revoke the email's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("unshare",{id:e,...t}));S(NLe,{notes:["The shared URL returns 404 immediately after revocation."],examples:["sequenzy templates unshare tmpl_123"]});var Mm=Ve.command("companies").description("Inspect or create companies").action(()=>Mm.help());S(Mm,{notes:["Creating a company with a domain starts background website processing automatically; --without-website creates a ready company."],examples:["sequenzy companies list","sequenzy companies get comp_123","sequenzy companies update comp_123 --primary-color '#0ea5e9'","sequenzy companies create example.com --name Example"]});var $Le=Mm.command("list").description("List accessible companies").option("--json","Print raw JSON").action((e)=>$g("list",e));S($Le,{examples:["sequenzy companies list"]});var PLe=Mm.command("get <id>").description("Get company details").option("--json","Print raw JSON").action((e,t)=>$g("get",{id:e,...t}));S(PLe,{examples:["sequenzy companies get comp_123"]});var QLe=Mm.command("update <id>").description("Update company info, brand context, and reply tracking").option("-n, --name <name>","Company display name").option("--description <text>","Short product or company summary").option("--description-file <path>","Read description from a file").option("--logo-url <url>","Public logo URL").option("--dark-mode-logo-url <url>","Your own dark-mode version of the logo, used in every email instead of the automatic outlined copy").option("--automatic-dark-mode-logo","Remove your own dark-mode logo and go back to the automatic one").option("--founder-name <name>","Founder or sender name").option("--founder-photo-url <url>",'Square founder photo personal footers sign off with ("" removes it)').option("--founder-photo-file <path>","Upload a founder photo (JPG, PNG, WebP or GIF, up to 10MB); it is cropped to a square").option("--primary-color <hex>","Primary brand color, e.g. #f97316").option("--brand-colors-json <json>","Brand colors object as JSON").option("--brand-colors-file <path>","Read brand colors JSON from a file").option("--value-props-json <json>","Value propositions array as JSON").option("--value-props-file <path>","Read value propositions JSON from a file").option("--testimonials-json <json>","Testimonials array as JSON").option("--testimonials-file <path>","Read testimonials JSON from a file").option("--tone-voice <text>","Tone of voice guidance").option("--company-context <text>","Product knowledge for AI writing").option("--company-context-file <path>","Read product knowledge from a file").option("--email-design-prompt <text>","Art direction for AI-designed emails (layout, density, imagery)").option("--email-design-prompt-file <path>","Read the design prompt from a file").option("--email-length-preference <value>","Email length: concise, balanced, or detailed (new workspaces default to concise)").option("--email-style <style>","How AI writes emails by default: visual (designed), plain (simple text), or ask (clear the choice)").option("--category <type>","Company category: saas, content, ecommerce, offline, mobile_app or other (none clears it so website detection can set it). Drives recommended templates").option("--email-preset <preset>","Default header and footer: branded (logo and full footer) or minimal (compact footer, no logo)").option("--footer-style <style>","Footer style for new AI-designed emails: auto (fits your brand), classic, mono, band or editorial").option("--footer-mode <mode>","Footer type for new AI-designed emails: branded (the default) or personal (opens with the founder's sign-off: photo, name and title, in any style)").option("--footer-theme-json <json>","Auto-added footer colors and copy as JSON, merged into the stored theme (backgroundColor, companyTextColor, metaTextColor, linkColor, borderColor, reasonText, unsubscribeText, privacyPolicyText, showCompanyLine, style, mode; null resets a field, or pass null to reset all)").option("--footer-theme-file <path>","Read the auto-added footer theme JSON from a file").option("--social-links-json <json>","Social links object as JSON, keyed by platform (x, linkedin, ..., appstore, googleplay)").option("--social-links-file <path>","Read social links JSON from a file").option("--privacy-policy-url <url>","Privacy policy URL").option("--terms-url <url>","Terms of service URL").option("--address <address>","Physical mailing address").option("--language <code>","Primary language code").option("--pricing-json <json>","Pricing object as JSON").option("--pricing-file <path>","Read pricing JSON from a file").option("--font-family <family>","Default email font family").option("--email-theme-json <json>","Default email theme as JSON (partial: presetId, colors, typography, layout; pass null to reset)").option("--email-theme-file <path>","Read the default email theme JSON from a file").option("--email-direction <direction>","Default email direction: ltr or rtl").option("--sender-profile-id <id>","Existing sender profile to make the default (see `sequenzy sender-profiles list`)").option("--from-email <email>","Account-wide default From address (domain must be verified)").option("--from-name <name>","Display name of the default From profile (alone, it renames the current one)").option("--reply-profile-id <id>","Existing reply profile to make the default (see `sequenzy sender-profiles list`)").option("--reply-to <email>","Account-wide default Reply-To address").option("--reply-to-name <name>","Display name of the default Reply-To profile (alone, it renames the current one)").option("--enable-reply-tracking","Enable inbound reply tracking").option("--disable-reply-tracking","Disable inbound reply tracking").option("--reply-tracking-domain-mode <mode>","Reply domain mode: sequenzy or custom").option("--enable-reply-forwarding","Enable captured reply forwarding").option("--disable-reply-forwarding","Disable captured reply forwarding").option("--default-list <id>","List new contacts join by default when nothing targets them (repeatable)",(e,t=[])=>[...t,e]).option("--default-lists-none","New contacts join no list unless something targets them").option("--rename-matching-footers","Rename exact matching footer names in editable emails and saved components; requires --name and --previous-company-name").option("--previous-company-name <name>","Current company name to match when renaming footers").option("--default-lists-all","New contacts join every current and future list").option("--json","Print raw JSON").action((e,t)=>$g("update",{id:e,...t}));S(QLe,{notes:["The default-list flags set which lists a new contact joins when nothing targets it explicitly - forms, API writes, events, imports, and live ingestion from integrations without their own list targeting (Dodo Payments, PostHog, WooCommerce). Payment-provider backfills follow this setting; PostHog history imports instead create contacts without list memberships. `companies get <id>` reports the current value.","`--default-lists-all`, `--default-lists-none`, and `--default-list` are three different things: all lists, no list at all, and exactly the listed ones. They are mutually exclusive.","Changing this only affects later writes. Nobody is moved or removed from a list retroactively, so a list already polluted by a backfill still needs `sequenzy lists remove-subscribers`.","The default-list flags need an API key with the companies:manage scope. In the dashboard the same setting lives under Contacts -> Lists -> Default Lists.","Footer type (font, size, line height) lives in the email theme: `--email-theme-json` with typography.footerFontFamily, footerFontSize (10-16px) and footerLineHeight (1-2). It applies to footer blocks and the auto-added footer; null resets each field. `--footer-theme-json` sets the auto-added footer's colors and copy.","`--enable-reply-tracking` turns Inbox on. A workspace that has never received a conversation needs a verified receiving domain first (otherwise the API answers 409 receiving_domain_required): add one with `sequenzy receiving-domains add <domain>`, and Inbox turns on by itself once its DNS records are verified."],examples:["sequenzy companies update comp_123 --primary-color '#0ea5e9'","sequenzy companies update comp_123 --default-list list_abc --default-list list_def","sequenzy companies update comp_123 --category mobile_app","sequenzy companies update comp_123 --founder-photo-file ./founder.jpg --footer-mode personal","sequenzy companies update comp_123 --default-lists-none",`sequenzy companies update comp_123 --email-theme-json '{"colors":{"mutedText":"#4b5563"},"typography":{"baseFontSize":16}}'`,`sequenzy companies update comp_123 --email-theme-json '{"typography":{"footerFontFamily":"Georgia, serif","footerFontSize":13,"footerLineHeight":1.5}}'`,`sequenzy companies update comp_123 --footer-theme-json '{"linkColor":"#0ea5e9","reasonText":"You signed up at example.com."}'`,"sequenzy companies update comp_123 --company-context-file ./product.md --tone-voice 'clear, direct, warm'","sequenzy companies update comp_123 --from-name 'Example'","sequenzy companies update comp_123 --sender-profile-id sender_abc123 --from-name 'Example News'","sequenzy companies update comp_123 --enable-reply-tracking --reply-tracking-domain-mode sequenzy",`sequenzy companies update comp_123 --value-props-json '[{"title":"Fast setup","description":"Launch lifecycle emails in minutes."}]'`]});var qLe=Mm.command("create [domain]").description("Create a company with or without a website").option("-n, --name <name>","Company name").option("--without-website","Start without a website (requires --name)").option("-d, --description <text>","Business description, up to 500 characters. With a domain, website processing may replace it").option("--description-file <path>","Read the business description from a file").option("--with-welcome-sequence","Create and generate the four-email welcome sequence").option("--category <type>","Company category: saas, content, ecommerce, offline, mobile_app or other. Omit to detect it from the website").option("--json","Print raw JSON").action((e,t)=>$g("create",{domain:e,...t}));S(qLe,{examples:["sequenzy companies create example.com","sequenzy companies create https://example.com --name Example","sequenzy companies create calmly.app --category mobile_app",'sequenzy companies create --without-website --name Acme --description "Meal plans for night-shift nurses" --with-welcome-sequence']});var Pi=Ve.command("accounts").alias("organizations").description("Manage your customers' organizations (accounts) and their members").option("--search <text>","Match name, external ID or domain").option("--page <n>","Page number").option("--limit <n>","Results per page (max 100)").option("--sort <field>","Sort by updatedAt, createdAt, name, memberCount or lastEventAt").option("--order <dir>","asc or desc").option("--without-event-recipients","Only accounts with members but no owner or admin").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Qo("list",e));S(Pi,{notes:["Running `sequenzy accounts` without a subcommand lists accounts.","These are your customers' organizations. For your own Sequenzy login, API key and workspaces, use `sequenzy account`.","The first account turns Accounts on for the workspace. It fails with a 409 error if contacts already use a custom attribute named `account` or `account.*`; rename that attribute first.","Accounts are identified by your own external ID (the organization or workspace id in your app).","The dashboard calls accounts Organizations; `sequenzy organizations` is the same command.","Organization attributes reach every member as `organization.<name>` for segments and sequence conditions and as `{{organization.<name>}}` merge tags. `account.*` is an older alias."],examples:["sequenzy accounts list --search acme","sequenzy accounts get org_123","sequenzy accounts upsert org_123 --name Acme --domain acme.com --attr plan=pro --attr seats=5","sequenzy accounts add-member org_123 --email jane@acme.com --role owner","sequenzy accounts event org_123 trial_ending --property daysLeft=3 --recipients owners","sequenzy accounts suggestions","sequenzy accounts detect-org-ids"]});var FLe=Pi.command("list").description("List accounts").option("--search <text>","Match name, external ID or domain").option("--page <n>","Page number").option("--limit <n>","Results per page (max 100)").option("--sort <field>","updatedAt, createdAt, name, memberCount, lastEventAt").option("--order <dir>","asc or desc").option("--without-event-recipients","Only accounts with members but no owner or admin").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("list",t.optsWithGlobals()));S(FLe,{notes:["Account events go to owners (or admins) by default. `--without-event-recipients` finds accounts whose alerts reach nobody, such as bulk-created accounts where everyone is a member."],examples:["sequenzy accounts list --sort memberCount --order desc","sequenzy accounts list --without-event-recipients"]});var LLe=Pi.command("get <externalId>").description("Show a customer organization (account) and its members").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("get",{externalId:e,...t}));S(LLe,{examples:["sequenzy accounts get org_123"]});var ULe=Pi.command("upsert <externalId>").description("Create or update a customer organization (account) by external ID").option("--name <name>","Display name").option("--domain <domain>","Primary domain, e.g. acme.com").option("--attr <key=value>","Account attribute (repeatable). `key=` clears a key.",(e,t=[])=>[...t,e]).option("--replace-attributes","Replace all attributes instead of merging").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("upsert",{externalId:e,...t}));S(ULe,{notes:["Numbers and booleans in --attr are coerced; everything else stays a string."],examples:["sequenzy accounts upsert org_123 --name Acme --attr plan=pro --attr seats=5","sequenzy accounts upsert org_123 --attr legacyPlan="]});var MLe=Pi.command("delete <externalId>").description("Delete a customer organization (account); contacts are kept. Never your Sequenzy account").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("delete",{externalId:e,...t}));S(MLe,{notes:["Deletes one of your customers' organizations (Subscribers > Organizations in the dashboard) and its memberships. Member contacts are kept and their `organization.*` attributes are cleared.","It never deletes your Sequenzy account, workspace or login. Nothing in the CLI does."],examples:["sequenzy accounts delete org_123 --yes"]});var jLe=Pi.command("members <externalId>").description("List a customer organization's members with roles").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("members",{externalId:e,...t}));S(jLe,{examples:["sequenzy accounts members org_123"]});var zLe=Pi.command("add-member <externalId>").description("Add a contact to a customer organization").option("--email <email>","Contact email (created when new)").option("--subscriber-external-id <id>","Contact external ID").option("--role <role>","owner, admin or member").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("add-member",{externalId:e,...t}));S(zLe,{notes:["Re-adding a member without --role keeps the current role."],examples:["sequenzy accounts add-member org_123 --email jane@acme.com --role owner"]});var GLe=Pi.command("remove-member <externalId>").description("Remove a contact from a customer organization").option("--email <email>","Contact email").option("--subscriber-external-id <id>","Contact external ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("remove-member",{externalId:e,...t}));S(GLe,{examples:["sequenzy accounts remove-member org_123 --email bob@acme.com"]});var HLe=Pi.command("events <externalId>").description("List recent events on a customer organization").option("--limit <n>","Number of events (max 500)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("events",{externalId:e,...t}));S(HLe,{examples:["sequenzy accounts events org_123 --limit 20"]});var JLe=Pi.command("event <externalId> <event>").description("Trigger an event on a customer organization and deliver it to members").option("--property <key=value>","Event property (repeatable)",(e,t=[])=>[...t,e]).option("--recipients <rule>","owners (default), admins, all or none").option("--event-id <id>","Idempotency key for retries").option("--occurred-at <timestamp>","Original event time (ISO 8601)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Qo("event",{externalId:e,event:t,...n}));S(JLe,{notes:["Recipients receive the event as a contact event with `event.organization.*` (also `event.account.*`) properties, so sequences and sync rules run per person. Use enrollment field `organization.externalId` to run a sequence once per organization.","Owners fall back to admins when an account has no owner."],examples:["sequenzy accounts event org_123 trial_ending --property daysLeft=3","sequenzy accounts event org_123 seat_limit_reached --recipients admins"]});var KLe=Pi.command("suggestions").description("Suggest accounts from work email domains contacts share").option("--min-contacts <n>","Contacts a domain needs (default 3)").option("--limit <n>","Number of suggestions (default 25, max 100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Qo("suggestions",e));S(KLe,{notes:["Skips personal and disposable email providers, your own sending domains, domains where any contact already belongs to an account, and domains an account already uses. Shows up to three sample emails per domain.","Read-only: nothing is created until you run `accept-suggestions`."],examples:["sequenzy accounts suggestions","sequenzy accounts suggestions --min-contacts 5 --json"]});var VLe=Pi.command("accept-suggestions <domains...>").description("Create accounts from suggested email domains").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("accept-suggestions",{domains:e,...t}));S(VLe,{notes:["Each domain becomes an account (external ID and domain set to the domain) with the domain's contacts as members. Contacts already in another account stay there, and a domain already partly grouped is skipped.","When one account already uses the domain, contacts are added to it instead. Up to 25 domains per call; safe to retry. No sync rules or segment-entered sequences run."],examples:["sequenzy accounts accept-suggestions acme.com globex.com"]});var WLe=Pi.command("detect-org-ids").description("Find the organization ID your app already sends in events or contact attributes").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ng("detect",e));S(WLe,{notes:["Looks for event properties from the last 180 days and contact attributes named like workspaceId, organization_id, team_id or account_id, with how many organizations each holds and the matching name key when there is one.","Read-only. Preview a key with `preview-org-id` before creating accounts from it."],examples:["sequenzy accounts detect-org-ids","sequenzy accounts detect-org-ids --json"]});var YLe=Pi.command("preview-org-id <propertyKey>").description("Preview the accounts an organization ID would create").option("--source <source>","event (default) or attribute").option("--name-key <key>","Property or attribute with the organization name").option("--limit <n>","Organizations to show (default 5, max 50)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ng("preview",{propertyKey:e,...t}));S(YLe,{notes:["Shows the biggest organizations first: the name each account would get (from --name-key, otherwise the work email domain most of its contacts share), its contact count and sample emails.","Read-only: nothing is created until you run `create-from-org-id`."],examples:["sequenzy accounts preview-org-id workspaceId","sequenzy accounts preview-org-id account_id --source attribute --name-key company_name --limit 20"]});var ZLe=Pi.command("create-from-org-id <propertyKey>").description("Create one account per organization ID and add its contacts").option("--source <source>","event (default) or attribute").option("--name-key <key>","Property or attribute with the organization name").option("--wait","Wait until the accounts are created").option("-y, --yes","Skip the preview and confirmation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ng("create",{propertyKey:e,...t}));S(ZLe,{notes:["Shows a preview and asks before starting. Runs in the background; use --wait to wait, or check with `org-id-job`.","Accounts are named from --name-key, otherwise after the work email domain their contacts share. Existing names, domains and roles are kept, no emails are sent and no sequences start. Safe to rerun."],examples:["sequenzy accounts create-from-org-id workspaceId","sequenzy accounts create-from-org-id workspaceId --name-key workspaceName --yes --wait"]});var XLe=Pi.command("org-id-job <jobId>").description("Check a create-from-org-id run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ng("job",{jobId:e,...t}));S(XLe,{notes:["States: queued, running, completed (with accounts and memberships created) or failed (with the error)."],examples:["sequenzy accounts org-id-job backfill-accounts:comp_123:workspaceId"]});var YA=Ve.command("tags").description("Manage tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Pm("list",e));S(YA,{notes:["Running `sequenzy tags` without a subcommand lists tag definitions.","Tag names are normalized to lowercase with dashes; system tags cannot be changed or deleted."],examples:["sequenzy tags --company comp_123","sequenzy tags list","sequenzy tags create vip --color purple","sequenzy tags update tag_123 --color red","sequenzy tags delete tag_123 --yes"]});var eUe=YA.command("list").description("List tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Pm("list",e));S(eUe,{examples:["sequenzy tags list --company comp_123"]});var tUe=YA.command("create <name>").description("Create a tag definition").option("--color <color>","Tag color, e.g. gray, red, green, blue, purple").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Pm("create",{name:e,...t}));S(tUe,{notes:["Names are normalized to lowercase with dashes, so `VIP Customer` becomes `vip-customer`."],examples:["sequenzy tags create vip","sequenzy tags create vip --color purple"]});var nUe=YA.command("update <tagId>").description("Update a tag definition color").requiredOption("--color <color>","New tag color").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Pm("update",{tagId:e,...t}));S(nUe,{notes:["System tags cannot be updated."],examples:["sequenzy tags update tag_123 --color red"]});var rUe=YA.command("delete <tagId>").description("Delete a tag definition").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Pm("delete",{tagId:e,...t}));S(rUe,{notes:["Deleting a tag removes it from every subscriber.","Tags used by sequences cannot be deleted until those sequences stop referencing them."],examples:["sequenzy tags delete tag_123 --yes"]});var Tc=Ve.command("lists").description("Manage subscriber lists").action(()=>Tc.help());S(Tc,{examples:["sequenzy lists list --company comp_123",'sequenzy lists create Newsletter --description "Public newsletter list"','sequenzy lists update list_123 --name "Weekly Newsletter" --private',"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv","sequenzy lists remove-subscribers list_123 --email one@example.com","sequenzy lists import list_123 --emails-file ./batch-001.csv","sequenzy lists delete list_123 --yes"]});var iUe=Tc.command("list").description("List subscriber lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Rl("list",e));S(iUe,{examples:["sequenzy lists list --company comp_123"]});var oUe=Tc.command("create <name>").description("Create a subscriber list").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--allow-member-unsubscribe","Allow existing private-list members to opt out").option("--no-allow-member-unsubscribe","Hide private lists from member preferences").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("create",{name:e,...t}));S(oUe,{examples:['sequenzy lists create Newsletter --description "Public newsletter list"',"sequenzy lists create VIP --private --company comp_123"]});var sUe=Tc.command("add-subscribers <listId>").description("Add subscribers to a list from emails, JSON, or a file").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("add-subscribers",{listId:e,...t}));S(sUe,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used.","New subscribers are not enrolled in matching sequences unless --enroll-sequences is set."],examples:["sequenzy lists add-subscribers list_123 --email one@example.com two@example.com",`sequenzy lists add-subscribers list_123 --emails-json '["one@example.com","two@example.com"]'`,"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv"]});var aUe=Tc.command("import <listId>").description("Alias for add-subscribers; import subscribers into a list").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("add-subscribers",{listId:e,...t}));S(aUe,{notes:["`lists import` is an alias for `lists add-subscribers`.","Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used."],examples:["sequenzy lists import list_123 --emails-file ./batch-001.csv",`sequenzy lists import list_123 --emails-json '["one@example.com","two@example.com"]'`]});var cUe=Tc.command("update <listId>").description("Update a subscriber list").option("-n, --name <name>","List name").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--allow-member-unsubscribe","Allow existing private-list members to opt out").option("--no-allow-member-unsubscribe","Hide private lists from member preferences").option("--no-private","Mark the list as public").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("update",{listId:e,...t}));S(cUe,{notes:["Provide at least one of --name, --description, --private, --no-private, --allow-member-unsubscribe, or --no-allow-member-unsubscribe."],examples:['sequenzy lists update list_123 --name "Weekly Newsletter"',"sequenzy lists update list_123 --private","sequenzy lists update list_123 --no-private"]});var lUe=Tc.command("remove-subscribers <listId>").description("Remove subscribers from a list by email").option("-e, --email <emails...>","Email addresses to remove").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("remove-subscribers",{listId:e,...t}));S(lUe,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Subscribers are only removed from the list; they stay in your audience.","Emails that do not match a subscriber are reported as not found."],examples:["sequenzy lists remove-subscribers list_123 --email one@example.com two@example.com","sequenzy lists remove-subscribers list_123 --emails-file ./churned.csv"]});var uUe=Tc.command("delete <listId>").description("Delete a subscriber list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("delete",{listId:e,...t}));S(uUe,{notes:["Deleting a list removes all of its memberships; subscribers themselves are kept."],examples:["sequenzy lists delete list_123 --yes"]});var _d=Ve.command("segments").description("Manage segments").action(()=>_d.help());S(_d,{notes:["Use --filter-json for arbitrary segment filters. The CLI will fill in missing filter IDs.","Use --match any to create a segment that matches any filter instead of all filters.",'Engagement filters (emailSent, emailDelivered, emailOpened, emailClicked, emailBounced, emailComplained) accept a time range as the value ("24h", "7d", "30d", "90d", "180d", "all"; whole hours go from "1h" to "8760h", and count filters are exact up to "168h"), a specific campaign ("campaign:<campaign_id>"), or an email-type scope ("marketing:<timeRange>" for marketing-policy campaign, automation, and Send API traffic; "transactional:<timeRange>" for transactional-policy sends). Policy scopes use send-time policy snapshots; ambiguous older automation and Send API events without a snapshot are not assigned to either scope. Combine multiple engagement filters with --match all to build things like "bounced campaign A but not campaign B".','Push filters: pushDevice (is/is_not with "any", "web", "ios" or "android") matches active push devices; pushSent, pushDelivered and pushClicked take is/is_not with a time range ("30d", "all") and ignore test sends.','Phone filters: phone takes is_not_empty/is_empty, or starts_with/not_starts_with/contains/not_contains with digits matched against the stored international number ("+44", "+1 415"); phoneCountry takes is/is_not with ISO country codes ("GB", or "US,CA" for several).'],examples:["sequenzy segments list --company comp_123",'sequenzy segments create --name "Bought Pro" --stripe-product prod_pro',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`,`sequenzy segments create --name "No marketing email this week" --filter-json '[{"field":"emailSent","operator":"is_not","value":"marketing:7d"}]'`,`sequenzy segments create --name "iOS, no push clicks" --filter-json '[{"field":"pushDevice","operator":"is","value":"ios"},{"field":"pushClicked","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "UK SMS subscribers" --filter-json '[{"field":"phoneCountry","operator":"is","value":"GB"},{"field":"smsStatus","operator":"is","value":"subscribed"}]'`,`sequenzy segments create --name "San Francisco numbers" --filter-json '[{"field":"phone","operator":"starts_with","value":"+1415"}]'`]});var dUe=_d.command("list").description("List all segments").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zp("list",e));S(dUe,{examples:["sequenzy segments list --company comp_123"]});var pUe=_d.command("create").description("Create a segment").requiredOption("-n, --name <name>","Segment name").option("-c, --company <id>","Company ID override for personal API keys").option("--match <mode>","How filters combine: all or any","all").option("--stripe-product <id>","Stripe product ID to segment on").option("--commerce-product <id>","Commerce product to segment on, as provider:productId (e.g. shopify:42); a bare ID matches any provider").option("--commerce-collection <key>","Commerce collection to segment on, as a collection ID or handle (e.g. skincare); optionally prefixed with a provider").option("--purchase-operator <operator>","Purchase operator (bought, didnt-buy, at-least, less-than)","bought").option("--payments <number>","Payment threshold for at-least/less-than").option("--orders <number>","Order threshold for at-least/less-than with --commerce-product or --commerce-collection").option("--engagement <field>","Email engagement field: emailSent, emailDelivered, emailOpened, emailClicked, emailBounced, or emailComplained").option("--engagement-operator <operator>","Engagement operator: is, is_not, is_temporary_bounce, is_permanent_bounce, at_least, or less_than_count","is").option("--engagement-scope <scope>","Engagement scope: any, marketing, transactional, or campaign","any").option("--engagement-range <range>","Engagement time range: hours such as 6h or 24h, days such as 7d or 30d, or all","all").option("--engagement-campaign <id>","Campaign ID when --engagement-scope is campaign").option("--engagement-count <number>","Event count for at_least/less_than_count engagement operators").option("--filter-json <json>","Raw JSON array of segment filters (IDs are optional)").option("--json","Print raw JSON").action((e)=>Zp("create",e));S(pUe,{notes:["For array-of-object attributes, positive filters sharing a wildcard array prefix (such as history_events[].venue and history_events[].date) and connected only by AND must match one shared array element. Negative is_not, not_contains, and is_empty filters remain independent."],examples:['sequenzy segments create --name "Bought Pro" --stripe-product prod_pro','sequenzy segments create --name "3+ Pro Payments" --stripe-product prod_pro --purchase-operator at-least --payments 3','sequenzy segments create --name "Starter Kit Buyers" --commerce-product api:prod-starter-kit','sequenzy segments create --name "Repeat Kit Buyers" --commerce-product api:prod-starter-kit --purchase-operator at-least --orders 2','sequenzy segments create --name "Skincare Buyers" --commerce-collection skincare','sequenzy segments create --name "Repeat Skincare Buyers" --commerce-collection skincare --purchase-operator at-least --orders 2','sequenzy segments create --name "Marketing openers" --engagement emailOpened --engagement-scope marketing --engagement-range all','sequenzy segments create --name "Did not open campaign" --engagement emailOpened --engagement-operator is_not --engagement-scope campaign --engagement-campaign cmp_abc',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var mUe=_d.command("count <id>").description("Get subscriber count for a segment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zp("count",{id:e,...t}));S(mUe,{examples:["sequenzy segments count seg_123 --company comp_123"]});var fUe=_d.command("update <id>").description("Update a segment name, filters, or join operator").option("-n, --name <name>","Segment name").option("--filters-json <json>","Raw JSON array of segment filters, or an object with a root group").option("--filters-file <file>","Path to a JSON file with segment filters or a root group").option("--join-operator <operator>","How filters combine: and or or").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zp("update",{id:e,...t}));S(fUe,{notes:["Provide at least one of --name, --filters-json, --filters-file, or --join-operator.","Filters replace the existing filter set; missing filter IDs are filled in by the CLI.","For array-of-object attributes, positive filters sharing a wildcard array prefix (such as history_events[].venue and history_events[].date) and connected only by AND must match one shared array element. Negative is_not, not_contains, and is_empty filters remain independent."],examples:['sequenzy segments update seg_123 --name "Churn Risk"',`sequenzy segments update seg_123 --filters-json '[{"field":"tag","operator":"contains","value":"vip"}]'`,"sequenzy segments update seg_123 --join-operator or"]});var gUe=_d.command("delete <id>").description("Delete a segment").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zp("delete",{id:e,...t}));S(gUe,{examples:["sequenzy segments delete seg_123 --yes"]});var eu=Ve.command("audience-syncs").description("Sync segments to Meta custom audiences").action(()=>eu.help());S(eu,{notes:["Requires the Meta Ads integration to be connected in the dashboard (Settings -> Integrations).",'Use --template to start from a ready-made segment ("zero-ltv", "no-purchase-1y", "recent-buyers", "high-spenders-ecom", "non-buyers", "engaged"); the segment is created automatically on first use.',"Audiences are add-only: subscribers who leave the segment stay in the Meta audience."],examples:["sequenzy audience-syncs list",'sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"']});var AUe=eu.command("list").description("List audience syncs with schedule and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yu("list",e));S(AUe,{examples:["sequenzy audience-syncs list --company comp_123"]});var hUe=eu.command("ad-accounts").description("List the connected Meta ad accounts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yu("ad-accounts",e));S(hUe,{examples:["sequenzy audience-syncs ad-accounts"]});var yUe=eu.command("create").description("Create an audience sync (segment -> Meta custom audience)").option("--segment <id>","Existing segment ID to sync").option("--template <id>",'Predefined segment template (for example "recent-buyers", "zero-ltv", "no-purchase-1y")').requiredOption("--ad-account <id>","Meta ad account ID (see `sequenzy audience-syncs ad-accounts`)").requiredOption("-n, --name <name>","Audience name in Meta Ads Manager").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly","daily").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yu("create",e));S(yUe,{examples:['sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"','sequenzy audience-syncs create --segment seg_123 --ad-account act_123 --name "Sequenzy - VIPs" --frequency hourly']});var bUe=eu.command("update <id>").description("Change an audience sync's frequency or pause/resume it").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly").option("--active <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yu("update",{id:e,...t}));S(bUe,{examples:["sequenzy audience-syncs update sync_123 --frequency weekly","sequenzy audience-syncs update sync_123 --active false"]});var vUe=eu.command("delete <id>").description("Remove an audience sync (the Meta audience itself is kept)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yu("delete",{id:e,...t}));S(vUe,{examples:["sequenzy audience-syncs delete sync_123"]});var EUe=eu.command("sync <id>").description("Trigger an immediate sync run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yu("sync",{id:e,...t}));S(EUe,{examples:["sequenzy audience-syncs sync sync_123"]});var mC=Ve.command("warehouse").description("Sync contacts and events from Snowflake, BigQuery, Redshift or Postgres").action(()=>mC.help());S(mC,{notes:["Connect a warehouse with a read-only user, then create syncs that run a SELECT query on a schedule.","Subscriber syncs import contacts through the same pipeline as imports; event syncs record events on existing contacts.","Each run only sends rows that changed. Set --cursor-column (for example updated_at) so runs read only new rows."],examples:[`${Vl}=... sequenzy warehouse connections create --provider postgres --name Analytics --host db.example.com --database analytics --username reader`,"sequenzy warehouse connections preview conn_123 --query 'select email, plan from customers'",`sequenzy warehouse syncs create --connection conn_123 --name Customers --query-file customers.sql --mapping-json '{"emailColumn":"email","attributes":[{"column":"plan","attribute":"plan"}]}' --cursor-column updated_at`]});var tu=mC.command("connections").description("Manage warehouse connections").action(()=>tu.help());tu.command("list").description("List warehouse connections").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Wl("list",e));tu.command("get <id>").description("Show a warehouse connection").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("get",{id:e,...t}));var IUe=tu.command("create").description("Connect a warehouse (runs a test query before saving)").requiredOption("--provider <provider>","snowflake, bigquery, redshift or postgres").requiredOption("-n, --name <name>","Display name").option("--config-json <json>","Connection settings as JSON (merged with the flags below)").option("--account <account>","Snowflake account identifier").option("--username <user>","Database user").option("--warehouse <warehouse>","Snowflake warehouse").option("--database <database>","Database name").option("--schema <schema>","Snowflake schema").option("--role <role>","Snowflake role").option("--project-id <id>","BigQuery project ID").option("--location <location>","BigQuery location, for example US").option("--host <host>","Redshift/Postgres host").option("--port <port>","Redshift/Postgres port").option("--ssl-mode <mode>","require or verify-full").option("--private-key-file <path>","Snowflake PKCS#8 private key (PEM file)").option("--private-key-passphrase <passphrase>","Passphrase for an encrypted key").option("--service-account-file <path>","BigQuery service account key (JSON file)").option("--password <password>",`Redshift/Postgres password (or set ${Vl})`).option("--credentials-file <path>","All credentials as a JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Wl("create",e));S(IUe,{examples:["sequenzy warehouse connections create --provider snowflake --name Snowflake --account myorg-myaccount --username SEQUENZY_READER --warehouse ANALYTICS_WH --database PROD --private-key-file rsa_key.p8","sequenzy warehouse connections create --provider bigquery --name BigQuery --project-id acme-analytics --service-account-file key.json",`${Vl}=... sequenzy warehouse connections create --provider redshift --name Redshift --host cluster.abc.us-east-1.redshift.amazonaws.com --database analytics --username reader`]});tu.command("update <id>").description("Rename, change settings or rotate credentials (re-tested before saving)").option("-n, --name <name>","Display name").option("--config-json <json>","Connection settings as JSON (merged with the flags below)").option("--account <account>","Snowflake account identifier").option("--username <user>","Database user").option("--warehouse <warehouse>","Snowflake warehouse").option("--database <database>","Database name").option("--schema <schema>","Snowflake schema").option("--role <role>","Snowflake role").option("--project-id <id>","BigQuery project ID").option("--location <location>","BigQuery location, for example US").option("--host <host>","Redshift/Postgres host").option("--port <port>","Redshift/Postgres port").option("--ssl-mode <mode>","require or verify-full").option("--private-key-file <path>","Snowflake PKCS#8 private key (PEM file)").option("--private-key-passphrase <passphrase>","Passphrase for an encrypted key").option("--service-account-file <path>","BigQuery service account key (JSON file)").option("--password <password>","New Redshift/Postgres password").option("--password-from-env",`Rotate the Redshift/Postgres password to ${Vl}`).option("--credentials-file <path>","All credentials as a JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("update",{id:e,...t}));tu.command("delete <id>").description("Delete a connection (delete its syncs first)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("delete",{id:e,...t}));tu.command("test <id>").description("Run a test query with the stored credentials").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("test",{id:e,...t}));tu.command("preview <id>").description("Run a query with a 20-row limit to see its columns").option("--query <sql>","SELECT query").option("--query-file <path>","File with the SELECT query").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("preview",{id:e,...t}));var nu=mC.command("syncs").description("Manage warehouse syncs").action(()=>nu.help());nu.command("list").description("List syncs with status and the latest run").option("--connection <id>","Only syncs of this connection").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yl("list",e));nu.command("get <id>").description("Show a sync").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("get",{id:e,...t}));var CUe=nu.command("create").description("Create a sync (columns are checked against the query; the first run starts now)").requiredOption("--connection <id>","Warehouse connection ID").requiredOption("-n, --name <name>","Display name").option("--kind <kind>","subscribers or events","subscribers").option("--query <sql>","SELECT query").option("--query-file <path>","File with the SELECT query").option("--mapping-json <json>","Column mapping as JSON").option("--mapping-file <path>","Column mapping as a JSON file").option("--cursor-column <column>","Column for incremental reads (for example updated_at)").option("--frequency <frequency>","every_15_minutes, hourly, daily, weekly or manual").option("--lists <ids>","Comma-separated list IDs for new contacts (subscriber syncs)").option("--opt-in-mode <mode>","confirmed or double_opt_in (subscriber syncs)").option("--trigger-automations","Let new contacts or recent events start automations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yl("create",e));S(CUe,{notes:['Subscriber mapping: {"emailColumn","phoneColumn","externalIdColumn","firstNameColumn","lastNameColumn","tagsColumn","attributes":[{"column","attribute"}]}.','Event mapping: {"emailColumn" or "externalIdColumn", "eventNameColumn" or "eventName", "eventIdColumn", "occurredAtColumn", "properties":[{"column","property"}]}.'],examples:[`sequenzy warehouse syncs create --connection conn_123 --name Customers --query 'select email, first_name, plan, updated_at from customers' --mapping-json '{"emailColumn":"email","firstNameColumn":"first_name","attributes":[{"column":"plan","attribute":"plan"}]}' --cursor-column updated_at --frequency hourly`,`sequenzy warehouse syncs create --connection conn_123 --name Orders --kind events --query-file orders.sql --mapping-json '{"emailColumn":"email","eventName":"order_placed","eventIdColumn":"order_id","occurredAtColumn":"placed_at"}'`]});nu.command("update <id>").description("Change the query, mapping, schedule or options; pause or resume").option("-n, --name <name>","Display name").option("--query <sql>","SELECT query").option("--query-file <path>","File with the SELECT query").option("--mapping-json <json>","Column mapping as JSON").option("--mapping-file <path>","Column mapping as a JSON file").option("--cursor-column <column>","Column for incremental reads (for example updated_at)").option("--frequency <frequency>","every_15_minutes, hourly, daily, weekly or manual").option("--lists <ids>","Comma-separated list IDs for new contacts (subscriber syncs)").option("--opt-in-mode <mode>","confirmed or double_opt_in (subscriber syncs)").option("--trigger-automations","Let new contacts or recent events start automations").option("--no-trigger-automations","Stop starting automations").option("--enabled <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("update",{id:e,...t}));nu.command("delete <id>").description("Delete a sync (imported contacts and events stay)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("delete",{id:e,...t}));nu.command("run <id>").description("Run a sync now").option("--full-resync","Forget what was sent and send every row again").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("run",{id:e,...t}));nu.command("runs <id>").description("Show recent runs with row counts, import progress and errors").option("--limit <n>","Number of runs (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("runs",{id:e,...t}));var Ka=Ve.command("data-exports").description("Stream events and subscriber snapshots to your S3 or GCS bucket").action(()=>Ka.help());S(Ka,{notes:["Files are gzipped JSON lines under <prefix>/<dataset>/date=YYYY-MM-DD/, ready for Snowflake, BigQuery, Redshift, Athena or DuckDB.","Datasets: email_events, sms_events, custom_events, subscribers (daily snapshot). Rows are delivered at least once; deduplicate on id.",`Pass the secret with --secret-access-key or the ${Qa} environment variable. It is never returned by the API.`],examples:["sequenzy data-exports list",`${Qa}=... sequenzy data-exports create --name "Lake" --bucket acme-exports --region us-east-1 --access-key-id AKIA...`,"sequenzy data-exports runs exp_123"]});var wUe=Ka.command("list").description("List data exports with progress and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>bc("list",e));S(wUe,{examples:["sequenzy data-exports list --json"]});var SUe=Ka.command("get <id>").description("Show one data export").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("get",{id:e,...t}));S(SUe,{examples:["sequenzy data-exports get exp_123"]});var DUe=Ka.command("create").description("Add a bucket destination (verifies access with a test file)").requiredOption("-n, --name <name>","Display name").option("--provider <provider>","s3 (AWS or S3-compatible) or gcs","s3").requiredOption("--bucket <bucket>","Bucket name").option("--region <region>","Bucket region (required for AWS S3)").option("--endpoint <url>","Custom S3-compatible endpoint (R2, MinIO, Backblaze)").option("--prefix <path>","Path prefix inside the bucket").requiredOption("--access-key-id <id>","Access key ID (GCS: HMAC access ID)").option("--secret-access-key <secret>",`Secret access key (or set ${Qa})`).option("--datasets <list>","Comma-separated: email_events,sms_events,custom_events,subscribers").option("--frequency <frequency>","every_5_minutes, every_15_minutes, hourly or daily").option("--backfill-days <days>","Include up to 30 days of events already recorded (default 0)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>bc("create",e));S(DUe,{examples:[`${Qa}=... sequenzy data-exports create --name "Lake" --bucket acme-exports --region us-east-1 --access-key-id AKIA... --prefix sequenzy`,`${Qa}=... sequenzy data-exports create --name "GCS" --provider gcs --bucket acme --access-key-id GOOG1... --datasets email_events,subscribers --backfill-days 7`]});var _Ue=Ka.command("update <id>").description("Change datasets, frequency, location or credentials; pause or resume").option("-n, --name <name>","Display name").option("--bucket <bucket>","Bucket name").option("--region <region>","Bucket region").option("--endpoint <url>","Custom S3-compatible endpoint").option("--prefix <path>","Path prefix inside the bucket").option("--access-key-id <id>","New access key ID (rotates credentials)").option("--secret-access-key <secret>",`New secret (or set ${Qa})`).option("--datasets <list>","Comma-separated datasets").option("--frequency <frequency>","every_5_minutes, every_15_minutes, hourly or daily").option("--enabled <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("update",{id:e,...t}));S(_Ue,{examples:["sequenzy data-exports update exp_123 --frequency hourly","sequenzy data-exports update exp_123 --enabled false","sequenzy data-exports update exp_123 --datasets email_events,custom_events"]});var xUe=Ka.command("delete <id>").description("Delete a data export (files already written are kept)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("delete",{id:e,...t}));S(xUe,{examples:["sequenzy data-exports delete exp_123 --yes"]});var BUe=Ka.command("test <id>").description("Write a test file to confirm the credentials still work").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("test",{id:e,...t}));S(BUe,{examples:["sequenzy data-exports test exp_123"]});var kUe=Ka.command("run <id>").description("Start an export now instead of waiting for the schedule").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("run",{id:e,...t}));S(kUe,{examples:["sequenzy data-exports run exp_123"]});var RUe=Ka.command("runs <id>").description("Show recent export runs (last 14 days)").option("--limit <n>","Number of runs (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("runs",{id:e,...t}));S(RUe,{examples:["sequenzy data-exports runs exp_123 --limit 5"]});var ru=Ve.command("products").description("Manage products and digital delivery files").action(()=>ru.help());S(ru,{notes:["Products sync from Stripe, Shopify, and WooCommerce integrations.","Attach a deliverable file to a Stripe product, then reference it in purchase sequence emails with {{event.download.url}} and {{event.download.name}}."],examples:["sequenzy products list --provider stripe","sequenzy products sync",'sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --file ./ebook.pdf',"sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/guide.pdf --name guide.pdf","sequenzy products detach-file prod_abc","sequenzy products delete my-ebook"]});var TUe=ru.command("list").description("List synced products including attached delivery files").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Filter by provider (stripe, shopify, woocommerce, manual)").option("--search <query>","Filter products by title").option("--limit <number>","Products per page (1-100, default 50)").option("--offset <number>","Number of products to skip").option("--all","Fetch every page instead of just the first").option("--json","Print raw JSON").action((e)=>rd("list",e));S(TUe,{notes:["Returns one page by default. The header shows 'N of TOTAL' when the catalog is larger than the page.","Use --all to page through catalogs larger than the 100-per-request cap."],examples:["sequenzy products list --provider stripe","sequenzy products list --all","sequenzy products list --limit 100 --offset 100"]});var OUe=ru.command("sync").description("Queue a Stripe product catalog sync").option("-c, --company <id>","Company ID override for personal API keys").option("--integration <id>","Stripe integration ID to sync").option("--json","Print raw JSON").action((e)=>rd("sync",e));S(OUe,{examples:["sequenzy products sync --company comp_123","sequenzy products sync --integration int_123"]});var NUe=ru.command("upsert [productId]").description("Create or update products in the catalog (Commerce API, keyed by your productId)").option("--title <title>","Product title (required for single upserts)").option("--description <text>","Product description").option("--price-cents <cents>","Price in the smallest currency unit").option("--currency <code>","ISO currency code, e.g. USD").option("--image-url <url>","Product image URL").option("--product-url <url>","Product page URL").option("--provider-created-at <iso>","Product creation time from the source catalog (ISO 8601)").option("--clear-provider-created-at","Clear the stored source-catalog creation time").option("--in-stock","Mark the product as in stock").option("--out-of-stock","Mark the product as out of stock").option("--file <path>","Deliverable file to upload and attach in one step").option("--url <link>","External deliverable http(s) link to attach in one step").option("--name <fileName>","Display name for the attached deliverable").option("--products-json <json>","Inline JSON array of products to upsert").option("--products-file <file>","Path to a JSON file with products to upsert").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("upsert",t,e));S(NUe,{notes:["Products are keyed by your own productId and stored under the api provider.","Combine --file or --url with a single-product upsert to attach the deliverable file in the same command.","Use --products-json/--products-file for bulk upserts of up to 100 products."],examples:['sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --currency USD --file ./ebook.pdf','sequenzy products upsert my-course --title "The Course" --url https://files.example.com/course.zip',"sequenzy products upsert --products-file ./products.json"]});var $Ue=ru.command("delete <productId>").description("Delete a product previously pushed via the Commerce API").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("delete",t,e));S($Ue,{examples:["sequenzy products delete my-ebook"]});var PUe=ru.command("attach-file <id>").description("Attach the deliverable file buyers receive after purchase").option("--file <path>","Local file to upload (PDF, ePub, ZIP, media)").option("--url <link>","External http(s) link instead of an upload").option("--name <fileName>","Display name for the file (e.g. guide.pdf)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("attach-file",t,e));S(PUe,{examples:["sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/template.zip --name template.zip"]});var QUe=ru.command("detach-file <id>").description("Remove the attached delivery file from a product").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("detach-file",t,e));S(QUe,{examples:["sequenzy products detach-file prod_abc"]});var ZA=Ve.command("team").description("Manage team members and invitations").action(()=>ZA.help());S(ZA,{notes:["Inviting and cancelling invitations requires owner or admin access.","Billing access can only be granted by the company owner."],examples:["sequenzy team list","sequenzy team invite teammate@example.com --role admin","sequenzy team cancel-invitation inv_123"]});var qUe=ZA.command("list").description("List team members and pending invitations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>eC("list",e));S(qUe,{examples:["sequenzy team list --company comp_123"]});var FUe=ZA.command("invite <email>").description("Invite a team member or add an existing user").requiredOption("--role <role>","Member role: admin, viewer, or restricted").option("--billing-access","Allow the member to manage billing (owner only)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>eC("invite",{email:e,...t}));S(FUe,{notes:["Existing Sequenzy users are added to the team immediately; everyone else receives an email invitation.","Invitations expire automatically and can be re-sent by inviting the same email again after cancelling."],examples:["sequenzy team invite teammate@example.com --role admin","sequenzy team invite editor@example.com --role restricted","sequenzy team invite finance@example.com --role viewer --billing-access"]});var LUe=ZA.command("cancel-invitation <invitationId>").description("Cancel a pending team invitation").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>eC("cancel-invitation",{invitationId:e,...t}));S(LUe,{notes:["Run `sequenzy team list` first to find invitation IDs."],examples:["sequenzy team cancel-invitation inv_123 --yes"]});var Eo=Ve.command("inbox").description("Read and answer email in your inbox").action(()=>Eo.help());S(Eo,{notes:["The inbox receives replies to your campaigns, sequences, and transactional email, plus any email sent to your inbox address (sequenzy inbox address).","Use --note on replies to add an internal note instead of emailing the contact."],examples:["sequenzy inbox address","sequenzy inbox list --status open --unread","sequenzy inbox get conv_123","sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox close conv_123","sequenzy inbox close conv_123 conv_456"]});var UUe=Eo.command("address").description("Show or set the address anyone can email to reach your inbox").option("--local-part <name>","Use <name>@<domain> on one of your receiving domains (with --domain)").option("--domain <domain>","Receiving domain for --local-part").option("--reset","Go back to your Sequenzy inbox address").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qo("address",e));S(UUe,{notes:["Email sent to this address arrives as a new conversation, or joins an existing thread when it answers one.","Receiving must be on (Settings > Inbox) for mail to arrive.","With --local-part and --domain the address becomes <name>@<domain>, where <domain> is one of your receiving domains (see `sequenzy receiving-domains`). It starts receiving once that domain is verified; inbox+{companyId}@inbound.sequenzy.com keeps working.","Any other address on a receiving domain also lands in Inbox."],examples:["sequenzy inbox address","sequenzy inbox address --local-part support --domain acme.com","sequenzy inbox address --reset"]});var MUe=Eo.command("list").description("List conversations").option("-s, --status <status>","Filter by status: open, closed, or all").option("--search <query>","Search by contact email, name, or subject").option("--unread","Only conversations with unread messages").option("--spam","List the Spam folder instead of the inbox").option("--sent-to <address>","Only conversations that started at this inbox address").option("-p, --page <number>","Page number (default 1)").option("-l, --limit <number>","Results per page (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qo("list",e));S(MUe,{notes:["Mail the spam or virus scan flags goes to the Spam folder; other lists leave it out. See `sequenzy inbox recipients` for the addresses --sent-to accepts."],examples:["sequenzy inbox list","sequenzy inbox list --status open --unread",'sequenzy inbox list --search "refund" --limit 50',"sequenzy inbox list --spam","sequenzy inbox list --sent-to admin@example.com"]});var jUe=Eo.command("recipients").description("List the inbox addresses conversations started at").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qo("recipients",e));S(jUe,{examples:["sequenzy inbox recipients"]});var zUe=Eo.command("get <conversationId>").description("Get a conversation with its full message history").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("get",{conversationId:e,...t}));S(zUe,{examples:["sequenzy inbox get conv_123","sequenzy inbox get conv_123 --json"]});var GUe=Eo.command("reply <conversationId>").description("Reply to a conversation or add an internal note").option("-t, --text <text>","Plain text message body").option("--html-file <file>","Read an HTML message body from file").option("-s, --subject <subject>","Override the reply subject").option("--note","Add an internal note instead of emailing the subscriber").option("--sender-profile-id <id>","Reply from this sender profile instead of the default. See sequenzy sender-profiles list").option("--attach <file>","Attach a file (repeat for up to 10 files, 15 MB total)",(e,t=[])=>[...t,e]).option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("reply",{conversationId:e,...t}));S(GUe,{notes:["Provide a body with --text and/or --html-file.","Outbound replies are emailed to the subscriber and reopen closed conversations; notes are internal only.","--sender-profile-id sends the reply from that sender profile; its domain must be verified. Without it, the reply uses the API key owner's address.","--attach can be repeated; attachments need attachment storage on the server (see sequenzy inbox address)."],examples:["sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox reply conv_123 --text 'Invoice attached' --attach ./invoice.pdf","sequenzy inbox reply conv_123 --text 'Happy to help' --sender-profile-id sp_123","sequenzy inbox reply conv_123 --html-file ./reply.html","sequenzy inbox reply conv_123 --text 'Customer asked for a refund' --note"]});var HUe=Eo.command("close <conversationIds...>").description("Close one or more conversations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("close",{conversationIds:e,...t}));S(HUe,{notes:["Pass up to 100 conversation IDs to close them in one request. Already closed conversations are reported as unchanged; missing IDs are reported and exit with status 1."],examples:["sequenzy inbox close conv_123","sequenzy inbox close conv_123 conv_456 conv_789"]});var JUe=Eo.command("reopen <conversationIds...>").description("Reopen one or more closed conversations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("reopen",{conversationIds:e,...t}));S(JUe,{notes:["Pass up to 100 conversation IDs to reopen them in one request. Missing IDs are reported and exit with status 1."],examples:["sequenzy inbox reopen conv_123","sequenzy inbox reopen conv_123 conv_456"]});var KUe=Eo.command("spam <conversationIds...>").description("Move one or more conversations to the Spam folder").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("spam",{conversationIds:e,...t}));S(KUe,{notes:["Pass up to 100 conversation IDs. Missing IDs are reported and exit with status 1."],examples:["sequenzy inbox spam conv_123 conv_456"]});var VUe=Eo.command("not-spam <conversationIds...>").description("Move one or more conversations from Spam back to the inbox").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("not-spam",{conversationIds:e,...t}));S(VUe,{notes:["Pass up to 100 conversation IDs. Missing IDs are reported and exit with status 1."],examples:["sequenzy inbox not-spam conv_123"]});var WUe=Eo.command("mark-read <conversationId>").description("Mark all messages in a conversation as read").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("mark-read",{conversationId:e,...t}));S(WUe,{examples:["sequenzy inbox mark-read conv_123"]});var YUe=Eo.command("mark-unread <conversationId>").description("Mark a conversation unread again").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("mark-unread",{conversationId:e,...t}));S(YUe,{notes:["Its latest received message becomes unread again."],examples:["sequenzy inbox mark-unread conv_123"]});var ZUe=Eo.command("forward <conversationId> <messageId>").description("Email a copy of one message to another address").requiredOption("--to <email>","Address to forward the message to").option("--sender-profile-id <id>","Forward from this sender profile instead of the company default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>qo("forward",{conversationId:e,messageId:t,...n}));S(ZUe,{notes:["Get message IDs from sequenzy inbox get. Received and sent emails can be forwarded, including their attachments; notes cannot.","The forward is recorded in the conversation and does not change its status or unread state."],examples:["sequenzy inbox forward conv_123 msg_456 --to teammate@example.com"]});var Oc=Ve.command("webhooks").description("Manage outbound webhook endpoints").action(()=>Oc.help());S(Oc,{notes:["Webhook payloads are signed; the signing secret is only shown once at creation time.","Valid events cover email.*, sms.*, campaign.*, subscriber.*, and sequence.* types; omit --event to use the default set. campaign.sent is explicit-only."],examples:["sequenzy webhooks list","sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks deliveries wh_123 --limit 50","sequenzy webhooks replay wh_123 del_456"]});var XUe=Oc.command("list").description("List outbound webhook endpoints").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zl("list",e));S(XUe,{examples:["sequenzy webhooks list --company comp_123"]});var eMe=Oc.command("create").description("Create an outbound webhook endpoint").requiredOption("-n, --name <name>","Webhook name").requiredOption("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Event types to deliver, e.g. email.bounced campaign.sent subscriber.list_subscribed subscriber.list_unsubscribed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zl("create",e));S(eMe,{notes:["The signing secret is printed once on creation and cannot be retrieved later - store it immediately.","Omit --event to subscribe to the default event set.","email.received (new mail to your inbox addresses and receiving domains, not replies to your emails; not sent for spam) is opt-in: pass it with --event."],examples:["sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks create --name Inbox --url https://example.com/hook --event email.received","sequenzy webhooks create --name 'All events' --url https://example.com/hook"]});var tMe=Oc.command("update <id>").description("Update an outbound webhook endpoint").option("-n, --name <name>","Webhook name").option("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Replacement event types").option("--enable","Enable the webhook").option("--disable","Disable the webhook").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("update",{id:e,...t}));S(tMe,{notes:["Provide at least one of --name, --url, --event, --enable, or --disable.","Changing the URL or re-enabling resets the failure circuit breaker."],examples:["sequenzy webhooks update wh_123 --url https://example.com/new-hook","sequenzy webhooks update wh_123 --event email.bounced email.complained","sequenzy webhooks update wh_123 --disable"]});var nMe=Oc.command("delete <id>").description("Delete an outbound webhook endpoint").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("delete",{id:e,...t}));S(nMe,{examples:["sequenzy webhooks delete wh_123 --yes"]});var rMe=Oc.command("test <id>").description("Send a test event to a webhook endpoint").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("test",{id:e,...t}));S(rMe,{notes:["The webhook must be enabled to receive a test event."],examples:["sequenzy webhooks test wh_123"]});var iMe=Oc.command("deliveries <id>").description("List recent deliveries for a webhook endpoint").option("-l, --limit <number>","Maximum deliveries to return (1-100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("deliveries",{id:e,...t}));S(iMe,{examples:["sequenzy webhooks deliveries wh_123","sequenzy webhooks deliveries wh_123 --limit 50"]});var oMe=Oc.command("replay <id> <deliveryId>").description("Replay a webhook delivery").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Zl("replay",{id:e,deliveryId:t,...n}));S(oMe,{notes:["Run `sequenzy webhooks deliveries <id>` first to find delivery IDs."],examples:["sequenzy webhooks replay wh_123 del_456"]});var iu=Ve.command("geofences").description("Manage geofences the mobile SDKs watch").action(()=>iu.help());S(iu,{notes:["Signed-in app users entering, leaving or staying in a geofence record app.geofence_entered, app.geofence_exited and app.geofence_dwelled events.","Radius is 100-10,000 meters (200+ recommended); dwell is 60-14,400 seconds; cooldown is 300-604,800 seconds (default 3,600)."],examples:["sequenzy geofences list --group stores","sequenzy geofences create --name Soho --lat 51.5136 --lng -0.1365 --radius 200 --group stores","sequenzy geofences import stores.csv"]});function f5(e,t){return e.option("-n, --name <name>","Geofence name").option("--lat <latitude>","Center latitude (-90 to 90)").option("--lng <longitude>","Center longitude (-180 to 180)").option("-r, --radius <meters>","Radius in meters (100-10000)").option("--dwell <seconds>","Record app.geofence_dwelled after this many seconds inside").option("--cooldown <seconds>","Ignore repeat transitions per contact for this long").option("-g, --group <group>","Group label, e.g. stores").option("--external-id <id>","Your own ID for the place, used by imports").option("--pause",t?"Pause the geofence":"Create it paused").option("--resume","Resume a paused geofence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON")}var sMe=iu.command("list").description("List geofences").option("-g, --group <group>","Only this group").option("--active <true|false>","Only active or only paused geofences").option("-l, --limit <n>","Page size, 1-500 (default 100)").option("--cursor <id>","Cursor from the previous page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zu("list",e));S(sMe,{examples:["sequenzy geofences list --active true --limit 500"]});iu.command("get <id>").description("Show one geofence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zu("get",{id:e,...t}));var aMe=f5(iu.command("create").description("Create a geofence"),!1).action((e)=>Zu("create",e));S(aMe,{notes:["--name, --lat, --lng and --radius are required."],examples:["sequenzy geofences create --name 'Kings Cross' --lat 51.5308 --lng -0.1238 --radius 350 --dwell 600"]});var cMe=f5(iu.command("update <id>").description("Update a geofence"),!0).option("--clear-dwell","Stop recording dwell events").option("--clear-group","Remove the group").option("--clear-external-id","Remove the external ID").action((e,t)=>Zu("update",{id:e,...t}));S(cMe,{examples:["sequenzy geofences update geo_123 --radius 300","sequenzy geofences update geo_123 --pause"]});iu.command("delete <id>").description("Delete a geofence").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zu("delete",{id:e,...t}));var lMe=iu.command("import <file>").description("Create or update geofences from a CSV or GeoJSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zu("import",{file:e,...t}));S(lMe,{notes:["CSV headers: name, latitude, longitude, radius, dwell, cooldown, group, external_id, active. GeoJSON: Point features with the same property names.","Rows are matched by external_id, which every row needs, so importing the same file again updates instead of duplicating."],examples:["sequenzy geofences import stores.csv","sequenzy geofences import stores.geojson --json"]});var uMe=Ve.command("account").description("Verify the active API key, permissions, and your Sequenzy account context").option("--json","Print JSON").action(EJ);S(uMe,{notes:["Makes a live API request with the active credential. Compare its key name and prefix with Settings after replacing a key."],examples:["sequenzy account","sequenzy account --json"]});var eT=Ve.command("notifications").description("Manage which account notifications Sequenzy emails you");eT.command("get").description("Show your notification settings for the current company").option("--json","Print JSON").action(Y4);eT.command("set").description("Change your notification settings for the current company").option("--new-subscriber <mode>","Notify when a contact joins: off, instant, or daily").option("--form-submitted <mode>","Notify on form, popup, or landing-page submissions: off or instant (50/day cap)").option("--campaign-completed <mode>","Notify when a campaign finishes sending: off or instant").option("--weekly-report <mode>","Monday one-screen summary of last week's sends, engagement, revenue, and slipping sequences: off or weekly").option("--account-health <mode>","Findings of the scheduled account health check, inside the Monday report or as their own email: off or instant").option("--json","Print JSON").action(Z4);S(eT,{notes:["These are your own settings, not the workspace's. Teammates choose their own and this never changes theirs.","New-subscriber notifications fall back to a daily summary automatically once a day passes the instant cap, and imports never trigger them.","'daily' is not valid for --form-submitted or --campaign-completed: each submission and each campaign finish is its own event.","The weekly report is on by default and only goes out for weeks in which the workspace sent more than 10 emails; 'weekly' is its only delivery mode.","Account health findings are on by default for the workspace owner. They ride inside the Monday report when you get it, otherwise they arrive as their own email; 'off' stops both."],examples:["sequenzy notifications get","sequenzy notifications set --new-subscriber daily","sequenzy notifications set --form-submitted instant","sequenzy notifications set --weekly-report off","sequenzy notifications set --account-health off","sequenzy notifications set --new-subscriber off --form-submitted off --campaign-completed off --weekly-report off"]});var s5=(e,t=[])=>[...t,e],dMe=Ve.command("feedback <message>").description("Send product feedback about Sequenzy to the Sequenzy team").option("--category <category>","Category: missing_capability, bug, docs, ux, praise, other (default: other)").option("--context <context>","What you were trying to accomplish when you hit the gap").option("--intent <text>","Bug reports: the user's request, verbatim or closely paraphrased").option("--expected <text>","Bug reports: what you expected to happen").option("--actual <text>","Bug reports: what actually happened instead").option("--tool-call <call>",'Bug reports: a command/tool call that led to the problem, as "<tool> | <args summary> | <error>" (args and error optional). Repeatable, in order.',s5).option("--resource-id <id>","Bug reports: ID of an affected resource (campaign, sequence, subscriber, ...). Repeatable.",s5).option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>N3(e,t));S(dMe,{notes:["Agents: send feedback whenever the user wanted something the CLI, API, or MCP tools do not support. The Sequenzy team reads every submission.","When a command misbehaved or produced a wrong result, include --intent, --expected, --actual, --tool-call, and --resource-id so the team can reproduce it. Summarize arguments - do not paste raw subscriber data or secrets."],examples:['sequenzy feedback "No command to bulk-delete campaigns by label" --category missing_capability','sequenzy feedback "Segment count and list output disagree for seg_123" --category bug --context "Auditing a re-engagement segment"','sequenzy feedback "Campaign update dropped the scheduled time" --category bug --intent "Move the promo send to 9am Tuesday" --tool-call "campaigns update | --schedule 2026-08-11T09:00" --expected "Campaign rescheduled" --actual "Campaign reverted to draft" --resource-id cmp_123']});var ou=Ve.command("api-keys").description("Manage company API keys").action(()=>ou.help());S(ou,{notes:["The plain API key is only returned on creation. Save it immediately.","Listing and revocation return metadata only; secrets and stored hashes are never returned.","Every subcommand except 'handoff' needs the api_keys:manage scope. Use 'handoff' when the active key does not have it."],examples:["sequenzy api-keys list --company comp_123","sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123',"sequenzy api-keys update key_123 --preset agent_safe","sequenzy api-keys revoke key_123 --company comp_123 --yes","sequenzy api-keys handoff --preset agent_safe --replaces current"]});var pMe=ou.command("create").description("Create a company API key").option("-n, --name <name>","Human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender (default: full_access)").option("--scopes <scopes>","Comma-separated explicit permission scopes (overrides --preset)").option("--json","Print raw JSON").action((e)=>Wu("create",e));S(pMe,{notes:["Keys default to full access. Pass --preset or --scopes to restrict what the key can do."],examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123','sequenzy api-keys create --preset transactional_sender --name "Order emails"','sequenzy api-keys create --scopes "subscribers:read,subscribers:write,events:write"']});var mMe=ou.command("handoff").description("Get an owner-confirmed dashboard link for creating or rotating a key").option("-n, --name <name>","Suggested name for the new API key").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Suggested permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender").option("--scopes <scopes>","Comma-separated explicit permission scopes (overrides --preset)").option("--replaces <api-key-id>","Key the new one replaces. Pass 'current' for the key you are authenticated with").option("--json","Print raw JSON").action((e)=>Wu("handoff",e));S(mMe,{notes:["Use this when key management fails because the active key lacks api_keys:manage. That scope fails closed on purpose and cannot be granted through the API by the key missing it.","This creates nothing and never prints a key. The link opens the dashboard create-key form prefilled; the owner reviews it, clicks Create, and copies the key from the browser.","With --replaces, the dashboard offers to revoke the predecessor once the replacement exists, which finishes a rotation in one visit."],examples:['sequenzy api-keys handoff --name "Production sync (rotated)" --preset agent_safe --replaces current','sequenzy api-keys handoff --scopes "subscribers:read,events:write" --company comp_123']});var fMe=ou.command("list").description("List company API keys without secret values").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Wu("list",e));S(fMe,{notes:["Use the returned ID, name, prefix, and current-key marker to identify a key before revoking it."],examples:["sequenzy api-keys list","sequenzy api-keys list --company comp_123 --json"]});var gMe=ou.command("update").description("Rename a company API key or change its permissions in place").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-n, --name <name>","New human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Replacement permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender").option("--scopes <scopes>","Comma-separated replacement permission scopes (overrides --preset)").option("--json","Print raw JSON").action((e,t)=>Wu("update",{apiKeyId:e,...t}));S(gMe,{notes:["The key value does not change, so clients holding it keep working with the new permissions.","--preset and --scopes replace the whole selection rather than merging into it. Run 'sequenzy api-keys list --json' first to see the current scopes."],examples:["sequenzy api-keys update key_123 --preset agent_safe",'sequenzy api-keys update key_123 --scopes "subscribers:read,subscribers:tag,tags:read"','sequenzy api-keys update key_123 --name "Agent key"']});var AMe=ou.command("revoke").description("Permanently revoke a company API key").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wu("revoke",{apiKeyId:e,...t}));S(AMe,{notes:["Revocation cannot be undone. Run 'sequenzy api-keys list' first and verify the exact ID and prefix."],examples:["sequenzy api-keys revoke key_123 --company comp_123 --yes"]});var hMe=ou.command("delete").description("Alias for api-keys revoke").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wu("delete",{apiKeyId:e,...t}));S(hMe,{notes:["This is a compatibility alias for 'sequenzy api-keys revoke'."],examples:["sequenzy api-keys delete key_123 --company comp_123 --yes"]});var Nc=Ve.command("websites").description("Manage sending domains and integration guides").action(()=>Nc.help());S(Nc,{notes:["Use 'guide' for code examples, 'check' to inspect current DNS verification details, and 'verify' to run a fresh check.","Use 'upgrade-dns' to move a domain on the previous record set onto the current DNS records without removing it."],examples:["sequenzy websites list --company comp_123","sequenzy websites add example.com --company comp_123","sequenzy websites guide --framework nextjs --use-case transactional"]});var yMe=Nc.command("list").description("List sending domains for a company").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Xl("list",e));S(yMe,{examples:["sequenzy websites list --company comp_123"]});var bMe=Nc.command("add <domain>").description("Add a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--mail-from-prefix <label>","Return-path (MAIL FROM) subdomain label, default rp").option("--tracking-prefix <label>","Label of the company tracking domain (<label>.<domain>) if the company has none yet, default links").option("--json","Print raw JSON").action((e,t)=>Xl("add",{domain:e,...t}));S(bMe,{notes:["Publish the DKIM record, the bounce records on the `Bounce:` line (one CNAME for new domains; domains added earlier keep their SPF TXT and MX records) and DMARC when present; record shapes vary between unified and legacy domains.","Tracked links use the company tracking domain, shared by every sending domain. The first domain creates it under itself (links.<domain>) and returns its CNAME as trackingRecord. It is optional: sending never waits for it, and links use the shared Sequenzy domain until it verifies. Manage it with `sequenzy tracking domain`.","A domain belongs to exactly one company and cannot be moved or removed from the CLI afterwards. Confirm --company before adding; moving it later requires removal in the dashboard and new DNS verification."],examples:["sequenzy websites add example.com --company comp_123","sequenzy websites add mail.example.com --mail-from-prefix bounce"]});var vMe=Nc.command("check <domain>").description("Inspect sending domain verification details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("check",{domain:e,...t}));S(vMe,{examples:["sequenzy websites check example.com --company comp_123"]});var EMe=Nc.command("verify <domain>").description("Run a fresh DNS check for a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("verify",{domain:e,...t}));S(EMe,{notes:["'verified' is the DNS verdict only. Sending is reported separately as 'Sending' - a domain with correct DNS can still be activating.","Receiving mail (inbox addresses and replies) is set up on receiving domains, not sending domains: see `sequenzy receiving-domains`."],examples:["sequenzy websites verify example.com --company comp_123"]});var IMe=Nc.command("upgrade-dns <domain>").description("Recommended one-time upgrade of a verified sending domain to the current DNS records, without removing it").option("--mail-from-prefix <label>","Return-path subdomain label for the new records, default rp (rp1, then sqrp if taken)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("upgrade-dns",{domain:e,...t}));S(IMe,{notes:["Optional and needed only once: it improves deliverability and security. Once started it runs to the switch. Add the printed CNAMEs next to your current records and remove nothing yet. The domain keeps sending on its current records, then switches by itself about an hour after the required ones (DKIM and return path) are visible on public DNS. Sending is normally not interrupted at the switch; if that isn't possible for a domain, emails sent through Amazon SES can be held for a few minutes. `sequenzy websites verify <domain>` checks now but does not skip the wait.","After the switch, `websites check` lists the old records you can optionally delete and the date from which it is safe (8 days after the switch). For an older SES-only domain these include the old return path records (MX and TXT at send.<domain>) and the DKIM TXT; keep DMARC.",'Only verified domains on the previous record set can upgrade, including older SES-only domains that have a working DMARC record; `websites check` shows `DNS upgrade: available` for them. Without DMARC the start fails with "Add a DMARC record for this domain before upgrading its DNS records."'],examples:["sequenzy websites upgrade-dns mail.example.com --company comp_123","sequenzy websites upgrade-dns mail.example.com --mail-from-prefix bounce"]});var CMe=Nc.command("configure <domain>").description("Deprecated: set <label>.<domain> as the company tracking domain; use `tracking domain set`").requiredOption("--tracking-prefix <label>","Label beneath the sending domain, e.g. links").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("configure",{domain:e,...t}));S(CMe,{notes:["Deprecated: tracking is company-wide. Sets <label>.<domain> as the company tracking domain when the company has none; the company's current hostname is a no-op, and a different one changes nothing (the response explains why).","Prefer `sequenzy tracking domain set <hostname>`, which also changes an existing tracking domain."],examples:["sequenzy websites configure mail.example.com --tracking-prefix links"]});var wMe=Nc.command("guide").description("Print framework-specific integration code").option("--framework <name>","Framework name, e.g. nextjs, express, python").option("--use-case <name>","Use case, e.g. transactional, subscribe_form, event_tracking").option("--json","Print raw JSON").action((e)=>Xl("guide",e));S(wMe,{examples:["sequenzy websites guide","sequenzy websites guide --framework nextjs --use-case transactional","sequenzy websites guide --framework python --use-case event_tracking"]});hK(Ve);var Yr=Ve.command("integrations").description("Inspect and manage connected integrations").action(()=>Yr.help());S(Yr,{notes:["Credentials, access tokens, and webhook secrets are never returned.","`connect` covers API-key / webhook-secret providers (Polar, Paddle, Dodo, Lemon Squeezy, Whop, RevenueCat, Superwall, Adapty, Creem, Chargebee, Clerk, PostHog, Segment, Mixpanel, Amplitude, Affonso, Attio, SparkLoop). OAuth and app-install providers (Stripe, Shopify, Supabase, GitHub, WooCommerce) connect in the dashboard. Lemon Squeezy and SparkLoop support `disconnect`; other provider disconnects use the dashboard.","Use `catalog` to see what a provider does before connecting it, and `get` to see what a connected one is doing now."],examples:["sequenzy integrations list","sequenzy integrations catalog --provider stripe","sequenzy integrations connect clerk --webhook-secret whsec_...","sequenzy integrations get int_123","sequenzy integrations activity --status failed"]});Yr.command("disconnect <id>").description("Disconnect Lemon Squeezy or SparkLoop and remove its managed webhook; repeat to retry Lemon Squeezy cleanup").option("--company <id>","Company ID").option("--json","Print raw JSON").action((e,t)=>I4(e,t));var SMe=Yr.command("connect <provider>").description("Connect an API-key / webhook-secret integration").option("-c, --company <id>","Company ID override for personal API keys").option("--api-key <key>","Provider API key (or set SEQUENZY_INTEGRATION_API_KEY)").option("--webhook-secret <secret>","Webhook signing secret (Lemon Squeezy manual setup: 16-40 characters; Superwall: the webhook's whsec_ signing secret; Adapty: the webhook's authorization header value, at least 16 characters; Mixpanel and Amplitude: optional, generated and printed once when omitted; SparkLoop: optional, the webhook authentication token; or set SEQUENZY_INTEGRATION_WEBHOOK_SECRET)").option("--account-id <id>","Provider account id: Paddle seller ID, Dodo business ID, Lemon Squeezy numeric store ID, Whop company ID, Creem store ID, Chargebee site name, RevenueCat project ID (only when the key can access several projects), or SparkLoop publication ID (only when the account has several publications)").option("--attio-list <mapping...>","Attio only: map SEQUENZY_LIST_ID=ATTIO_LIST_ID_OR_SLUG (one or more)").option("--attio-clear-lists","Attio only: remove every saved Sequenzy-to-Attio list mapping").option("--attio-enable-company-domain","Attio only: create or match companies from work email domains").option("--attio-disable-company-domain","Attio only: do not create or match companies from work email domains").option("--event-allowlist <events...>","PostHog, Segment, and Amplitude only: sync only these event names instead of everything").option("--include-internal-events","PostHog, Segment, and Amplitude only: keep provider-internal events (Amplitude sessions and autocapture, PostHog $ events, Segment page/screen) that new connections skip").option("--match-by-distinct-id","PostHog only: match events without an email to the contact whose external ID equals the distinct_id (default for new connections)").option("--no-match-by-distinct-id","PostHog only: skip events without an email instead of matching them by distinct_id").option("--history-region <region>","PostHog and Segment history import region: us or eu").option("--history-project-id <id>","PostHog history import project ID").option("--history-space-id <id>","Segment history import Unify space ID (spa_...)").option("--history-api-key <key>","History import credential: the PostHog personal API key (or SEQUENZY_POSTHOG_PERSONAL_API_KEY) or the Segment Profile API token (or SEQUENZY_SEGMENT_PROFILE_API_TOKEN)").option("--json","Print raw JSON").action((e,t)=>$4(e,t));S(SMe,{notes:["Run `sequenzy integrations catalog --provider <provider>` first: its connectFields list what this provider needs.","Pass secrets via the environment variables instead of flags to keep them out of shell history.","The response includes the webhook URL. Lemon Squeezy creates and manages it when --webhook-secret is omitted, and SparkLoop always registers its own; other inbound providers use the supplied secret. Mixpanel and Amplitude generate a secret when --webhook-secret is omitted and print it once with the setup values. Attio is outbound-only.","Reconnecting an already-connected provider replaces its stored credentials.","OAuth and app-install providers (Stripe, Shopify, Supabase, GitHub, WooCommerce) cannot be connected here - use the dashboard."],examples:["sequenzy integrations connect clerk --webhook-secret whsec_...","sequenzy integrations connect paddle --api-key pdl_... --webhook-secret pdl_ntf_... --account-id 12345","sequenzy integrations connect polar --api-key polar_oat_... --webhook-secret whsec_...","sequenzy integrations connect lemon_squeezy --api-key ls_... --account-id 12345","sequenzy integrations connect revenuecat --api-key sk_... --webhook-secret <authorization-header-value>","sequenzy integrations connect superwall --webhook-secret whsec_...","sequenzy integrations connect adapty --webhook-secret sqz_your_authorization_value","sequenzy integrations connect posthog --webhook-secret phc_shared_secret --history-region us --history-project-id 12345 --history-api-key phx_...","sequenzy integrations connect posthog --webhook-secret phc_shared_secret --no-match-by-distinct-id","sequenzy integrations connect segment --webhook-secret my_shared_secret","sequenzy integrations connect segment --webhook-secret my_shared_secret --history-region us --history-space-id spa_abc123 --history-api-key profile_token","sequenzy integrations connect mixpanel","sequenzy integrations connect amplitude --event-allowlist 'Song Played' 'Plan Upgraded'","sequenzy integrations connect affonso --api-key aff_... --webhook-secret whsec_...","sequenzy integrations connect attio --api-key attio_... --attio-list list_123=field-guide","sequenzy integrations connect sparkloop --api-key <api-key> --account-id pub_..."]});var DMe=Yr.command("set-amplitude-events <id>").description("Choose which Amplitude events sync, without the webhook secret").option("-c, --company <id>","Company ID override for personal API keys").option("--event-allowlist <events...>","Sync only these Amplitude event types").option("--all-events","Sync every event type again").option("--include-internal-events","Also sync session_start, session_end, [Amplitude] autocapture, and other $ events").option("--skip-internal-events","Skip session, autocapture, and $ events unless allowlisted (the default for new connections)").option("--json","Print raw JSON").action((e,t)=>N4(e,t));S(DMe,{notes:["Identify calls always sync. Reconnecting would replace the webhook secret, so change events here instead."],examples:["sequenzy integrations set-amplitude-events int_123 --event-allowlist 'Song Played' 'Plan Upgraded'","sequenzy integrations set-amplitude-events int_123 --all-events --include-internal-events"]});var _Me=Yr.command("list").description("List connected integrations and their sync health").option("-c, --company <id>","Company ID override for personal API keys").option("--all","Include disconnected/inactive integrations").option("--json","Print raw JSON").action((e)=>L4(e));S(_Me,{examples:["sequenzy integrations list --company comp_123","sequenzy integrations list --all"]});var xMe=Yr.command("catalog").description("Show what each integration provider syncs, emits, and supports").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Only show one provider, e.g. stripe").option("--category <category>","Filter by category: payments, ecommerce, auth, analytics, ads, affiliate, cms, crm, developer").option("--json","Print raw JSON").action((e)=>P4(e));S(xMe,{notes:["Works whether or not the provider is connected, so you can compare providers before picking one.","Events listed here are the ones a sequence can trigger on. A provider that emits nothing cannot drive automations."],examples:["sequenzy integrations catalog","sequenzy integrations catalog --provider stripe","sequenzy integrations catalog --category ecommerce --json"]});var BMe=Yr.command("suggestions").description("Suggest integrations to connect, based on what is on your website").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>q4(e));S(BMe,{notes:["Lists tools Sequenzy found on your homepage or sign-in page (Clerk, Supabase, PostHog, Segment, Mixpanel, Amplitude, Webflow, Wix, WordPress, WooCommerce, Shopify) that are not connected yet.","Payment providers are never guessed: when your website lists pricing and nothing handles payments yet, every payment provider is listed instead."],examples:["sequenzy integrations suggestions","sequenzy integrations suggestions --json"]});var kMe=Yr.command("get <id>").description("Show one integration: what it does, its events, and its wiring").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Q4(e,t));S(kMe,{notes:["Lists every event the provider emits, the tags each one applies through your sync rules, and which sequences trigger on it.","Events with no sequence are reported so you can see what the integration is feeding you that nothing acts on.","Get the id from `sequenzy integrations list`."],examples:["sequenzy integrations get int_123","sequenzy integrations get int_123 --json"]});var RMe=Yr.command("activity").description("Show recent integration webhook and sync activity").option("-c, --company <id>","Company ID override for personal API keys").option("--integration <id>","Only show one integration's activity").option("--provider <provider>","Only show one provider's activity").option("--status <status>","Filter by status: received, queued, processed, skipped, failed").option("--limit <n>","Rows to return (1-100, default 25)").option("--json","Print raw JSON").action((e)=>T4(e));S(RMe,{notes:["Activity is retained for 24 hours.","Use `--status failed` when an integration reports connected but contacts are not appearing."],examples:["sequenzy integrations activity","sequenzy integrations activity --status failed --limit 50","sequenzy integrations activity --integration int_123"]});var TMe=Yr.command("sync <id>").description("Queue a manual re-sync for a connected integration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>C4(e,t));S(TMe,{notes:["Supported for Stripe, Polar, Paddle, Dodo, Lemon Squeezy, Creem, Chargebee, Whop, Supabase, PostHog, and Segment. Other providers re-sync from the dashboard.","For Supabase this backfills users from the table already configured for the integration; it cannot target a different table. Run it once after connecting, because the database trigger only sends rows that change after it is installed.","For PostHog and Segment this re-runs the event-history import with the stored credentials and is the supported retry for one that failed. It restarts from the beginning; already-imported events dedupe.","Returns immediately; poll `sequenzy integrations get <id>` to watch syncStatus and lastSyncAt.","Fails with a conflict if a sync is already running."],examples:["sequenzy integrations sync int_123"]});var OMe=Yr.command("enable-sync <id>").description("Turn sync back on for an integration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Nx(e,!0,t));S(OMe,{examples:["sequenzy integrations enable-sync int_123"]});var NMe=Yr.command("disable-sync <id>").description("Pause bulk imports without disconnecting the integration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Nx(e,!1,t));S(NMe,{notes:["Stops bulk imports and backfills but keeps the connection, credentials, and live webhook delivery active.","This does NOT stop the integration creating contacts. The provider's live webhook keeps writing every new signup or customer. Use `set-lists` to control where they land, or use `disconnect` for Lemon Squeezy or SparkLoop (the dashboard for other providers) to stop it entirely."],examples:["sequenzy integrations disable-sync int_123"]});var $Me=Yr.command("set-lists <id>").description("Choose which lists this integration's new contacts join").option("-c, --company <id>","Company ID override for personal API keys").option("--list <id>","Target this list (repeatable)",(e,t=[])=>[...t,e]).option("--none","Target no list at all").option("--default","Fall back to the workspace default lists").option("--json","Print raw JSON").action((e,t)=>S4(e,t));S($Me,{notes:["Takes effect on future provider writes. Nothing is applied retroactively and nobody is ever removed from a list. Wix/Webflow submissions, Shopify customer updates, and Supabase resubscriptions can add existing contacts to the new targets; Stripe applies targeting only when its webhook creates a subscriber.","This changes list membership only. Contacts are still created, their attributes still sync, sync-rule tags still apply, and sequences triggered by contact_added on any list still enroll them - pair it with `sequences pause-enrollments` if you need those stopped too.","`--none` and `--default` are different: --none means new contacts join no list, --default means they follow the workspace default lists setting.","Webflow requires explicit targeting, so --default is rejected for Webflow. Use --none or --list here; configure native forms, allowed fields, required double opt-in, and sequence enrollment in Settings -> Integrations -> Webflow. With no selected forms, capture is off and no contacts are created.","Supported for Supabase, Stripe, Shopify, Wix, Webflow, and SparkLoop. `integrations get <id>` reports the current targeting under `ingestion`, with list names."],examples:["sequenzy integrations set-lists int_123 --list list_abc --list list_def","sequenzy integrations set-lists int_123 --none","sequenzy integrations set-lists int_123 --default"]});var PMe=Yr.command("pixel <id>").description("Show the Shopify storefront tracking pixel state").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>_4(e,t));S(PMe,{notes:["Shopify only. Read live from the store, because a merchant can remove the pixel without notifying Sequenzy.","Check this before trusting product views, cart activity, or browse abandonment: without the pixel those events never arrive and any sequence triggered by them silently never fires."],examples:["sequenzy integrations pixel int_123"]});var QMe=Yr.command("enable-pixel <id>").description("Install or repoint the Shopify storefront tracking pixel").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>x4(e,t));S(QMe,{notes:["Idempotent: an already-live pixel is reported with `changed: false`.","Events start arriving on the next storefront visit; nothing is backfilled for the period the pixel was off.","Fails with guidance if the store granted an older permission set - reconnect Shopify from the dashboard, then retry."],examples:["sequenzy integrations enable-pixel int_123"]});var qMe=Yr.command("attio <id>").description("Show Attio list mappings and available people-lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>k4(e,t));S(qMe,{notes:["Attio only. Reads live people-lists from Attio using the stored access token — you do not need the secret again.","Shows every mapping in both directions and whether inbound sync is listening. Map with `set-attio-lists` rather than reconnecting."],examples:["sequenzy integrations attio int_123"]});var FMe=Yr.command("set-attio-lists <id>").description("Map Sequenzy lists and tags to and from Attio lists without reconnecting").option("-c, --company <id>","Company ID override for personal API keys").option("--map <mapping...>","Complete SEQUENZY_LIST_ID=ATTIO_LIST_ID_OR_SLUG map, Sequenzy to Attio (one or more)").option("--clear-maps","Remove every saved Sequenzy-to-Attio list mapping").option("--tag-map <mapping...>","Complete TAG=ATTIO_LIST_ID_OR_SLUG map, Sequenzy tags to Attio (one or more)").option("--clear-tag-maps","Remove every saved tag-to-Attio mapping").option("--from-attio <mapping...>","Complete ATTIO_LIST_ID_OR_SLUG=SEQUENZY_LIST_ID map, Attio to Sequenzy lists (one or more)").option("--clear-from-attio","Remove every saved Attio-to-list mapping").option("--from-attio-tag <mapping...>","Complete ATTIO_LIST_ID_OR_SLUG=TAG map, Attio to Sequenzy tags (one or more)").option("--clear-from-attio-tags","Remove every saved Attio-to-tag mapping").option("--enable-removals","Mirror removals: leaving a mapped list or tag removes the person on the other side").option("--disable-removals","Add-only sync: never remove anyone").option("--enable-company-domain","Create or match companies from work email domains").option("--disable-company-domain","Do not create or match companies from work email domains").option("--json","Print raw JSON").action((e,t)=>R4(e,t));S(FMe,{notes:["Uses the stored Attio access token. Do not reconnect just to change mappings.","Each map flag replaces that saved map entirely; maps you do not pass are kept. Run `sequenzy integrations attio <id>` first to see Sequenzy list ids, tags, and live Attio list ids/slugs.","--from-attio and --from-attio-tag pull changes from Attio. Sequenzy creates the Attio webhook itself; the token needs the webhook:read-write scope.","Unmapped lists and tags are not synced. Removals sync only with --enable-removals."],examples:["sequenzy integrations set-attio-lists int_123 --map list_abc=field-guide list_def=benchmark","sequenzy integrations set-attio-lists int_123 --tag-map vip=key-accounts","sequenzy integrations set-attio-lists int_123 --from-attio key-accounts=list_abc --from-attio-tag key-accounts=vip --enable-removals","sequenzy integrations set-attio-lists int_123 --clear-maps","sequenzy integrations set-attio-lists int_123 --disable-company-domain"]});var LMe=Yr.command("guide").description("Print integration code examples for your stack").option("-c, --company <id>","Company ID override for personal API keys").option("--framework <framework>","Framework or language, e.g. nextjs").option("--use-case <use-case>","transactional, subscribe_form, event_tracking, or ecommerce").option("--json","Print raw JSON").action((e)=>v4(e));S(LMe,{notes:["Same examples the MCP `get_integration_guide` tool returns.","For Stripe, Polar, Paddle, Dodo, Creem, Shopify, or WooCommerce, connect the native integration instead of writing tracking code by hand."],examples:["sequenzy integrations guide --use-case transactional --framework nextjs","sequenzy integrations guide --use-case ecommerce"]});var XA=Ve.command("sender-profiles").description("Inspect, rename, and delete sending identity profiles").action(()=>XA.help());S(XA,{notes:["Shows which profiles are account defaults and whether each sender address sits on a verified sending domain.","`update` renames one profile in place and never changes the account defaults. To change which profile is the default, use `sequenzy companies update <id> --sender-profile-id <id>`."],examples:["sequenzy sender-profiles list","sequenzy sender-profiles update sender_abc123 --name 'SnapCount'","sequenzy sender-profiles delete sender_abc123 --yes"]});var UMe=XA.command("list").description("List sender and reply-to profiles").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>z8(e));S(UMe,{examples:["sequenzy sender-profiles list --company comp_123"]});var MMe=XA.command("update <id>").description("Rename a sender or reply-to profile without changing defaults").requiredOption("--name <name>","New display name for the profile").option("--reply","Treat <id> as a reply-to profile instead of a sender").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>G8(e,t));S(MMe,{notes:["Renames the profile only. The account default From/Reply-To selection is left exactly as it was.","Get profile IDs from `sequenzy sender-profiles list`.","A company cannot have two sender identities with the same name on one address, so a colliding rename is rejected with the ID of the profile already using that name.","Requires the companies:manage scope."],examples:["sequenzy sender-profiles update sender_abc123 --name 'SnapCount'","sequenzy sender-profiles update reply_abc123 --name 'SnapCount' --reply","sequenzy sender-profiles update sender_abc123 --name 'SnapCount' --company comp_123 --json"]});var jMe=XA.command("delete <id>").description("Permanently delete a sender (From) profile").option("--yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>H8(e,t));S(jMe,{notes:["This cannot be undone. Reply-to profiles are not supported by this command.","Deletion is blocked for the last sender and for profiles used by live campaigns, active sequences, or transactional emails.","Eligible draft campaigns and the account default move to the best remaining sender when needed; the result reports that fallback profile ID.","Requires the companies:manage scope."],examples:["sequenzy sender-profiles delete sender_abc123","sequenzy sender-profiles delete sender_abc123 --yes --json"]});var fC=Ve.command("sending").description("Check company-level sending status and restore paused sending").action(()=>fC.help());S(fC,{notes:["Company-level sending can be paused automatically when the permanent-bounce, temporary-bounce, or complaint rate crosses its threshold. While paused, every send is blocked - campaigns, sequence steps, transactional email, and test sends.","Sender-health enforcement uses all-time totals counted from a reset watermark, NOT a rolling window. A paused rate does not expire on its own, so waiting does not restore sending.","`status` needs account:read. `resume` needs companies:manage plus owner or admin access."],examples:["sequenzy sending status","sequenzy sending resume --confirm-list-sanitized"]});var zMe=fC.command("status").description("Show sending status, sender-health rates, and how to restore sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Y8(e));S(zMe,{notes:["Run this first whenever a send or test send fails for a reason that is not a validation error.","Shows the exact pause reason, the measured rates against the thresholds that apply at your volume, the automated sender-health review state, whether one-click resume is available, and ordered remediation steps.","`metricsWindow` reports the enforcement watermarks. `expiresAt` is always null because there is no rolling window to wait out."],examples:["sequenzy sending status","sequenzy sending status --json","sequenzy sending status --company comp_123"]});var GMe=fC.command("resume").description("Restore paused sending after fixing the cause of the bounces").option("--confirm-list-sanitized","Required. Confirms you fixed the source of the invalid addresses and left every permanent bounce suppressed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Z8(e));S(GMe,{notes:["This is the supported remediation path, not a bypass. It never removes suppressions.","Only a permanent-bounce pause can be cleared this way, and only after the automated sender-health review has cleared it. Any other state needs a support review, and the error names which gate stopped you.","Check `selfResume.canSelfResume` with `sequenzy sending status` before calling this.","On success the bounce watermark resets, so the paused rate is recalculated from sends made after the resume, and the service attempts to requeue paused campaigns plus due sequence steps. If that handoff is only partial, the success message gives recovery guidance.","The confirmation is recorded on the account audit trail, so only pass --confirm-list-sanitized once the fix is actually shipped."],examples:["sequenzy sending resume --confirm-list-sanitized","sequenzy sending resume --confirm-list-sanitized --json"]});var eh=Ve.command("tracking").description("Inspect and update email tracking configuration").action(()=>eh.help());S(eh,{notes:["Covers open/click/unsubscribe tracking, attribution window, double opt-in for new contacts, auto UTM, the company tracking domain, and reply tracking."],examples:["sequenzy tracking settings","sequenzy tracking update --opens off --clicks off","sequenzy tracking domain set links.example.com"]});NZ(eh);Q3(Ve);hJ(Ve);bK(Ve);NJ(Ve);JZ(Ve);var HMe=eh.command("settings").description("Show the company's tracking configuration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>J8(e));S(HMe,{examples:["sequenzy tracking settings --company comp_123"]});var JMe=eh.command("update").description("Update account-wide tracking defaults").option("--opens <on|off>","Enable or disable open tracking").option("--clicks <on|off>","Enable or disable click tracking").option("--transactional-opens <on|off>","Enable or disable open tracking by default for Transactional API sends").option("--transactional-clicks <on|off>","Enable or disable click tracking by default for Transactional API sends").option("--strict-bot-filtering <on|off>","Enable or disable aggressive bot filtering (can lower reported open/click rates)").option("--unsubscribes <on|off>","Route unsubscribe links to other services through your tracking domain").option("--store-content <on|off>","Keep sent email content and subjects, and the IP address, user agent and country of opens and clicks").option("--attribution-window-hours <hours>","Default revenue attribution window in hours (1-720)").option("--double-opt-in <on|off>","Require email confirmation before new contacts become subscribed").option("--double-opt-in-redirect-url <url>","Where the confirmation page sends subscribers after they confirm; pass an empty string to clear it").option("--auto-utm <on|off>","Enable or disable automatic UTM tagging").option("--utm-source <template>","utm_source template").option("--utm-medium <template>","utm_medium template").option("--utm-campaign <template>","utm_campaign template").option("--utm-content <template>","utm_content template").option("--utm-term <template>","utm_term template").option("--reset-utm","Reset every UTM parameter to the platform defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>K8(e));S(JMe,{notes:["Partial update: omitted flags keep their current values.","--unsubscribes off stops routing unsubscribe links that point to other services through your tracking domain. Sequenzy's own unsubscribe links always use your tracking domain (or the shared one). Actual unsubscribes and their email attribution are recorded either way.","--store-content off keeps no copy of each sent email's content, stores the email's name instead of its subject, and stores no IP address, user agent or country for opens and clicks. View-in-browser links stop working.","Transactional API defaults can only narrow the account-wide open and click settings; per-send trackingSettings can opt out again.","Applies to emails sent afterwards; already-sent emails keep the links they were rendered with.","UTM templates support placeholders such as {{email.subject}} and {{link.text}}.","--double-opt-in on makes new contacts start pending until they confirm; it needs a sender profile and provisions the confirmation email automatically. Existing active contacts are unaffected.","--double-opt-in-redirect-url sends subscribers to your own page after they confirm; without it they stay on the branded confirmation page.","Reply tracking is set with `sequenzy companies update`; the company tracking domain is managed with `sequenzy tracking domain`."],examples:["sequenzy tracking update --opens off --clicks off","sequenzy tracking update --transactional-opens off --transactional-clicks off","sequenzy tracking update --attribution-window-hours 168","sequenzy tracking update --double-opt-in on","sequenzy tracking update --double-opt-in-redirect-url https://example.com/welcome",'sequenzy tracking update --auto-utm on --utm-source newsletter --utm-campaign "{{email.subject}}"',"sequenzy tracking update --reset-utm"]});var tT=Ve.command("shopify").description("Manage the connected Shopify store's automation settings").action(()=>tT.help());S(tT,{notes:["Requires a connected Shopify integration on the company.","Browse abandonment emails shoppers who viewed a product but didn't buy; cart abandonment fires ecommerce.cart_abandoned with the full cart after the cart sits inactive; price drop alerts email recent viewers when a product's price falls."],examples:["sequenzy shopify settings get","sequenzy shopify settings update --price-drop off","sequenzy shopify settings update --browse-delay-hours 4 --browse-cooldown-hours 48"]});var nT=tT.command("settings").description("Browse-abandonment, cart-abandonment, and price-drop automation settings").action(()=>nT.help()),KMe=nT.command("get").description("Show the effective automation settings").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>DR("get",e));S(KMe,{notes:["Shows the effective values - platform defaults apply until the store overrides them."],examples:["sequenzy shopify settings get --json"]});var VMe=nT.command("update").description("Update browse-abandonment, cart-abandonment, and/or price-drop settings").option("--browse-abandonment <on|off>","Enable or disable browse abandonment").option("--browse-delay-hours <hours>","Hours to wait after a product view before the abandonment check (default 2)").option("--browse-cooldown-hours <hours>","Minimum hours between browse-abandoned events per subscriber (default 24)").option("--reset-browse-abandonment","Reset browse abandonment to the platform defaults").option("--cart-abandonment <on|off>","Enable or disable cart abandonment (ecommerce.cart_abandoned)").option("--cart-delay-hours <hours>","Hours of cart inactivity before abandonment (positive, max 168; default 1)").option("--cart-cooldown-hours <hours>","Minimum hours between cart-abandoned events (positive, max 720; default 24)").option("--cart-expire-after-hours <hours>","Drop a cart untouched this long instead of emailing about it (positive, max 720; default 72)").option("--reset-cart-abandonment","Reset cart abandonment to the platform defaults").option("--price-drop <on|off>","Enable or disable price drop alerts").option("--price-drop-min-percent <percent>","Minimum price decrease percent to alert on (default 5)").option("--price-drop-lookback-days <days>","How many days back viewers qualify as the audience (default 30)").option("--price-drop-cooldown-days <days>","Minimum days between price-drop events per subscriber and product (default 7)").option("--reset-price-drop","Reset price drop alerts to the platform defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>DR("update",e));S(VMe,{notes:["Partial update: omitted flags keep their current values.","If no sequence handles ecommerce.price_drop, Sequenzy sends a default price-drop email to active subscribers."],examples:["sequenzy shopify settings update --browse-abandonment off","sequenzy shopify settings update --cart-delay-hours 2","sequenzy shopify settings update --price-drop-min-percent 10 --price-drop-lookback-days 14","sequenzy shopify settings update --reset-price-drop"]});var su=Ve.command("sms").description("Inspect the SMS add-on status for a company").action(()=>su.help());S(su,{notes:["SMS sequence steps only send when the add-on is enabled, the plan is eligible, and an active number exists.",'Add SMS steps to sequences with type: "sms" in sequences create --steps-* or update --insert-steps-*.','Generate SMS copy with `sequenzy generate sms "<prompt>"`.'],examples:["sequenzy sms settings","sequenzy sms settings --json"]});var WMe=su.command("settings").description("Show SMS add-on status, credits, and phone numbers").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Cd("settings",e));S(WMe,{notes:["readyToSend in the JSON output tells you whether SMS sequence steps will actually send."],examples:["sequenzy sms settings --json"]});var YMe=su.command("label <number-id> [label]").description("Set or clear the label shown for an SMS number").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Cd("label",{numberId:e,label:t,...n}));S(YMe,{notes:["Run without a label to clear the current label.","Use `sequenzy sms settings` to find each number ID."],examples:['sequenzy sms label num_abc123 "Marketing"',"sequenzy sms label num_abc123"]});var ZMe=su.command("update <number-id>").description("Update an SMS number's label, brand prefix override, and/or link shortening").option("--label <label>","Label tag; pass an empty string to clear").option("--brand-prefix <prefix>","Per-number brand prefix override; empty string clears back to the account-wide prefix").option("--link-shortening <on|off>","on (default) turns links into click-tracked short links; off sends links from this number exactly as written").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Cd("update",{numberId:e,...t}));S(ZMe,{notes:["Only the flags you pass are changed; omitted fields keep their value.",'Messages go out as "{prefix}: your message" - the number override wins over the account-wide prefix set in Settings > SMS.',"--link-shortening off keeps your own tracking links exactly as written; SMS clicks from that number are then not tracked and long links can add segments. Applies to messages prepared after the change.","Use `sequenzy sms settings` to find each number ID."],examples:['sequenzy sms update num_abc123 --label "Support" --brand-prefix "Acme Support"','sequenzy sms update num_abc123 --brand-prefix ""',"sequenzy sms update num_abc123 --link-shortening off"]});var XMe=su.command("send-test <phone>").description("Send a test SMS to a phone number").option("-t, --text <text>","Plain-text message body").option("--image-url <url...>","Publicly reachable MMS image URL (repeat for up to 2)").option("--from-number <number-id>","Active SMS number ID to send from (defaults to the oldest active number)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Cd("send-test",{phone:e,...t}));S(XMe,{notes:["Sends a real text and charges credits. Limited to 100 test sends per company per rolling 24 hours; bypasses quiet hours; excluded from step stats.","Requires the SMS add-on with a verified number - check `sequenzy sms settings` first.","Use --from-number with an active number ID from `sequenzy sms settings` to test a specific number."],examples:['sequenzy sms send-test +15550100123 --text "Test from Sequenzy"','sequenzy sms send-test +15550100123 --text "Test" --from-number num_abc123']});var eje=su.command("usage").description("Show per-number SMS usage (sends, credits, last sent)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Cd("usage",e));S(eje,{notes:["Totals exclude test sends; test sends are counted separately per number."],examples:["sequenzy sms usage","sequenzy sms usage --json"]});var tje=su.command("release <number-id>").description("Release an SMS number back to the carrier (irreversible)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Cd("release",{numberId:e,...t}));S(tje,{notes:["Releasing is irreversible: the number is handed back to the carrier and cannot be recovered.","Released numbers stop counting toward the workspace number limit, freeing a slot for a new purchase.","Use `sequenzy sms settings` to find each number ID."],examples:["sequenzy sms release num_abc123 --yes"]});var ms=Ve.command("push").description("Web and mobile push notifications: settings, devices, tests, campaigns and iOS Live Activities").action(()=>ms.help());S(ms,{notes:["Web push uses VAPID keys Sequenzy generates; iOS uses your APNs .p8 key; Android uses your Firebase service account.",'Add push steps to sequences with type: "push" in sequences create --steps-* or update --insert-steps-*.'],examples:["sequenzy push settings","sequenzy push web --enable",'sequenzy push send-test --email you@example.com --title "Hello" --body "It works"']});var nje=ms.command("settings").description("Show web push, APNs and Firebase status plus active device counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("settings",e));S(nje,{examples:["sequenzy push settings --json"]});var rje=ms.command("web").description("Enable or disable web push and set the default notification icon").option("--enable","Turn web push on (generates VAPID keys the first time)").option("--disable","Turn web push off (keys are kept)").option("--icon <url>","Default https icon URL; pass an empty string to clear").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("web",e));S(rje,{notes:['Your site must serve /sequenzy-sw.js containing importScripts("https://api.sequenzy.com/sequenzy-sw.js") and call sequenzy.subscribeToPush() from a click.'],examples:["sequenzy push web --enable","sequenzy push web --icon https://example.com/icon-192.png"]});var rT=ms.command("ios").description("Manage APNs credentials for iOS push").action(()=>rT.help()),ije=rT.command("set").description("Save an APNs auth key (.p8)").requiredOption("--key-file <path>","Path to the AuthKey_XXXXXXXXXX.p8 file").requiredOption("--key-id <id>","10-character APNs key ID").requiredOption("--team-id <id>","10-character Apple team ID").requiredOption("--bundle-id <id>","App bundle ID, e.g. com.example.app").option("--environment <env>","production (default) or sandbox").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("ios-set",e));S(ije,{examples:["sequenzy push ios set --key-file AuthKey_ABC123DEFG.p8 --key-id ABC123DEFG --team-id DEF123GHIJ --bundle-id com.example.app"]});rT.command("remove").description("Remove APNs credentials").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("ios-remove",e));var iT=ms.command("android").description("Manage Firebase credentials for Android push").action(()=>iT.help()),oje=iT.command("set").description("Save a Firebase service account key").requiredOption("--service-account-file <path>","Path to the service account JSON from Firebase project settings").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("android-set",e));S(oje,{notes:["The service account needs the Firebase Cloud Messaging API Admin role."],examples:["sequenzy push android set --service-account-file ./firebase-key.json"]});iT.command("remove").description("Remove Firebase credentials").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("android-remove",e));var gC=ms.command("devices").description("List, register and remove push devices").action(()=>gC.help());gC.command("list").description("List push devices, optionally for one contact").option("--email <email>","Only devices of this contact").option("--subscriber-id <id>","Only devices of this subscriber").option("--platform <platform>","web, ios or android").option("--status <status>","active, invalid or unsubscribed").option("--limit <n>","Page size (max 100)").option("--cursor <id>","Continue after this device ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("devices-list",e));var sje=gC.command("register").description("Register a device token (usually done by your app backend)").requiredOption("--platform <platform>","ios, android or web").requiredOption("--token <token>","APNs device token, FCM registration token, or web subscription endpoint").option("--p256dh <key>","Web only: keys.p256dh from PushSubscription").option("--auth <secret>","Web only: keys.auth from PushSubscription").option("--email <email>","Contact to link (created quietly if new)").option("--subscriber-id <id>","Existing subscriber to link").option("--device-name <name>","Device label shown in the dashboard").option("--app-version <version>","App version").option("--os-version <version>","OS version").option("--locale <locale>","Device locale, e.g. en-US").option("--timezone <tz>","IANA timezone").option("--permission <status>","iOS/Android notification permission: granted, provisional, ephemeral, denied or not_determined").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("devices-register",e));S(sje,{examples:["sequenzy push devices register --platform ios --token 8f2c...e1 --email jane@example.com"]});gC.command("remove <device-id>").description("Unsubscribe a device").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("devices-remove",{deviceId:e,...t}));var au=ms.command("imports").description("Move iOS and Android push devices from OneSignal, Braze, Customer.io or a CSV").action(()=>au.help());S(au,{notes:["Imported APNs/FCM tokens only work with the bundle ID, Apple team and Firebase project the app registered them with; add those credentials with `sequenzy push ios set` / `push android set` first.","Web push subscriptions are never imported: they are tied to the previous provider's VAPID keys.","Opted-out devices are kept as unsubscribed. New contacts are created for opted-in devices without sequences or list joins; a device with only an external ID gets a push-only contact (no email or phone)."],examples:["sequenzy push imports preflight --source onesignal","sequenzy push imports start --source onesignal --app-id 1b2c3d4e-... --api-key-file onesignal.key --wait","sequenzy push imports start --source braze --braze-endpoint rest.iad-01.braze.com --segment all-users-segment-id --api-key-file braze.key","sequenzy push imports start --source customer_io --region eu --segment 12 --api-key-file cio.key","sequenzy push imports start --source csv --file devices.csv --yes"]});au.command("preflight").description("Check push settings before importing (APNs/Firebase set up?)").requiredOption("--source <source>","onesignal, braze, customer_io or csv").option("--platforms <platform...>","ios and/or android (default both)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>id("preflight",e));au.command("start").description("Create a push import, show its warnings, then start it").requiredOption("--source <source>","onesignal, braze, customer_io or csv").option("--api-key <key>","Source API key (prefer --api-key-file)").option("--api-key-file <path>","File containing the source API key").option("--app-id <id>","OneSignal App ID").option("--braze-endpoint <url>","Braze REST endpoint, e.g. rest.iad-01.braze.com").option("--segment <id>","Braze segment API identifier or Customer.io segment ID").option("--region <region>","Customer.io account region: us or eu","us").option("--file <path>","CSV file (source csv)").option("--platforms <platform...>","ios and/or android (default both)").option("--app-ids <id...>","Only devices of these source apps").option("--no-attributes","Do not copy tags/attributes onto contacts").option("--wait","Wait until the import finishes; exits 1 if it fails or stalls").option("-y, --yes","Start without the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>id("start",e));au.command("list").description("Recent push imports with progress and counts").option("--limit <n>","How many (max 50)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>id("list",e));au.command("get <import-id>").description("Show one push import").option("--wait","Wait until the import finishes; exits 1 if it fails or stalls").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>id("get",{importId:e,...t}));au.command("resume <import-id>").description("Start a draft, or resume a failed or stalled import").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>id("resume",{importId:e,...t}));au.command("cancel <import-id>").description("Stop an import (already imported devices stay)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>id("cancel",{importId:e,...t}));var aje=ms.command("send-test").description("Send a test push to one device or to a contact's devices").option("--device <id>","Device ID from `sequenzy push devices list`").option("--email <email>","Send to every active device of this contact").option("--subscriber-id <id>","Send to every active device of this subscriber").option("--title <title>","Notification title").option("--body <body>","Notification message").option("--url <url>","https link or app deep link opened on tap").option("--image-url <url>","https image").option("--icon-url <url>","https icon (web)").option("--platforms <platform...>","Limit to web, ios and/or android").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("send-test",{...e,deviceId:e.device}));S(aje,{notes:["Limited to 200 test pushes per company per rolling 24 hours. Tests are excluded from stats."],examples:['sequenzy push send-test --email you@example.com --title "Test" --body "Hello from Sequenzy"']});var jm=ms.command("live-activities").description("Start, update and end iOS Live Activities and Android Live Updates, and list their tokens").action(()=>jm.help());S(jm,{notes:["Your iOS app reports ActivityKit tokens through the Sequenzy SDK (Sequenzy.observeLiveActivities). Push-to-start needs iOS 17.2+.","Android apps report Live Update tokens with SequenzyLiveUpdates.observe and the same type name; one start, update or end reaches both platforms whose push credentials are set (APNs for iOS, FCM for Android). Android 16 shows them promoted (status bar chip, top of the shade); earlier versions show an ongoing notification updated in place.","contentState and attributes are your Swift ContentState and attributes as JSON. Date fields in contentState decode as seconds since 2001-01-01 unless your struct uses a custom decoder.","Start, update and end go to one contact (--email or --subscriber-id); start can instead go to a segment, list or tag (--segment, --list, --tag), and update and end then reach every device running it with --broadcast. They need a key with transactional:send, plus campaigns:send for an audience or a broadcast; list needs subscribers:read. End needs the final content state."],examples:["sequenzy push live-activities list --email jane@example.com",`sequenzy push live-activities start --email jane@example.com --activity-type DeliveryAttributes --activity-id order-1234 --attributes-json '{"orderNumber":"1234"}' --content-state-json '{"status":"preparing","minutesAway":30}' --alert-title "Order confirmed"`,`sequenzy push live-activities update --email jane@example.com --activity-id order-1234 --content-state-json '{"status":"out_for_delivery","minutesAway":8}' --priority low`,`sequenzy push live-activities end --email jane@example.com --activity-id order-1234 --content-state-json '{"status":"delivered","minutesAway":0}' --dismissal-date 2026-10-20T18:00:00Z`,`sequenzy push live-activities start --tag lakers-fan --activity-type GameAttributes --activity-id game-5521 --attributes-json '{"home":"Lakers","away":"Celtics"}' --content-state-json '{"home":0,"away":0}' --alert-title "Tip-off"`,`sequenzy push live-activities update --broadcast --activity-id game-5521 --content-state-json '{"home":24,"away":21}'`]});jm.command("list").description("Summary per activity type plus push-to-start and update tokens").option("--email <email>","Only tokens of this contact").option("--subscriber-id <id>","Only tokens of this subscriber").option("--platform <platform>","ios (Live Activities) or android (Live Updates)").option("--activity-type <type>","ActivityAttributes type name").option("--activity-id <id>","One activity's update tokens").option("--kind <kind>","push_to_start or update").option("--status <status>","active, ended or invalid").option("--limit <n>","Page size (max 100)").option("--cursor <id>","Continue after this token ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Gg("list",e));var oT=(e)=>e.option("--content-state-json <json>","ContentState as a JSON object").option("--content-state-file <path>","Read ContentState JSON from a file").option("--alert-title <title>","Alert title").option("--alert-body <body>","Alert message").option("--alert-sound <sound>",'Sound name, e.g. "default"').option("--stale-date <date>","Unix seconds or ISO date when it goes stale").option("--relevance-score <n>","Orders concurrent activities; higher shows first").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON");oT(jm.command("start").description("Start an activity remotely on a contact's devices, or for a segment, list or tag (iOS 17.2+ push-to-start, and Android apps observing the type)").requiredOption("--activity-type <type>","Swift ActivityAttributes type name (and the type your Android app observes), e.g. DeliveryAttributes").requiredOption("--activity-id <id>","Your id for this activity; update and end use it").option("--email <email>","Contact whose devices start it").option("--subscriber-id <id>","Subscriber whose devices start it").option("--segment <id>","Start it on the devices of every contact in this segment (needs campaigns:send)").option("--list <id>","Start it for every contact in this list (needs campaigns:send)").option("--tag <tag>","Start it for every contact with this tag (needs campaigns:send)").option("--attributes-json <json>","Static attributes as a JSON object, with every field of the app's attributes struct (iOS drops a start that does not decode)").option("--attributes-file <path>","Read attributes JSON from a file")).action((e)=>Gg("start",e));oT(jm.command("update").description("Update every running copy of a contact's activity, or with --broadcast every signed-in device's").requiredOption("--activity-id <id>","Activity to update").option("--email <email>","Contact whose activity it is").option("--subscriber-id <id>","Subscriber whose activity it is").option("--broadcast","Every signed-in device running this activity id, e.g. one started for a segment (needs campaigns:send)").option("--priority <priority>","high (default) or low; low is not counted against Apple's update budget. Updates with an alert always go at high priority")).action((e)=>Gg("update",e));oT(jm.command("end").description("End a contact's activity on every device running it, or with --broadcast on every signed-in device").requiredOption("--activity-id <id>","Activity to end").option("--email <email>","Contact whose activity it is").option("--subscriber-id <id>","Subscriber whose activity it is").option("--broadcast","Every signed-in device running this activity id (needs campaigns:send)").option("--priority <priority>","high (default) or low; ends with an alert always go at high priority").option("--dismissal-date <date>","Unix seconds or ISO date to remove it; a past date removes it now (default: iOS and Android keep it up to 4 hours)")).action((e)=>Gg("end",e));var cje=ms.command("translate").description("Translate a push title and message into your other languages with AI (nothing is saved)").option("--title <title>","Main-language title").option("--body <body>","Main-language message").option("--localizations-json <json>","Existing versions to keep and merge (JSON array)").option("--localizations-file <path>","Read existing versions from a file").option("--locales <codes...>","Only these languages").option("--overwrite","Retranslate versions a person wrote too").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("translate",e));S(cje,{notes:["Use the --json output's localizations on a sequence push step (sequences update with updateNodes changes.localizations) or a campaign (--localizations-json)."],examples:['sequenzy push translate --title "Your order shipped" --body "Track it in the app, {{FIRST_NAME|friend}}" --json']});var fs=ms.command("campaigns").description("Create, send and inspect push campaigns").action(()=>fs.help()),g5=(e)=>e.option("--name <name>","Campaign name").option("--title <title>","Notification title").option("--body <body>","Notification message").option("--url <url>","https link or app deep link; empty string clears").option("--image-url <url>","https image; empty string clears").option("--icon-url <url>","https icon; empty string clears").option("--platforms <platform...>","Limit to web, ios and/or android").option("--localizations-json <json>",`Versions in other languages as a JSON array, e.g. '[{"locale":"de","title":"...","body":"..."}]'; replaces every version ([] removes them)`).option("--localizations-file <path>","Read the localizations JSON from a file").option("--all-contacts","Target every contact with a device").option("--segment <id>","Target a segment").option("--lists <ids...>","Target one or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON");fs.command("list").description("List push campaigns").option("--status <status>","draft, scheduled, sending, sent or cancelled").option("--limit <n>","Page size (max 100)").option("--offset <n>","Skip this many campaigns").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("campaigns-list",e));var lje=g5(fs.command("create").description("Create a push campaign draft")).action((e)=>tr("campaigns-create",e));S(lje,{examples:['sequenzy push campaigns create --name "Flash sale" --title "24h sale" --body "30% off everything" --url https://example.com/sale --all-contacts']});var A5=(e)=>e.option("--in-recipient-timezone","Deliver the scheduled wall-clock time in each contact's own timezone (device timezone, else the contact's). Needs --scheduled-timezone and a schedule.").option("--no-in-recipient-timezone","Turn off local-time delivery and send at the scheduled instant").option("--scheduled-timezone <zone>","IANA zone the scheduled wall-clock time refers to, for example America/New_York").option("--send-time-optimization","Send at each contact's most engaged hour: push clicks, then email opens, then your usual push hour").option("--disable-send-time-optimization","Turn off send-time optimization").option("--send-time-window-hours <hours>","Hours after the start in which optimized sends may land (1-24, default 12)"),uje=A5(g5(fs.command("update <campaign-id>").description("Update a draft or scheduled push campaign"))).action((e,t)=>tr("campaigns-update",{campaignId:e,...t}));S(uje,{notes:["Timing flags save on drafts only; reschedule a scheduled campaign with push campaigns send to change its timing."],examples:["sequenzy push campaigns update cmp_123 --send-time-optimization --send-time-window-hours 8"]});fs.command("get <campaign-id>").description("Show a push campaign and its stats").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-get",{campaignId:e,...t}));var dje=A5(fs.command("send <campaign-id>").description("Send a push campaign now or schedule it")).option("--schedule <iso-time>","Future ISO 8601 time to schedule instead").option("-y, --yes","Skip the confirmation prompt for immediate sends").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-send",{campaignId:e,...t}));S(dje,{notes:["Only contacts with an active device on a set-up platform receive the push.","With --in-recipient-timezone, contacts get --schedule's wall-clock time in their own timezone; zones whose time has already passed get it right away, and contacts with no known timezone get it at --schedule itself. The campaign stays sending until the last zone is delivered (up to about 26 hours).","With --send-time-optimization, each contact gets the push at their most engaged hour within --send-time-window-hours of the start (or of --schedule)."],examples:["sequenzy push campaigns send cmp_123 --yes","sequenzy push campaigns send cmp_123 --schedule 2026-10-01T15:00:00Z",'sequenzy push campaigns send cmp_123 --schedule "2026-10-01T09:00:00-04:00" --in-recipient-timezone --scheduled-timezone America/New_York',"sequenzy push campaigns send cmp_123 --yes --send-time-optimization --send-time-window-hours 8"]});fs.command("unschedule <campaign-id>").description("Move a scheduled push campaign back to draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-unschedule",{campaignId:e,...t}));fs.command("cancel <campaign-id>").description("Stop a scheduled or sending push campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-cancel",{campaignId:e,...t}));fs.command("duplicate <campaign-id>").description("Copy a push campaign into a new draft").option("--name <name>","Name for the copy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-duplicate",{campaignId:e,...t}));var pje=fs.command("estimate").description("Count contacts in an audience who have an active push device").option("--all-contacts","Every contact with a device").option("--segment <id>","A segment").option("--lists <ids...>","One or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("--platforms <platform...>","Limit to web, ios and/or android").option("--timing-coverage","Also count contacts with a known timezone and with enough push taps for send-time optimization").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("campaigns-estimate",e));S(pje,{examples:["sequenzy push campaigns estimate --segment seg_123 --platforms ios","sequenzy push campaigns estimate --all-contacts --timing-coverage"]});var mje=fs.command("translate <campaign-id>").description("Translate a draft or scheduled push campaign into your other languages with AI and save it").option("--locales <codes...>","Only these languages (default: every language in Settings > Localization except the main one)").option("--overwrite","Retranslate them all, replacing versions a person wrote").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-translate",{campaignId:e,...t}));S(mje,{notes:["Each contact gets the version for their language attribute, else their device language, else your fallback language.","By default only languages without a version and outdated AI versions are translated; versions a person wrote are kept."],examples:["sequenzy push campaigns translate cmp_123","sequenzy push campaigns translate cmp_123 --locales de fr --overwrite"]});fs.command("stats <campaign-id>").description("Show delivery and click stats for a push campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-stats",{campaignId:e,...t}));var Hs=Ve.command("in-app").description("In-app messages and content cards: campaigns, a contact's feed, engagement reports, step stats").action(()=>Hs.help());S(Hs,{notes:['Create items with in_app sequence steps: type: "in_app" in sequences create --steps-* or update --insert-steps-* (kind message|card|placement, format modal|banner|fullscreen|html).','Placements are slots in your app that show in-app content inline: define them with `in-app placements create`, then target one from a step with kind "placement", placement "<key>", an optional priority (high, medium or low) and an optional layout (card, banner or hero).',"Send one to an audience as a campaign with `in-app campaigns`: each contact in the audience gets it the next time their app fetches its feed while the campaign is live.","Custom HTML messages (surveys, Braze custom HTML): check the document with `in-app html validate`, then put it on an in-app step with `in-app html set`. Braze Liquid such as {{${email_address}}} is converted to merge tags.","Your app fetches the feed with GET /api/v1/in-app/messages (API key, from your backend) or POST /api/v1/in-app/feed (publishable key + identity token, from the browser), renders it, and reports displayed/clicked/dismissed/read."],examples:["sequenzy in-app list --email ava@example.com",'sequenzy in-app campaigns create --name "New dashboards" --title "New dashboards" --body "Take a look" --segment seg_123',"sequenzy in-app list --external-id user_42 --kind card --status all","sequenzy in-app event msg_123 --type dismissed","sequenzy in-app stats node_123","sequenzy in-app templates",'sequenzy in-app write --brief "Trial ends in 3 days; nudge them to upgrade"',"sequenzy in-app html validate --file survey.html","sequenzy in-app html set seq_123 node_123 --file survey.html --no-close-button",'sequenzy in-app placements create --key home_hero --name "Home hero" --width 360 --height 160',"sequenzy in-app placements content --email ava@example.com --placements home_hero,checkout_upsell"]});var gs=Hs.command("campaigns").description("Send an in-app message or card to an audience as a campaign").action(()=>gs.help());S(gs,{notes:["Launching writes nothing per contact: each contact in the audience gets the message the first time their app fetches its feed while the campaign is live, including people who join the audience later. Old app versions that can't draw the message (format or button action) don't use it up.","The message takes the same fields as an in-app sequence step. Flags cover the common ones; --message-json/--message-file take the full config (style, data, pinned, expiresAfterDays, ...). Updates merge over the stored message.","Priority (high, medium, low) orders waiting messages; --ends-at stops new deliveries and removes it from every feed that still has it at that time."]});var h5=(e)=>e.option("--name <name>","Campaign name").option("--kind <kind>","message (default) or card").option("--format <format>","modal, banner, fullscreen or html").option("--position <position>","Banners: top or bottom. Modals: bottom or center").option("--eyebrow <text>","Short line above the title").option("--title <title>","Title").option("--body <body>","Message").option("--image-url <url>","https image; empty string clears").option("--button-label <label>","One button (replaces the buttons)").option("--button-url <url>","Link the button opens; without it the button closes the message").option("--html-file <path>","Custom HTML document (sets format html)").option("--message-json <json>","Full in-app message config JSON").option("--message-file <path>","Full in-app message config JSON file").option("--priority <priority>","high, medium or low").option("--ends-at <iso-time>","When the campaign ends; empty string removes it").option("--all-contacts","Target every contact").option("--segment <id>","Target a segment").option("--lists <ids...>","Target one or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON");gs.command("list").description("List in-app campaigns").option("--status <status>","draft, scheduled, sent (live or ended) or cancelled (stopped)").option("--limit <n>","Page size (max 100)").option("--offset <n>","Skip this many campaigns").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Fs("list",e));var fje=h5(gs.command("create").description("Create an in-app campaign draft")).action((e)=>Fs("create",e));S(fje,{examples:['sequenzy in-app campaigns create --name "New dashboards" --title "Hi {{firstName}}" --body "Dashboards are here" --button-label "Take a look" --button-url myapp://dashboards --segment seg_123','sequenzy in-app campaigns create --name "Tip" --kind card --title "Try shortcuts" --lists list_1 --priority low --ends-at 2026-12-01T00:00:00Z']});h5(gs.command("update <campaign-id>").description("Update a draft or scheduled in-app campaign")).action((e,t)=>Fs("update",{campaignId:e,...t}));gs.command("get <campaign-id>").description("Show an in-app campaign and its stats").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("get",{campaignId:e,...t}));var gje=gs.command("send <campaign-id>").description("Launch an in-app campaign now or schedule it").option("--schedule <iso-time>","Future ISO 8601 time to go live instead").option("-y, --yes","Skip the confirmation prompt for immediate launches").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("send",{campaignId:e,...t}));S(gje,{examples:["sequenzy in-app campaigns send cmp_123 --yes","sequenzy in-app campaigns send cmp_123 --schedule 2026-12-01T09:00:00Z"]});gs.command("unschedule <campaign-id>").description("Move a scheduled in-app campaign back to draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("unschedule",{campaignId:e,...t}));gs.command("stop <campaign-id>").description("Stop a scheduled or live in-app campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("stop",{campaignId:e,...t}));gs.command("duplicate <campaign-id>").description("Copy an in-app campaign into a new draft").option("--name <name>","Name for the copy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("duplicate",{campaignId:e,...t}));gs.command("estimate").description("Count contacts who match an audience now").option("--all-contacts","Every contact").option("--segment <id>","A segment").option("--lists <ids...>","One or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Fs("estimate",e));gs.command("stats <campaign-id>").description("Show reach, views, clicks, button results and dismissals").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("stats",{campaignId:e,...t}));Hs.command("list").description("List a contact's open in-app messages and cards (or history)").option("--email <email>","Contact email").option("--external-id <id>","Contact external ID").option("--subscriber-id <id>","Subscriber ID").option("--kind <kind>","message, card or placement").option("--status <status>","open (default: what the app should show now) or all (history)").option("--limit <n>","Maximum items (max 100)").option("--actions <actions>","Open items: comma-separated button actions your app handles beyond open_url and dismiss (request_push_permission)").option("--formats <list>","Comma-separated formats you render, e.g. modal,banner,fullscreen,html. Open feeds include custom HTML messages only when html is listed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ec("list",e));Hs.command("event").description("Record that an item was displayed, clicked, dismissed or read").argument("<messageId>","In-app message ID").requiredOption("--type <type>","displayed, clicked, dismissed or read").option("--push-permission <status>","clicked on a push primer: the permission your app read after asking (granted, provisional, ephemeral, denied or not_determined)").option("--button-id <id>","Clicks in custom HTML messages: which control was clicked").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ec("event",{messageId:e,...t}));Hs.command("delete").description("Delete an in-app message or card from the contact's feed").argument("<messageId>","In-app message ID").option("-y, --yes","Skip confirmation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ec("delete",{messageId:e,...t}));Hs.command("stats").description("Created, displayed, clicked and dismissed counts for a step").argument("<stepId>","In-app sequence step (node) ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ec("stats",{stepId:e,...t}));Hs.command("templates").description("List starting points for in-app sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including each template's step config").action((e)=>Ec("templates",e));Hs.command("write").description("Write in-app copy (eyebrow, title, message, button text) from a brief with AI").requiredOption("--brief <text>","What the message should say (3-1000 characters)").option("--kind <kind>","message (default), card or placement").option("--format <format>","modal (default), banner or fullscreen").option("--image","The step shows an image").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ec("write",e));var sT=Hs.command("html").description("Custom HTML in-app messages: check a document and put it on an in-app step").action(()=>sT.help());sT.command("validate").description("Check an HTML document: size, Braze Liquid conversions, script hosts, warnings and errors (exits 1 when not valid)").requiredOption("--file <path>","HTML file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ec("html-validate",e));sT.command("set").description("Make an in-app sequence step a custom HTML message showing this document").argument("<sequenceId>","Sequence ID").argument("<stepId>","In-app step (node) ID from sequences get").requiredOption("--file <path>","HTML file (up to 100 KB)").option("--title <text>","Accessible name of the message").option("--close-button","Draw a close button over the message").option("--no-close-button","Don't draw a close button (when the HTML closes itself); without either flag the step keeps its setting").option("--confirm-live-change","Required when the sequence is active: future recipients get the new HTML").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Ec("html-set",{sequenceId:e,stepId:t,...n}));var cu=Hs.command("placements").description("Placements: slots in your app that show in-app content inline (define, edit, stats, a contact's content)").action(()=>cu.help());S(cu,{notes:["Your app shows, for each placement key it asks for, the contact's highest-priority open placement item, or nothing (the slot collapses). The mobile SDKs and the web SDK have views for this.","Keys never change after creation: app code uses them. Deleting a placement collapses its slots; steps that target it skip contacts until it exists again."],examples:["sequenzy in-app placements list",'sequenzy in-app placements create --key home_hero --name "Home hero" --width 360 --height 160',"sequenzy in-app placements update home_hero --height none","sequenzy in-app placements content --external-id user_42 --placements home_hero","sequenzy in-app placements delete home_hero --yes"]});cu.command("list").description("List placements with live, shown and clicked counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>ed("list",e));cu.command("get").description("Show one placement and its counts").argument("<key>","Placement key").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ed("get",{key:e,...t}));cu.command("create").description("Create a placement").requiredOption("--key <key>","What your app passes to the SDK: lowercase letters, numbers, dots, dashes, underscores (never changes)").requiredOption("--name <name>","Name shown in the dashboard").option("--description <text>","Where it sits in your app").option("--width <points>","Width hint in points").option("--height <points>","Height hint in points").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>ed("create",e));cu.command("update").description("Rename a placement or change its description or size hints").argument("<key>","Placement key").option("--name <name>","New name").option("--description <text>","New description").option("--width <points>",'Width hint in points, or "none" to clear').option("--height <points>",'Height hint in points, or "none" to clear').option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ed("update",{key:e,...t}));cu.command("delete").description("Delete a placement; its slots collapse in your app").argument("<key>","Placement key").option("-y, --yes","Skip confirmation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ed("delete",{key:e,...t}));cu.command("content").description("What each placement shows one contact now").requiredOption("--placements <keys>","Comma-separated placement keys (up to 10)").option("--email <email>","Contact email").option("--external-id <id>","Contact external ID").option("--subscriber-id <id>","Subscriber ID").option("--actions <actions>","Comma-separated button actions your app handles beyond open_url and dismiss (request_push_permission)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>ed("content",e));h3(Ve);var AC=Ve.command("email-design-system").description("Manage the visual identity every AI-generated email renders inside").action(()=>AC.help());S(AC,{notes:["The design system fixes the company's visual grammar (kickers, alignment, buttons, dividers, density, openers) and the composition spine that anchors email structure.","It is stored as the company's design direction text (emailDesignPrompt): adjustments rewrite that text, and free prose in it is preserved. Tokens the text does not state derive from brand context."],examples:["sequenzy email-design-system get","sequenzy email-design-system update --button-shape pill --spine editorial","sequenzy email-design-system update --reset"]});var Aje=AC.command("get").description("Show the effective email design system").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>kx("get",e));S(Aje,{notes:["The JSON output includes isDefault: true while the identity is still derived from brand context."],examples:["sequenzy email-design-system get --json"]});var hje=AC.command("update").description("Adjust the email design system (partial update) or reset it").option("--kicker-style <style>","chip | letterspaced | none").option("--title-alignment <alignment>","left | center").option("--button-shape <shape>","rounded | pill").option("--divider-style <style>","line | space").option("--density <density>","airy | compact").option("--opener-treatments <treatments>","Comma-separated: hero-image,hero-color,header-hero,editorial-masthead,title-led").option("--spine <spine>","hero-led | editorial | product-spec").option("--reset","Clear the design direction text; return to derived defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>kx("update",e));S(hje,{notes:["Only the passed flags change; everything else keeps its current value.","Adjustments apply to every future AI email generation and sequence enrichment.","The change is written into the design direction text; custom prose in that text is preserved below the new identity. For free-prose edits use 'companies update --email-design-prompt'."],examples:["sequenzy email-design-system update --spine editorial --kicker-style letterspaced","sequenzy email-design-system update --opener-treatments editorial-masthead,title-led","sequenzy email-design-system update --reset"]});var hC=Ve.command("design-md").description("Read and edit design.md, the company's email design brief in Markdown").action(()=>hC.help());S(hC,{notes:["design.md holds YAML frontmatter with the exact values AI-generated emails use (logo, colors, fonts, buttons, corner radius, layout tokens), then ## Voice and ## Design direction prose. ## Reference email is read-only.","Only values you change are saved. Removing a key or section leaves it unchanged; an empty section clears it."],examples:["sequenzy design-md get > design.md","sequenzy design-md update design.md --dry-run","sequenzy design-md update design.md --expected-version <version>"]});var yje=hC.command("get").alias("pull").description("Print design.md (the version is printed to stderr)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON with markdown, version and designSystem").action((e)=>Dx("get",e));S(yje,{examples:["sequenzy design-md get > design.md","sequenzy design-md pull --json"]});var bje=hC.command("update").alias("push").description("Save an edited design.md from a file, or stdin with -").argument("[file]","Path to design.md, or - for stdin","-").option("--dry-run","Validate and list changes without saving").option("--expected-version <version>","Fail instead of overwriting if design.md changed since this version").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Dx("update",{file:e,...t}));S(bje,{notes:["Errors name the line to fix. Unknown keys and edits to the read-only Reference email section are reported as warnings.","A value left exactly as 'get' printed it is not saved; a changed value is pinned."],examples:["sequenzy design-md update design.md --dry-run","cat design.md | sequenzy design-md push -"]});var aT=Ve.command("images").description("Work with images in the company's media library").action(()=>aT.help());S(aT,{examples:["sequenzy images crop https://images.sequenzy.com/email-images/.../team.jpg --aspect 16:9"]});var vje=aT.command("crop").description("Crop a library image (or a Pexels/Unsplash photo) into a new hosted image").argument("<url>","Hosted URL of the original image").option("--aspect <ratio>","Largest centered crop of this shape, e.g. 16:9, 1:1, 4:5 or 1.91:1").option("--focus-x <fraction>","With --aspect: horizontal center, 0-1").option("--focus-y <fraction>","With --aspect: vertical center, 0-1").option("--x <fraction>","Left edge of the area to keep, 0-1").option("--y <fraction>","Top edge of the area to keep, 0-1").option("--width <fraction>","Width of the area to keep, 0-1").option("--height <fraction>","Height of the area to keep, 0-1").option("--alt <text>","Alt text stored with the cropped image").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON with asset, crop and source size").action((e,t)=>X3(e,t));S(vje,{notes:["The crop is saved as a new image, so every inbox, Gmail and Outlook included, shows exactly that area. The original stays in the library.","Fractions are of the upright image. Retrying the same crop returns the same image.","Put the printed src and crop on an image block. To change a crop, crop the original (crop.sourceSrc) again."],examples:["sequenzy images crop https://images.sequenzy.com/email-images/.../team.jpg --aspect 1:1 --focus-x 0.3","sequenzy images crop https://images.sequenzy.com/email-images/.../team.jpg --x 0 --y 0.2 --width 1 --height 0.5 --json"]});var yC=Ve.command("sync-rules").description("Manage automatic tag changes applied when events fire").action(()=>yC.help());S(yC,{notes:["Sync rules map events to tag changes, e.g. an order-placed event adding a customer tag.","Rules can carry conditions: required/excluded subscriber tags, and a product match for commerce events (tag buyers by product tag, collection, type, or vendor)."],examples:["sequenzy sync-rules get","sequenzy sync-rules update --rules-file ./sync-rules.json","sequenzy sync-rules update --reset"]});var Eje=yC.command("get").description("Show the effective sync rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>FR("get",e));S(Eje,{notes:["Shows the platform defaults until the company saves custom rules; the JSON output includes isDefault."],examples:["sequenzy sync-rules get --json"]});var Ije=yC.command("update").description("Replace the sync rules or reset them to the defaults").option("--rules-json <json>","Inline JSON array with the full rule set").option("--rules-file <file>","Path to a JSON file with the full rule set").option("--reset","Reset the company to the platform default rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>FR("update",e));S(Ije,{notes:["This replaces the FULL rule set - fetch with 'sync-rules get --json', edit, then update.",'Each rule: {"triggerEvent":"...","actions":{"addTags":[...],"removeTags":[...]},"conditions":{...}}.'],examples:["sequenzy sync-rules update --rules-file ./sync-rules.json",`sequenzy sync-rules update --rules-json '[{"triggerEvent":"ecommerce.order_placed","actions":{"addTags":["vinyl-collector"],"removeTags":[]},"conditions":{"purchasedProduct":{"tags":["Vinyl"]}}}]'`,"sequenzy sync-rules update --reset"]});var zm=Ve.command("generate").description("Generate email and SMS content with AI").action(()=>zm.help());S(zm,{notes:["Generated email and SMS content is returned as draft content. Review it before sending.","`generate sequence` is deprecated and persists a disabled draft. Use `sequences create <name> --trigger <trigger> --goal <goal>` instead.","Use --json when another tool or agent should parse the generated output."],examples:['sequenzy generate email "Welcome a new user to our analytics product"','sequenzy generate subjects "April product launch" --count 8','sequenzy generate sms "Cart reminder with a free-shipping hook" --count 3']});zm.command("email <prompt>").description("Generate email blocks from a prompt").option("-s, --style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("-t, --tone <tone>","Tone: professional, casual, friendly").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("email",{prompt:e,...t}));zm.command("sequence <goal>").description("[DEPRECATED] Persist a disabled AI sequence draft; use `sequences create`").option("--name <name>","Optional sequence name; defaults to the goal").option("--list-id <id>","Optional list ID for the contact_added trigger").option("-c, --count <number>","Number of emails (1-10)","5").option("-d, --days <number>","Duration in days","14").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("sequence",{goal:e,...t}));zm.command("subjects <topic>").description("Generate A/B subject line variants").option("-c, --count <number>","Number of variants","5").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("subjects",{topic:e,...t}));var Cje=zm.command("sms <prompt>").description("Generate SMS message variants from a prompt").option("-c, --count <number>","Number of variants (1-10)","3").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("sms",{prompt:e,...t}));S(Cje,{notes:["Messages are plain text with encoding and segment counts; use them as the text of an SMS sequence step.","Opt-out footers and the brand prefix are added automatically at send time - never include them in the message.","Check `sequenzy sms settings` to confirm the SMS add-on is ready before enabling SMS sequences."],examples:['sequenzy generate sms "Flash sale ends tonight" --count 5 --json']});var xd=Ve.command("web-tracking").description("Manage publishable keys for the browser tracking SDK and mobile SDKs").action(()=>xd.help());S(xd,{notes:["These keys are publishable: they ship in your site's page source, so they are readable by anyone. They authorize storefront events only, never the rest of the API.","Restrict every key with --origins for websites and --app-ids for iOS and Android apps. A key with neither lets any site or app send events with it.","Shopify stores do not need a key - connect the integration and enable the pixel instead (`sequenzy integrations enable-pixel`).","Anonymous visits are buffered and replayed after `sequenzy.identify(email, identityToken)`. Mint the short-lived token from your authenticated backend; never expose a secret API key in browser code."],examples:['sequenzy web-tracking create --name "Storefront" --origins https://example.com,https://*.example.com',"sequenzy web-tracking list","sequenzy web-tracking update wtk_123 --origins https://example.com",'sequenzy web-tracking create --name "Mobile app" --app-ids com.example.app',"sequenzy web-tracking update wtk_123 --deactivate"]});var wje=xd.command("list").description("List web tracking keys and where each one is allowed to run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>VZ(e));S(wje,{examples:["sequenzy web-tracking list","sequenzy web-tracking list --json"]});var Sje=xd.command("get <id>").description("Show one key with its install snippet").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>WZ(e,t));S(Sje,{examples:["sequenzy web-tracking get wtk_123"]});var Dje=xd.command("create").description("Create a publishable key and print the install snippet").requiredOption("--name <name>","Human-readable label, e.g. 'Storefront'").option("--origins <origins>","Comma-separated allowed origins, e.g. https://example.com,https://*.example.com").option("--app-ids <ids>","Comma-separated iOS bundle IDs and Android package names for the mobile SDKs").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>YZ(e));S(Dje,{notes:["A bare domain is read as https. Use https://*.example.com to cover subdomains; it does not match the apex, so list that separately if you need it.","Include your local development origin (e.g. http://localhost:3000) while you are wiring the SDK up.","The snippet embeds both the key and the workspace id, so paste it as printed.","A key with --app-ids and no --origins works only from your apps, never from a website."],examples:['sequenzy web-tracking create --name "Storefront" --origins https://example.com','sequenzy web-tracking create --name "Dev" --origins http://localhost:3000','sequenzy web-tracking create --name "Mobile app" --app-ids com.example.app,com.example.android']});var _je=xd.command("update <id>").description("Rename a key, change its origins or app IDs, or revoke it").option("--name <name>","New label").option("--origins <origins>","Replace the allowed origins (pass an empty string to clear them)").option("--app-ids <ids>","Replace the allowed app IDs (pass an empty string to clear them)").option("--activate","Re-enable a revoked key").option("--deactivate","Revoke the key without deleting it").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ZZ(e,t));S(_je,{notes:["--origins and --app-ids each replace the whole list rather than appending to it.","Adding --app-ids to a key with no origins makes it app-only: a website already using it stops sending events. Add the site's origins too, or create a separate key for the app.","Revoking keeps the key value, so you can still find the snippet to remove from your site. Events stop within a minute."],examples:["sequenzy web-tracking update wtk_123 --origins https://example.com,https://shop.example.com","sequenzy web-tracking update wtk_123 --deactivate"]});var xje=xd.command("delete <id>").description("Permanently delete a web tracking key").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>XZ(e,t));S(xje,{notes:["Remove the snippet from your site too, otherwise it keeps posting events that are rejected.","Prefer `update --deactivate` if you may want the key back."],examples:["sequenzy web-tracking delete wtk_123 --yes"]});await Rj(Ve);process.exit(process.exitCode??0);
|
|
526
|
+
${Ja}Use 'sequenzy --help' and '<command> --help' for detailed examples and caveats.${$i}`;console.log(n),console.log(r),console.log(),console.log(i),console.log(o),console.log(c),console.log()}var Ve=new hP;kj(Ve);Ve.name("sequenzy").description("Sequenzy CLI - Email marketing from the terminal").version(a5).showHelpAfterError().showSuggestionAfterError().action(Jqe);S(Ve,{notes:["Use --json on data commands when another tool or agent should parse structured output.","Dashboard-aware JSON responses include appUrls when a company ID can be resolved.","Company-scoped commands accept --company for personal API keys that can access multiple companies.","Content commands prefer file flags such as --html-file, --blocks-file, --steps-file, and --emails-file to avoid shell escaping issues.","Sequence creation supports --goal for AI generation or explicit step JSON."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy campaigns update camp_123 --subject "Updated subject" --html-file ./campaign.html',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy urls --company comp_123 --sequence seq_123 --settings-tab integrations","sequenzy websites guide --framework nextjs --use-case transactional",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var Kqe=Ve.command("login").description("Log in to your Sequenzy account").action(J4);S(Kqe,{notes:["Starts device authentication and prints a verification URL plus approval code."],examples:["sequenzy login"]});var Vqe=Ve.command("logout").description("Log out of your Sequenzy account").action(K4);S(Vqe,{examples:["sequenzy logout"]});var Wqe=Ve.command("whoami").description("Show the locally stored Sequenzy identity").action(r5);S(Wqe,{notes:["This checks local CLI credential state only. Use 'sequenzy account' to make a live request and verify the active key, permissions, and company access."],examples:["sequenzy whoami"]});var Yqe=Ve.command("stats").description("Show account, campaign, sequence, or transactional email metrics").option("-p, --period <period>","Time period (7d, 30d, 90d)").option("--start <iso>","Start of custom time range (ISO 8601)").option("--end <iso>","End of custom time range (ISO 8601)").option("--campaign <id>","Get stats for a specific campaign").option("--sequence <id>","Get stats for a specific sequence").option("--transactional <id-or-slug>","Get stats for a saved transactional email").option("--email-type <type>","Filter account stats by campaign, transactional, or sequence").option("--emails","List per-email metrics: one row per campaign and per sequence email step").option("--clients","Show mail client and device shares of unique opens (account or --campaign)").option("--links","Show clicks per link destination across every email in the account").option("--step <number>","With --emails, keep only this 1-based sequence email step").option("--sort <field>","With --emails, sort by sent, delivered, opened, clicked, openRate, clickRate, unsubscribed, conversions, revenue, step, or name").option("--order <order>","With --emails, sort order: asc or desc").option("--page <number>","With --emails, page number").option("--limit <number>","With --emails, emails per page (maximum 500); with --links, links to show (maximum 50); with --by, rows (maximum 100)").option("--mailbox-provider <provider>","Filter by recipient mailbox provider (gmail, microsoft, yahoo, ...)").option("--recipient-domain <domain>","Filter account stats or --by to one recipient domain (gmail.com, ...)").option("--source <type:id>","Filter account stats or --by to campaign:<id>, sequence:<id>, sequence_step:<id> or transactional:<id>").option("--outcome <outcome>","Filter account stats or --by to sends that had permanent_bounce, temporary_bounce, blocked or complaint").option("--by <dimension>","Break the funnel down by email, sequence, email_type, mailbox_provider or recipient_domain").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including poll and NPS results").action(dZ);S(Yqe,{notes:["Use exactly one of account-level stats, --campaign, --sequence, or --transactional. --email-type applies only to account-level stats.","--mailbox-provider scopes account or campaign engagement metrics to one recipient mailbox provider (e.g. gmail, microsoft, yahoo); replies, conversions, and revenue cannot be segmented per provider and report 0 under this filter.","Saved transactional email stats are all-time by default; pass --period for a window.","Use --email-type transactional for Send API open and click rates; use 'email-sends get <id>' for one delivery.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement.","Sequence stats include per-step sent/delivered/opened/clicked counts, a live active/waiting enrollment breakdown by current node, and per-step failures.","--emails lists one row per campaign and per sequence email step, with totals across every matching email. Combine with --sequence (comma-separated) and --step to answer questions like 'how many step-4 emails went out across these sequences'.","--emails counts come from the retained event stream, so they are not limited to the 14-day `email-sends list` history. Omit --period for all-time totals.","Campaign stats include a Poll & NPS Results section when the email collected answers; use --json for the full polls array. Sequence stats show the same results per email step (steps[].polls in --json); list one step's respondents with 'poll-responses --campaign <step nodeId>'.","--clients shows which mail clients and devices opened your emails, as shares of unique opens (each send counts once, by its first open). Gmail, Yahoo, and Apple Mail privacy proxies hide the device. With --campaign it covers the whole campaign; account-level stats default to 90 days.","--by breaks the funnel down by email, sequence, email_type, mailbox_provider or recipient_domain (default 30 days, top 25). Each row prints the --source, --email-type, --mailbox-provider or --recipient-domain flag that drills into it; every row includes attributed revenue.","--outcome limits account stats or --by to sends that bounced that way or drew a spam complaint: permanent_bounce, temporary_bounce, blocked or complaint. Use it with --by email to see which emails the complaints or bounces came from; filtered responses report replies as 0.","--links ranks link destinations by clicks across every email (default 90 days, top 10). Query strings, fragments and trailing slashes are ignored, so UTM-tagged variants of a page count as one link. For one campaign's links, read clickedLinks from 'stats --campaign <id> --json'."],examples:["sequenzy stats","sequenzy stats --period 30d","sequenzy stats --emails --step 4","sequenzy stats --emails --sequence seq_1,seq_2 --step 4 --json","sequenzy stats --emails --email-type sequence --sort openRate --limit 20","sequenzy stats --campaign camp_123","sequenzy stats --campaign camp_123 --json","sequenzy stats --campaign camp_123 --include-bots","sequenzy stats --sequence seq_123","sequenzy stats --transactional password-reset","sequenzy stats --transactional password-reset --period 30d","sequenzy stats --email-type transactional --period 30d","sequenzy stats --mailbox-provider gmail --period 30d","sequenzy stats --campaign camp_123 --mailbox-provider yahoo","sequenzy stats --clients --period 30d","sequenzy stats --by sequence --period 30d","sequenzy stats --by email --source sequence:seq_123","sequenzy stats --by recipient_domain --source sequence:seq_123 --mailbox-provider microsoft","sequenzy stats --source sequence:seq_123 --recipient-domain outlook.com --json","sequenzy stats --by email --outcome complaint --period 7d","sequenzy stats --clients --campaign camp_123 --json","sequenzy stats --links --period 30d","sequenzy stats --links --email-type campaign --limit 25 --json"]});var HR=Ve.command("events").description("List raw campaign or sequence email events, or read event payload schemas").option("--campaign <id>","List events for a campaign").option("--sequence <id>","List events for a sequence").option("--automation-node-id <id>","Scope a --sequence stream to one email step").option("--type <type>","Single event type to include, such as delivery, open, or click").option("--event-types <types>","Comma-separated event types to include (default: delivery)").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Start of custom time range (ISO 8601)").option("--end <iso>","End of custom time range (ISO 8601)").option("--page <number>","Page number").option("--limit <number>","Events per page, capped by the API").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(T3);S(HR,{notes:["Use exactly one of --campaign or --sequence.","Defaults to delivery events. Use --event-types delivery,open,click when you need engagement events too.","--automation-node-id narrows a sequence stream to one email step; take the node ID from `stats --sequence <id>`.","This is the per-recipient stream. For per-step send totals use `stats --sequence <id>` or `stats --emails`, not a count of these pages.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy events --campaign camp_123","sequenzy events --sequence seq_123 --limit 100 --json","sequenzy events --sequence seq_123 --automation-node-id node_email_4","sequenzy events --campaign camp_123 --event-types delivery,click --period 30d","sequenzy events schema ecommerce.order_placed"]});HR.command("sample <event>").description("Read the latest received event payload in this workspace").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e,t)=>D3(e,t));var Zqe=HR.command("schema [event]").description("Show the published payload of a built-in event, or list documented events").option("--provider <provider>",_3).option("--example","Print the full sample payload as JSON").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e,t)=>B3(e,t));S(Zqe,{notes:["Read this before writing {{event.*}} merge tags or event property filters: an unrecognized merge tag renders as an empty string rather than an error.","Fields ending in Cents are minor units (8850 = $88.50); price is a preformatted display string, and predictedLtv is whole currency units.","Custom event names are supported everywhere even though they have no published payload here - `documented: false` never means the name is invalid.","This is static reference data. Use `sequenzy events sample <event>` to read the latest actual received payload."],examples:["sequenzy events schema","sequenzy events schema ecommerce.order_placed --provider shopify","sequenzy events schema ecommerce.browse_abandoned --example","sequenzy events schema ecommerce.cart_abandoned --json"]});var c5=Ve.command("blocks [type]").description("Show the fields each email block type accepts, or list every block type").option("--creatable-only","Hide structural block types the editor manages for you").option("--example","Print the example block as formatted JSON").option("--conditions","Also print the condition field, operator, and value table for this block type").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e,t)=>b3(e,t));c5.command("preview-cart").description("Suggest cart fields and generate preview-only scenarios without saving or sending").option("--items <json>","JSON array of actual event items").option("--items-file <path>","Read event items from a JSON file").option("--fields <json>","Existing itemFields mapping").option("--price-unit <unit>","Numeric price units: minor or major").option("--scenario <name>","real, one, many, empty, missing-images, or long-names","real").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(o3);S(c5,{notes:["Read this before hand-authoring a blocks array: the blocks parameter accepts a 37-type union, so field names are not guessable from the endpoint schema alone.",'Lists are their own block type, not a text variant. A numbered list is {"type":"list","variant":"numbered","items":[{"content":"First"}]}; a visual numbered walkthrough is {"type":"steps","variant":"numbered","items":[{"title":"Step one"},{"title":"Step two"}]}.',"`list` items carry `content`; `steps` items carry `title` and an optional `description`. The two are not interchangeable.","A `list` item nests under the item above it with `indent` 1 or 2 (leave it out for the top level), up to three levels deep.","Every block also takes a `conditions` array, and each condition field accepts only its own operators. `blocks conditional-group` prints that table unprompted; any other type takes --conditions, since it is longer than the block reference itself.","This is static reference data derived from the same schemas that validate a write, so it cannot drift from what the API accepts."],examples:["sequenzy blocks","sequenzy blocks --creatable-only","sequenzy blocks list","sequenzy blocks steps --example","sequenzy blocks hero --json","sequenzy blocks conditional-group","sequenzy blocks text --conditions"]});var Xqe=Ve.command("poll-responses").description("List individual Poll and NPS responses for a campaign").option("--campaign <id>","Campaign ID (required)").option("--block-id <id>","Scope to one poll block").option("--has-comment","Only respondents who left a comment").option("--page <number>","Page number").option("--limit <number>","Responses per page (maximum 500)").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(eK);S(Xqe,{notes:["Returns each respondent's latest answer per poll block with the response time, so counts match `stats --campaign <id>`.","Block IDs come from the polls array of `stats --campaign <id> --json`.","For a sequence email step, pass the step's automation node ID as --campaign.","Polls with a comment box show each respondent's latest comment under their answer, with the answer it was written under when that differs; --has-comment lists only respondents who commented.","Do not scan subscribers for the poll attribute instead: the attribute carries no response time and reflects the latest answer to any email."],examples:["sequenzy poll-responses --campaign camp_123","sequenzy poll-responses --campaign camp_123 --block-id poll_1 --has-comment","sequenzy poll-responses --campaign camp_123 --block-id poll_1 --json","sequenzy poll-responses --campaign camp_123 --limit 500 --page 2"]});var eFe=Ve.command("replies").description("List who replied to a campaign, newest first").option("--campaign <id>","Campaign ID (required)").option("--page <number>","Page number").option("--limit <number>","Replies per page (maximum 500)").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(PJ);S(eFe,{notes:["Lists one row per reply with the subscriber, reply time and attachment count, so the total matches the replies count of `stats --campaign <id>` without a period or provider filter.","Each row names the inbox conversation holding the reply; read it with `sequenzy inbox get <conversationId>`. A reply with no inbox conversation shows 'not in the inbox'.","Reply text is not included."],examples:["sequenzy replies --campaign camp_123","sequenzy replies --campaign camp_123 --json","sequenzy replies --campaign camp_123 --limit 500 --page 2","sequenzy inbox get conv_123"]});var tFe=Ve.command("urls").description("Generate Sequenzy dashboard URLs for known resource IDs").option("-c, --company <id>","Company ID").option("--campaign <id>","Campaign ID for campaign editor URL").option("--landing-page <id>","Landing page ID for landing page editor URL").option("--sequence <id>","Sequence ID for sequence editor URL").option("--template <id>","Template/email ID for email editor URL").option("--email <id>","Email ID for email editor URL").option("--transactional <id>","Transactional email ID").option("--email-send <id>","Email send ID").option("--domain <id>","Sending domain ID").option("--status <status>","Status for campaign/sequence list URLs").option("--settings-tab <tab>","Settings tab slug; billing/subscription opens Account -> Subscription").option("--json","Print JSON").action(vJ);S(tFe,{notes:["Uses SEQUENZY_APP_URL when set, otherwise https://sequenzy.com.","If --company is omitted, the CLI tries the current company from `sequenzy account`.","Useful after creating a campaign or sequence when the user wants a review/edit link."],examples:["sequenzy urls --company comp_123","sequenzy urls --company comp_123 --sequence seq_123","sequenzy urls --company comp_123 --campaign camp_123","sequenzy urls --company comp_123 --landing-page lp_123","sequenzy urls --company comp_123 --email-send send_123","sequenzy urls --company comp_123 --settings-tab integrations","sequenzy urls --company comp_123 --settings-tab billing","sequenzy urls --company comp_123 --json"]});var Xi=Ve.command("subscribers").description("Manage subscribers").action(()=>Xi.help());S(Xi,{notes:["Subscriber list fetches every page by default so agents do not silently miss later results.","`subscribers get` includes tags, list memberships, sequence enrollments, email stats, and recent activity.","--attr expects repeated key=value pairs. Example: --attr firstName=Ana --attr plan=pro","--attr sends strings. Use --attrs-json on add and update for numbers, booleans, lists, or strings with leading zeros such as zip codes. `subscribers attributes` lists the names and types already in use."],examples:["sequenzy subscribers list --tag vip",'sequenzy subscribers list --list "Master List" --json',"sequenzy subscribers list --tag vip --limit 25 --json","sequenzy subscribers add user@example.com --tag trial --attr firstName=Ana","sequenzy subscribers attributes","sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed","sequenzy subscribers import-status import_123 --json","sequenzy subscribers get user@example.com --json",'sequenzy subscribers notes add user@example.com --body "Customer prefers quarterly reports"',"sequenzy subscribers remove user@example.com --hard"]});var JR=Xi.command("operations").description("Run and monitor background audience tagging");JR.command("start").requiredOption("--kind <kind>","add_tags").option("--audience-json <json>","Audience filters or subscriberIds as JSON (supports @file)").option("--tag <tags...>","Tags to add").option("--trigger-automations","Trigger tag automations (requires automations:trigger)").option("--request-key <key>","Idempotency key; reuse after an uncertain start response").option("-c, --company <id>","Company ID").option("--json","Print JSON").action((e)=>WI("start",e));JR.command("list").option("-c, --company <id>").option("--json").action((e)=>WI("list",e));for(let e of["get","cancel"])JR.command(`${e} <id>`).option("-c, --company <id>").option("--json").action((t,n)=>WI(e,{...n,id:t}));var nFe=Xi.command("list").description("List subscribers").option("-s, --segment <id>","Filter by segment").option("-t, --tag <tag>","Filter by tag").option("--list <id-or-name>","Filter by subscriber list ID or exact name").option("--status <status>","active, not_subscribed, unsubscribed, bounced, or all").option("--unsubscribed-after <date>","Only contacts whose opt-out is on or after this ISO 8601 date or zoned datetime").option("--unsubscribed-before <date>","Only contacts whose opt-out is on or before this ISO 8601 date or zoned datetime").option("--attribute <name>",'Filter by custom attribute name, e.g. "plan". The "name:value" form also works').option("--attribute-value <value>","Value the custom attribute must match").option("--attribute-operator <operator>","is, contains, gt, gte, lt, lte, or is_not_empty (default: is)").option("-l, --limit <number>","Maximum results to return").option("--offset <number>","Matches to skip (maximum 999999; use --cursor for deeper pagination)").option("--page <number>","1-based page number; requires --limit").option("--cursor <token>","pagination.nextCursor from the previous response; cheaper than --offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>yo("list",e));S(nFe,{notes:["Without --limit the command walks every page and returns all matches in one call.","With --limit, page through the audience by re-running with --cursor set to the previous response's pagination.nextCursor. Fall back to --offset (or --page) when nextCursor is null.","--attribute filters on ClickHouse-backed custom attributes and cannot be combined with --segment. Use a saved segment for compound or is_not/is_empty attribute filters.","--unsubscribed-after/--unsubscribed-before match the opt-out date and exclude contacts that have none: active contacts, and contacts imported as already unsubscribed. Bare dates use UTC midnight; datetimes must include Z or an explicit offset."],examples:["sequenzy subscribers list",'sequenzy subscribers list --list "Master List"',"sequenzy subscribers list --segment seg_123","sequenzy subscribers list --tag onboarding --limit 100","sequenzy subscribers list --status unsubscribed --unsubscribed-after 2026-07-01 --json","sequenzy subscribers list --limit 50 --json","sequenzy subscribers list --limit 50 --cursor NEXT_CURSOR --json","sequenzy subscribers list --limit 50 --offset 50 --json","sequenzy subscribers list --attribute plan --attribute-value pro","sequenzy subscribers list --attribute mrr --attribute-value 50 --attribute-operator gte","sequenzy subscribers list --attribute prem_rouge_sample_received --attribute-operator is_not_empty --json"]});var rFe=Xi.command("add [email]").description("Add or upsert a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--phone <phone>","Phone number (E.164 or national). With no email, creates a phone-only SMS contact").option("--phone-country <country>","Two-letter country used to read a national-format --phone (default US)").option("--sms-consent","Record express written SMS marketing consent for the phone number").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("--timezone <zone>","IANA timezone (e.g. America/New_York) used for recipient-local campaign delivery").option("-t, --tag <tags...>","Tags to apply").option("-l, --list <ids...>","List IDs to add the subscriber to").option("--no-lists","Add the subscriber to no lists").option("--skip-sequences","Do not enroll the subscriber in matching sequences").option("--enroll-sequences","Enroll matching sequences, including when --created-at is supplied (requires automations:trigger)").option("-a, --attr <attrs...>","Attributes (key=value)").option("--attrs-json <json>",`Attributes as a JSON object that keeps value types, e.g. '{"zip":"02134","seats":5}'`).option("--created-at <iso-date>","Original signup date when importing history from another platform (only ever moves an existing contact's date earlier; skips sequences unless --enroll-sequences is passed)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("add",{email:e,...t,noLists:t.lists===!1}));S(rFe,{examples:["sequenzy subscribers add user@example.com","sequenzy subscribers add user@example.com --first-name Ana --tag trial --attr plan=pro",`sequenzy subscribers add user@example.com --attrs-json '{"zip":"02134","seats":5,"vip":true}'`,"sequenzy subscribers add user@example.com --list list_123","sequenzy subscribers add user@example.com --skip-sequences","sequenzy subscribers add user@example.com --created-at 2019-03-14T09:30:00Z","sequenzy subscribers add user@example.com --created-at 2019-03-14T09:30:00Z --enroll-sequences","sequenzy subscribers add --phone '+14155550123' --sms-consent"],notes:["--attr values are always sent as strings. Use --attrs-json for numbers, booleans and lists, or to keep a value such as a zip code as a quoted string. When both set the same key, --attr wins. Run `sequenzy subscribers attributes` to see the names and types your other contacts use.","--created-at preserves a contact's real signup date so date-relative segments are correct right after a migration. It never moves an existing contact's date later, and it suppresses sequence enrollment by default because it describes the past, not a signup happening now. Pass --enroll-sequences to opt in explicitly. New-subscriber account notifications remain eligible when the signup date is at most one hour old; older dates do not notify on creation. Double opt-in confirmation can notify even for imported contacts. Your notification preferences, double opt-in and the daily cap still apply."]});var iFe=Xi.command("import [file]").description("Queue a full-record subscriber import from CSV or JSON").option("--records-json <json>","Inline JSON array (alternative to a CSV/JSON file)").option("--duplicate-strategy <strategy>","Existing contact behavior: skip, merge, or overwrite","skip").option("--file-name <name>","Source label shown in import history").option("-l, --list <ids...>","List IDs for every imported subscriber (requires lists:write)").option("--enroll-sequences","Enroll matching subscribers (requires automations:trigger)").option("--default-phone-country <country>","Two-letter country for national phone numbers").option("--sms-consent","Assert express written SMS consent for every imported phone").option("--opt-in-mode <mode>","Email consent mode: default, confirmed, or double_opt_in (default may require automations:trigger; double_opt_in always does)","default").option("--idempotency-key <key>","Caller-owned key (1-255 chars) that makes retrying this request safe: resending the same content returns the already-queued import, while changed content under the same key queues a new import").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("import",{file:e,...t}));S(iFe,{notes:["CSV columns for email, names, external ID, phone, status, and tags are detected automatically; other columns become custom attributes.","Status values from AWeber, Mailchimp, Kit, MailerLite, Brevo, ActiveCampaign, and beehiiv exports are mapped to active, unsubscribed, or bounced. A filled unsubscribe date column marks the row unsubscribed. Not-confirmed (pending double opt-in) and unrecognized values import as active; unrecognized ones are counted in the output.","Use --opt-in-mode confirmed only when these contacts already gave verified email consent.","Imports run asynchronously. Poll the returned ID with subscribers import-status.","Pass --idempotency-key from pipelines and retry loops so a timed-out request can be resent without double-queueing the batch.","If two identical keyed requests overlap, one may receive a retryable 503; honor Retry-After and resend the same request."],examples:["sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed",`sequenzy subscribers import --records-json '[{"email":"one@example.com","firstName":"Ana"}]' --opt-in-mode confirmed`,"sequenzy subscribers import contacts.csv --duplicate-strategy merge --idempotency-key nightly-sync-2026-08-25"]});var oFe=Xi.command("import-status <importId>").description("Get subscriber import progress and result counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("import:get",{importId:e,...t}));S(oFe,{notes:["A completed import can still contain failed rows; inspect failed counts and --json reason maps."],examples:["sequenzy subscribers import-status import_123","sequenzy subscribers import-status import_123 --json"]});var sFe=Xi.command("events-import [file]").description("Record events for many subscribers from a JSON file").option("--events-json <json>","Inline JSON array (alternative to a JSON file)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("events:import",{file:e,...t}));S(sFe,{notes:["Each event needs a name, an eventId, and an email or externalId; externalId-only rows must identify an existing contact because email is required for creation. At most 25 events per request.","History is classified per contact: only contacts whose events are all more than an hour old use the silent historical path. If any event for a contact is recent, every event for that contact uses the live path and can run sequences or webhooks.","Derive each required eventId from your source data so re-running the same file records nothing twice."],examples:["sequenzy subscribers events-import purchases.json",`sequenzy subscribers events-import --events-json '[{"email":"one@example.com","name":"purchase_completed","eventId":"order_1","occurredAt":"2026-08-01T12:00:00Z"}]'`]});var aFe=Xi.command("get [email]").description("Get subscriber details").option("--external-id <id>","Customer-owned subscriber ID").option("--include-bots","Include machine-classified bot/scanner opens and clicks in stats/activity").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("get",{email:e,...t}));S(aFe,{notes:["Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy subscribers get user@example.com","sequenzy subscribers get user@example.com --include-bots"]});var KA=Xi.command("notes").description("Manage subscriber notes").action(()=>KA.help());S(KA,{examples:["sequenzy subscribers notes list user@example.com",'sequenzy subscribers notes add user@example.com --body "Prefers monthly digest"',"sequenzy subscribers notes delete note_123"]});var cFe=KA.command("list [email]").description("List subscriber notes").option("--external-id <id>","Customer-owned subscriber ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("notes:list",{email:e,...t}));S(cFe,{examples:["sequenzy subscribers notes list user@example.com","sequenzy subscribers notes list --external-id user_123 --json"]});var lFe=KA.command("add [email]").description("Add a subscriber note").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-b, --body <body>","Note body").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("notes:add",{email:e,...t}));S(lFe,{examples:['sequenzy subscribers notes add user@example.com --body "Asked about enterprise plan"','sequenzy subscribers notes add --external-id user_123 --body "Imported from sales call"']});var uFe=KA.command("delete <noteId>").description("Delete a subscriber note").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("notes:delete",{noteId:e,...t}));S(uFe,{examples:["sequenzy subscribers notes delete note_123"]});var dFe=Xi.command("attributes").description("List the custom attributes your contacts use, with value types and examples").option("--include-nested","Also list nested paths such as profile.tier").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>yo("attributes",e));S(dFe,{notes:["Types and examples come from up to 100 recent contacts. Names that only older contacts use are listed too, with sampledContacts 0.",`A list attribute (isArray) holds several values. Set it with --attrs-json, e.g. --attrs-json '{"interests":["running"]}'.`],examples:["sequenzy subscribers attributes","sequenzy subscribers attributes --include-nested --json"]});var pFe=Xi.command("update [email]").description("Update subscriber status, name, phone, tags, or custom attributes").option("--external-id <id>","Customer-owned subscriber ID").option("--status <status>","active, not_subscribed, unsubscribed, bounced, or complained (records a spam complaint and unsubscribes)").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("--timezone <zone>","IANA timezone (e.g. America/New_York). Pass an empty string to clear it").option("--phone <phone>","Phone number (E.164 or national). Pass an empty string to clear it").option("--phone-country <country>","Two-letter country used to read a national-format --phone (default US)").option("--sms-consent","Record express written SMS marketing consent for the phone number").option("--no-sms-consent","Unsubscribe the contact from SMS").option("-t, --tag <tags...>","Replacement tags").option("-a, --attr <attrs...>","Attributes (key=value)").option("--attrs-json <json>",`Attributes as a JSON object that keeps value types, e.g. '{"seats":5}'`).option("--merge","Merge custom attributes instead of replacing them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("update",{email:e,...t}));S(pFe,{notes:["--phone writes the native phone field shown on the contact, not a custom attribute.","--attr values are always sent as strings. Use --attrs-json to set numbers, booleans and lists or to change an attribute's type. When both set the same key, --attr wins.","Changing --phone resets SMS consent unless --sms-consent is passed in the same command.","--status complained records a company spam-complaint suppression, unsubscribes the contact and cancels its sequence enrollments. The contact then reads as unsubscribed; the suppression shows in `sequenzy suppressions get <email>`."],examples:["sequenzy subscribers update user@example.com --status unsubscribed","sequenzy subscribers update user@example.com --status complained","sequenzy subscribers update user@example.com --first-name Ana --last-name Silva","sequenzy subscribers update user@example.com --phone '+390512345678'","sequenzy subscribers update user@example.com --phone '051 234 5678' --phone-country IT --sms-consent","sequenzy subscribers update user@example.com --tag churned --attr cancelReason=too_expensive","sequenzy subscribers update user@example.com --attr plan=pro --merge",`sequenzy subscribers update user@example.com --attrs-json '{"zip":"02134"}' --merge`]});var mFe=Xi.command("event [email]").description("Trigger an event for a subscriber").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-n, --name <event>","Event name").option("-p, --property <properties...>","Event properties (key=value)").option("-a, --attr <attrs...>","Subscriber attributes (key=value)").option("--account <externalId>","Attach the contact to this customer organization (ignored with a warning until the workspace has Organizations on)").option("--organization <externalId>","Same as --account").option("--account-json <json>","Account reference object with externalId and optional role, name, domain, attributes; cannot be combined with --account").option("--occurred-at <iso-date>","When the event actually happened; more than an hour ago records it as history without running sequences").option("--event-id <id>","Your own event ID, so re-sending the same event writes nothing new").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("event",{email:e,...t}));S(mFe,{examples:["sequenzy subscribers event user@example.com --name saas.purchase","sequenzy subscribers event user@example.com --name saas.purchase --property plan=pro --property amount=99","sequenzy subscribers event user@example.com --name saas.purchase --occurred-at 2024-11-02T10:00:00Z --event-id inv_9182"],notes:["Without --occurred-at the event is live and runs the full chain: sync rules, sequence enrollment, waiting steps, goal conversions.","--event-id is an idempotency key on both paths: re-sending an ID this contact already has for this event name records nothing and runs no side effects. It is best-effort for live events sent within a second of each other, so a producer that needs a strict guarantee should keep its own ledger.","With an --occurred-at more than an hour in the past the event is recorded as history: stored with its real timestamp and counted by segments, but no sequences enroll and no webhooks fire. The contact's signup date also moves back to when the event occurred (never later). Use it for backfills, never to fake a live event."]});var cC=Xi.command("tags").description("Many contacts, one or more tags: add or remove tags on existing subscribers").action(()=>cC.help());S(cC,{notes:["These commands only touch contacts that already exist. Unknown identifiers are reported, never created.","They call POST /api/v1/subscribers/bulk/tags/add and /remove (up to 500 contacts per request). The similarly named POST /api/v1/subscribers/tags/bulk is the opposite shape: one contact, several tags, and it creates the contact when missing.","Use `subscribers add` or `subscribers update` for single-contact tag changes."],examples:["sequenzy subscribers tags add --tag legacy-plan --emails-file ./backlog.csv","sequenzy subscribers tags remove --tag legacy-plan --emails-file ./backlog.csv"]});var fFe=cC.command("add").description("Add tags to many existing subscribers (never creates contacts)").requiredOption("-t, --tag <tags...>","Tags to add").option("-e, --email <emails...>","Subscriber emails to tag").option("--emails-json <json>","JSON array of subscriber emails").option("--emails-file <file>","CSV or newline-separated file of emails").option("--external-id <ids...>","Customer-owned subscriber IDs to tag").option("--subscriber-id <ids...>","Sequenzy subscriber IDs to tag").option("--trigger-automations","Allow tag_added sequences to enroll these contacts (requires automations:trigger)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>BR("add",e));S(fFe,{notes:["Tag automations are skipped by default, which is what historical backfills want.","Requests are chunked at 500 targets each; totals in the output are combined across chunks."],examples:["sequenzy subscribers tags add --tag vip --email a@example.com --email b@example.com","sequenzy subscribers tags add --tag derived-churn --emails-file ./backlog.csv --json","sequenzy subscribers tags add --tag welcome --emails-file ./new.csv --trigger-automations"]});var gFe=cC.command("remove").description("Remove tags from many existing subscribers (never creates contacts)").requiredOption("-t, --tag <tags...>","Tags to remove").option("-e, --email <emails...>","Subscriber emails to untag").option("--emails-json <json>","JSON array of subscriber emails").option("--emails-file <file>","CSV or newline-separated file of emails").option("--external-id <ids...>","Customer-owned subscriber IDs to untag").option("--subscriber-id <ids...>","Sequenzy subscriber IDs to untag").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>BR("remove",e));S(gFe,{examples:["sequenzy subscribers tags remove --tag legacy-plan --emails-file ./backlog.csv","sequenzy subscribers tags remove --tag vip --subscriber-id sub_1 sub_2"]});var AFe=Xi.command("remove [email]").description("Unsubscribe or permanently delete a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--hard","Permanently delete (not just unsubscribe); recorded data is erased or anonymized, suppressions are kept").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>yo("remove",{email:e,...t}));S(AFe,{examples:["sequenzy subscribers remove user@example.com","sequenzy subscribers remove user@example.com --hard"]});var Dd=Ve.command("transactional").description("Manage transactional email templates").action(()=>Dd.help());S(Dd,{notes:["Use the top-level `sequenzy send` command to send email."],examples:["sequenzy transactional list","sequenzy transactional get welcome","sequenzy transactional update welcome --no-enabled","sequenzy transactional delete welcome --yes","sequenzy send user@example.com --template welcome --var firstName=Ana"]});var hFe=Dd.command("list").description("List transactional templates").option("--label <labels...>","Filter by label names (matches any)").option("--search <text>","Search name, slug, or email subject/title").option("--status <status>","Filter by all, active, or disabled","all").option("--sort <field>","Sort by date, sends, opens, open-rate, clicks, or ctr","date").option("--order <order>","Sort order: asc or desc","desc").option("--include-bots","Include machine opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qm("list",e));S(hFe,{examples:['sequenzy transactional list --search "password reset" --status active',"sequenzy transactional list --sort open-rate --order desc","sequenzy transactional list --company comp_123 --json"]});var yFe=Dd.command("get <slug>").description("Get transactional template details by slug").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("get",{slug:e,...t}));S(yFe,{examples:["sequenzy transactional get welcome"]});var bFe=Dd.command("create <name>").description("Create a transactional template").option("--label <labels...>","Label names to assign").option("--slug <slug>","API slug").option("-s, --subject <subject>","Subject (optional with --prompt)").option("--preview-text <text>","Preview text override").option("--prompt <prompt>","Generate branded transactional blocks").option("--style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("--tone <tone>","Prompt generation tone").option("--html <html>","Preserved HTML content").option("--html-file <file>","Read preserved HTML from file").option("--blocks-json <json>","Finished Sequenzy blocks JSON").option("--blocks-file <file>","Read finished Sequenzy blocks from file").option("--enabled","Enable immediately (prompt creates default disabled)").option("--no-enabled","Create the transactional template disabled").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("create",{name:e,...t}));S(bFe,{notes:["Provide exactly one of prompt, HTML, or blocks.",JA],examples:['sequenzy transactional create password-reset --prompt "Write a password reset email"']});var vFe=Dd.command("update <slug>").description("Update a transactional template by ID or slug").option("--label <labels...>","Replace label names").option("--clear-labels","Remove all label assignments").option("--name <name>","Transactional template name").option("-s, --subject <subject>","Subject line").option("--preview-text <text>","Preview text").option("--clear-preview-text","Remove the preview text").option("--html <html>","Replace the body with preserved HTML").option("--html-file <file>","Replace the body with HTML read from file").option("--blocks-json <json>","Replace the body with Sequenzy blocks JSON").option("--blocks-file <file>","Replace the body with blocks read from file").option("--enabled","Allow this template to be sent").option("--no-enabled","Stop this template from being sent").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("update",{slug:e,...t}));S(vFe,{notes:["Partial update: only the fields you pass change.","Replacing the body takes HTML or blocks, not both.","Use --no-enabled to stop sends while keeping the template and its stats.",JA],examples:["sequenzy transactional update password-reset --no-enabled",'sequenzy transactional update password-reset --subject "Reset your password"',"sequenzy transactional update password-reset --blocks-file ./reset.json"]});var EFe=Dd.command("delete <slug>").description("Delete a transactional template by ID or slug").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qm("delete",{slug:e,...t}));S(EFe,{notes:["Deleting frees the slug for reuse and stops any further sends through it.","Past deliveries and their stats are kept; only the saved template is removed.","Requires an API key with the transactional:delete scope."],examples:["sequenzy transactional delete password-reset --yes"]});var KR=Ve.command("widgets").description("Widget helper commands").action(()=>KR.help());S(KR,{examples:["sequenzy widgets preferences-token user@example.com"]});var IFe=KR.command("preferences-token <email>").description("Generate a subscription preferences iframe token").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>i5("preferences-token",{email:e,...t}));S(IFe,{examples:["sequenzy widgets preferences-token user@example.com"]});var lC=Ve.command("email-sends").alias("emailsends").description("Inspect sent email snapshots and delivery events").action(()=>lC.help());S(lC,{notes:["Email send rows are short-lived; if the row was cleaned up, this falls back to retained ClickHouse events.","The list command matches the dashboard's 14-day delivery history and supports subject, recipient, status, type, and source filters.","Use --html to print the stored HTML body when it is still available."],examples:['sequenzy email-sends list --search "Welcome" --status opened',"sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --json"]});var CFe=lC.command("list").description("List and filter recent sent email deliveries").option("--search <text>","Search subject or recipient email").option("--subject <text>","Filter by subject/title").option("--recipient <text>","Filter by recipient email").option("--status <status>","Filter by delivery status").option("--email-type <type>","Filter by campaign, transactional, or sequence").option("--bounce-type <type>","Filter bounced sends by Permanent, Transient, Soft or Blocked").option("--campaign <id>","Filter by campaign ID").option("--transactional <id>","Filter by saved transactional email ID").option("--sequence <id>","Filter by sequence ID").option("--automation-node-id <id>","Filter by one email step of a sequence").option("--mailbox-provider <provider>","Filter by recipient mailbox provider (e.g. gmail, orange, other)").option("--list <id>","Only sends to active subscribers currently on this list").option("--days <days>","History window in days (maximum 14)","14").option("--page <page>","Page number").option("--limit <limit>","Results per page (maximum 100)").option("--all","Fetch every result page").option("--csv [path]","Export CSV to stdout, or write it to an optional file path").option("--sort <field>","Sort by recipientEmail, subject, status, eventAt, sentAt, or createdAt","createdAt").option("--order <order>","Sort order: asc or desc","desc").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Rx("list",e));S(CFe,{notes:["The opened status includes clicked deliveries, matching the dashboard.","Use a returned ID with `sequenzy email-sends get <id>` for timestamps and the complete event timeline.","Use --all --csv email-sends.csv to export every matching delivery.","--automation-node-id lists the recipients of one sequence step; the node ID comes from `stats --sequence <id>`.","--mailbox-provider uses the same providers as `stats --mailbox-provider`, so it lists the sends behind a provider's numbers; `other` is every domain outside the named providers.","This history only reaches back 14 days. For per-step send totals over the full retained window use `stats --sequence <id>` or `stats --emails`."],examples:['sequenzy email-sends list --search "Welcome" --status opened',"sequenzy email-sends list --email-type transactional --days 7","sequenzy email-sends list --sequence seq_123 --automation-node-id node_email_4","sequenzy email-sends list --mailbox-provider orange --list list_123 --status opened","sequenzy email-sends list --transactional txn_123 --all --csv email-sends.csv","sequenzy email-sends list --subject receipt --recipient example.com --json"]});var wFe=lC.command("get <emailSendId>").description("Get an email send by ID").option("-c, --company <id>","Company ID override for personal API keys").option("--html","Print the full stored HTML body in text output").option("--html-only","Print only the stored HTML body").option("--json","Print raw JSON").action((e,t)=>Rx("get",{id:e,...t}));S(wFe,{examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --company comp_123 --json"]});var VA=Ve.command("suppressions").description("Inspect recipient suppression and clear workspace escalations").action(()=>VA.help());S(VA,{notes:["Suppression lookup is exact-address only because the SES account-level list is shared across companies.","Removal clears workspace soft-bounce escalations only; global invalid-recipient, workspace hard-bounce, SES, complaint, and unsubscribe protections are preserved."],examples:["sequenzy suppressions list","sequenzy suppressions get me@example.com","sequenzy suppressions remove me@example.com --yes"]});var SFe=VA.command("list").description("List recipients this workspace cannot reach").option("--search <query>","Filter by email substring").option("--page <page>","Page number (default 1)").option("--limit <limit>","Entries per page (max 100)").option("--sort <field>","Order by suppressedAt, email, or status").option("--order <direction>","asc or desc").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>XI("list",e));S(SFe,{notes:["Shows protected global invalid-recipient suppressions for associated addresses, protected workspace hard bounces without conclusive invalid-inbox evidence, workspace soft-bounce escalations, and recipients who reported an email as spam.","Only workspace soft-bounce escalations can be removed.","--sort status lists removable escalations before protected suppressions. An unrecognized --sort falls back to newest first, and the applied order is printed with the results."],examples:["sequenzy suppressions list","sequenzy suppressions list --search example.com --json","sequenzy suppressions list --sort status --order desc"]});var DFe=VA.command("get <email>").description("Check local and Amazon SES suppression for one recipient").option("--region <region>","Check one AWS SES region").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>XI("get",{email:e,...t}));S(DFe,{examples:["sequenzy suppressions get me@example.com","sequenzy suppressions get me@example.com --region us-east-1 --json"]});var _Fe=VA.command("remove <email>").description("Remove a workspace soft-bounce escalation").option("--region <region>","Inspect one AWS SES region after removal").option("-c, --company <id>","Company ID override for personal API keys").option("-y, --yes","Skip confirmation").option("--json","Print raw JSON").action((e,t)=>XI("remove",{email:e,...t}));S(_Fe,{examples:["sequenzy suppressions remove me@example.com","sequenzy suppressions remove me@example.com --region us-east-1 --yes"]});var xFe=L8(Ve.command("send <email...>").description("Send through the transactional email API")).option("-t, --template <slug>","Transactional template slug to use").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file, or - for stdin").option("--track-as <name>","Track --html sends under one code-managed transactional email (e.g. weekly-report)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").option("--email-type <type>","Delivery policy: transactional (default) or marketing").option("--from-email <email>","Send from this verified sender address instead of the company default").option("--from-name <name>","Existing sender display name on --from-email when the address has several identities").option("--sender-profile-id <id>","Existing sender profile ID; omit --from-email. See sequenzy sender-profiles list").option("--reply-to <address>","Reply-To address or Name <email> value").option("--reply-to-name <name>","Display name for a bare --reply-to address").option("--reply-profile <id>","Existing reply profile ID; omit --reply-to. See sequenzy sender-profiles list").option("--attachments-json <json>","Attachments as JSON objects with filename and content or path").option("--header <header>",'Extra email header as "Name: value", e.g. a List-Unsubscribe for a transactional send (repeatable)',(e,t=[])=>[...t,e]).option("--no-track-clicks","Disable click tracking for this send to keep iOS/Android universal links working").option("--no-track-opens","Disable the open-tracking pixel for this send").option("--idempotency-key <key>","Retry key that prevents duplicate sends for 14 days").option("--vars-json <json>","Variables as a JSON object, including nested arrays for repeat blocks").option("-v, --var <vars...>","Variables (key=value)").action(j8);S(xFe,{notes:["Use either --template or --html/--html-file.","Use --html-file - for piped HTML. --json prints the accepted API receipt; failures print structured JSON to stderr.","--template takes a transactional API slug and cannot be combined with --subject.","--subject is required when sending raw HTML.","--track-as names a raw-HTML email type (for example weekly-report): every send with the same value is counted under one code-managed transactional email that the first send creates. Use stable ASCII names (letters, digits, spaces and . _ - : /), not per-recipient values; a workspace can have 100. It cannot be combined with --template.","Pass several recipients, --cc, or --bcc to send one email with a shared recipient list instead of one email per address. Each list accepts up to 50 addresses; repeat --cc/--bcc or use comma-separated values for several copy recipients.","Addresses repeated across the lists are dropped from the lower-priority one: to beats cc beats bcc.","--email-type marketing adds the standard unsubscribe footer and RFC 8058 one-click-unsubscribe headers; it supports one recipient only and rejects --cc and --bcc.","When --from-email and --sender-profile-id are omitted, a template send keeps its saved From identity and a direct send uses the company default. Pass --from-email (and --from-name if that address has several identities) to send as a non-default verified brand without looking up IDs.","Use either --from-email or --sender-profile-id, not both. --from-name requires --from-email. --sender-profile-id already carries the display name.","When --reply-to and --reply-profile are omitted, the saved template or company Reply-To default is used. Use either --reply-to or --reply-profile, not both. --reply-to-name requires a bare --reply-to address.","--attachments-json accepts up to 10 objects with filename plus Base64 content or a public path; contentId embeds a CID image and contentType overrides MIME detection.",`--header adds an email header (up to 50). Transactional sends can carry your own List-Unsubscribe and List-Unsubscribe-Post; marketing sends always use Sequenzy's. Headers Sequenzy manages, such as From, To, Subject, Reply-To and Message-ID, are not applied; the receipt lists any header that was not applied and why. A --header without "Name:" or a name given twice is rejected before sending.`,"--no-track-clicks and --no-track-opens are opt-out only for this send; they cannot enable tracking the account has disabled.","--vars-json accepts nested objects and arrays; --var overrides individual scalar keys.","If the recipient matches a subscriber, saved first and last names fill omitted name variables; --var values override them.","For retryable automation, generate one --idempotency-key per logical email and reuse that same key on every retry. Reusing it with different content is rejected."],examples:["sequenzy send user@example.com --template welcome --var firstName=Ana","sequenzy send buyer@example.com ops@example.com --cc billing@example.com --bcc archive@example.com --template order-confirmation",`sequenzy send user@example.com --template welcome --vars-json '{"event":{"items":[{"title":"Plan","description":"Pro"}]}}'`,'sequenzy send user@example.com --subject "Welcome" --html-file ./welcome.html','sequenzy send user@example.com --subject "Your week" --html-file ./weekly.html --track-as weekly-report',`sequenzy send user@example.com --subject "Ticket" --html '<img src="cid:ticket-qr">' --attachments-json '[{"filename":"ticket.png","path":"https://example.com/ticket.png","contentId":"ticket-qr","contentType":"image/png"}]'`,"sequenzy send user@example.com --template trial-reminder --email-type marketing --var firstName=Ana",'sequenzy send user@example.com --subject "StudyBoost test" --html "<p>Hi</p>" --from-email hello@studyboost.com --from-name StudyBoost --reply-to support@studyboost.com --reply-to-name "StudyBoost Support"',"sequenzy send user@example.com --template receipt --idempotency-key order-123-receipt",'sequenzy send user@example.com --template weekly-digest --header "List-Unsubscribe: <https://example.com/unsubscribe/abc>" --header "List-Unsubscribe-Post: List-Unsubscribe=One-Click"']});var rr=Ve.command("campaigns").description("Manage campaigns").action(()=>rr.help());S(rr,{notes:["Campaign creation supports HTML, Sequenzy blocks, or prompt-generated content.","Campaign updates support HTML, Sequenzy blocks, subject, name, labels, and reply-to changes.","Campaign scheduling requires a future ISO timestamp and a verified sending domain.","Use unschedule to return a scheduled campaign to draft, cancel to stop one permanently, and pause/resume to control an active send.",JA],examples:["sequenzy campaigns list --status draft --company comp_123",'sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',"sequenzy campaigns test camp_123 --to you@example.com","sequenzy campaigns unschedule camp_123","sequenzy campaigns cancel camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test"]});rr.command("from-audience").description("Create a draft for a frozen selection of contacts or email activity").option("--name <name>","Draft name").option("--selection-json <json>","Selection object: source contacts or email_activity, with matching contacts or activity settings").option("--selection-file <path>","Read the selection JSON from a file, or - for stdin").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>fr("from-audience",e));var BFe=rr.command("list").description("List campaigns").option("-s, --status <status>","Filter by status").option("--label <labels...>","Filter by label name").option("--limit <count>","Page size from 1 to 100 (defaults to 50)").option("--offset <count>","Zero-based result offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>fr("list",e));S(BFe,{notes:["Results are paginated: the default page size is 50 and --limit is capped at 100.","Read the pagination object (--json) or the trailing hint to page through every campaign with --offset."],examples:["sequenzy campaigns list","sequenzy campaigns list --status draft --company comp_123","sequenzy campaigns list --label edm","sequenzy campaigns list --limit 100 --offset 100"]});var kFe=rr.command("get <id>").description("Get campaign details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("get",{id:e,...t}));S(kFe,{examples:["sequenzy campaigns get camp_123 --company comp_123"]});var RFe=rr.command("audience <id>").description("Show who a campaign will reach, with a live recipient count").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("audience",{id:e,...t}));S(RFe,{notes:["Resolves list and segment names and recomputes the recipient count at read time.","Warns when targeting is unset, because scheduling then sends to every active subscriber."],examples:["sequenzy campaigns audience camp_123 --company comp_123"]});function l5(e){return e.option("--subscriber <id>","Personalize as a stored subscriber").option("--email <email>","Personalize as an ad-hoc contact").option("--first-name <name>","First name for --email").option("--last-name <name>","Last name for --email").option("--attr <key=value...>","Custom attribute for the --email contact (repeatable)").option("--attrs-json <json>","Custom attributes for the --email contact as a JSON object").option("--tag <tags...>","Tag the --email contact carries, for previewing tag conditions (repeatable)").option("--empty-tags","State that the --email contact carries no tags, for previewing empty-tag conditions").option("--var <key=value...>","Extra merge variable (repeatable)").option("--vars-json <json>","Extra merge variables as a JSON object").option("--locale <locale>","Force a localization locale")}function VR(e){return l5(e).option("--tracking","Apply the company's auto-UTM link decoration").option("--out <file>","Write the HTML to a file, or - for stdout").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON")}function WR(e){return l5(e).option("--no-links","Skip live link and image verification").option("--fail-on <severity>","Exit with code 1 when an issue of this severity or worse is found: error or warning").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON")}var YR=["Runs the same checks as the editor's email checker against the saved content, plus live verification of every link and image: broken pages, dead domains, certificate problems, redirect loops, missing https://, localhost/staging/preview URLs, placeholder domains, link shorteners, misleading link text, invalid mailto/tel links, and broken or oversized images.","Also flags leftover placeholder copy (lorem ipsum, [First Name], TODO), name merge tags without a fallback, missing alt text, spam-trigger wording, Gmail clipping risk and email-client compatibility problems.",'Links built from per-recipient merge tags are listed as "personalized" and only syntax-checked. {{company.url}} links are resolved from your company website.',`"Couldn't verify" means the site refused an automated check (for example 401, 403 or 429). It may work in a browser, so it is never counted as broken.`,"Sender settings are not part of this check. Use --fail-on error in CI or scripts to stop on problems."],ZR=["Renders the email exactly as it would be sent, so an external builder or dashboard can show a true preview.","Without --subscriber or --email the email renders for a sample contact and contact-specific merge tags resolve to empty values.","Unresolved merge tags are listed in the summary and under unresolvedMergeTags with --json. Nothing is called unrecognized unless the render knows the contact's attributes, since a bare {{plan}} reads the same attributes as {{subscriber.plan}}, so pass --subscriber, or --email with --attr/--attrs-json, to catch typos. Rendering a transactional email also needs --var/--vars-json, since its tags come from the variables of each send call.",'Conditional blocks that read stored subscriber state (tag, segment, list, status, event, purchases, engagement) can only be evaluated for --subscriber, or for a tag condition with --email plus --tag/--empty-tags. Anything the render cannot evaluate is rendered as false and listed under "Conditions not evaluated", because an else branch in the HTML looks the same either way.',"Links are clean by default. Pass --tracking to apply the company's auto-UTM decoration.","Per-send click redirects and the open pixel are added at send time against a real email send record, so they never appear in a render."],TFe=VR(rr.command("render <id>").description("Render a campaign to email-ready HTML").option("--variant <id>","Render a specific A/B test variant").option("--variation <id>","Render a design variation of the email (from variations list)")).action((e,t)=>Jv({type:"campaign",id:e},t));S(TFe,{notes:ZR,examples:["sequenzy campaigns render camp_123 --out preview.html","sequenzy campaigns render camp_123 --subscriber sub_123 --out -","sequenzy campaigns render camp_123 --email you@example.com --first-name Ada --var plan=Pro","sequenzy campaigns render camp_123 --email you@example.com --tag extended","sequenzy campaigns render camp_123 --email you@example.com --empty-tags","sequenzy campaigns render camp_123 --email you@example.com --attr plan=pro --attr mrr=99 --json","sequenzy campaigns render camp_123 --variant var_123 --tracking --json"]});var OFe=WR(rr.command("check <id>").description("Check a campaign before sending: broken links and images, placeholders, content and client issues").option("--variant <id>","Check a specific A/B test variant")).action((e,t)=>Kv({type:"campaign",id:e},t));S(OFe,{notes:YR,examples:["sequenzy campaigns check camp_123","sequenzy campaigns check camp_123 --fail-on error","sequenzy campaigns check camp_123 --no-links --json"]});var NFe=rr.command("create <name>").description("Create a campaign").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--status <status>","Initial status: draft or sent").option("--sent-at <iso-date>","Sent timestamp when creating with --status sent").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--prompt <prompt>","Generate campaign blocks from a prompt").option("--style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("--tone <tone>","Prompt generation tone: professional, casual, friendly").option("--email-preset <preset>","Style > Format for native blocks: branded or minimal").option("--from-email <email>","Campaign From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>","Existing sender profile ID; carries its own name, so omit --from-email and --from-name").option("--reply-to <email>","Campaign Reply-To address").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile <id>","Existing Reply-To profile ID").option("--label <labels...>","Label names to assign").option("--segment <id>","Target a saved segment").option("--lists <ids...>","Target one or more lists by ID (shorthand for targetLists type 'lists')").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--attach <files...>","Local files to attach to every email (uploaded as Base64)").option("--attachments-json <json>","JSON array of attachments: filename plus Base64 content or a public path URL").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("create",{name:e,...t}));S(NFe,{notes:["--subject is required unless --prompt is provided. With --prompt, the generated subject is used unless --subject is also provided.","Use --preview-text or --preheader-text to set the inbox preview text. With --prompt, the generated preview is used unless one of these flags is provided.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --email-preset branded or minimal to set Style > Format on native blocks. This is not --style, which is a prompt-generation hint.","Use --status sent only to archive an already-sent campaign; it does not send email or create per-recipient delivery history.","Do not combine prompt, HTML flags, and blocks flags in the same request.","Use --segment, --lists, or --target-lists-json to save the audience on the draft. Omit them to set targeting later with campaigns update or campaigns schedule. These audience flags are mutually exclusive.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.',"Use --attach for local files or --attachments-json for URLs: up to 10 files, 5MB in total, sent with every recipient's email. Inline images (contentId) are not supported on campaigns."],examples:['sequenzy campaigns create "April Launch" --prompt "Announce our new analytics dashboard"','sequenzy campaigns create "Weekly Report" --subject "This week" --html-file ./weekly.html --attach ./report.pdf','sequenzy campaigns create "April Launch" --subject "We shipped" --preheader-text "Your quick product update" --html-file ./campaign.html','sequenzy campaigns create "Imported launch" --subject "We shipped" --status sent --sent-at "2026-05-01T14:00:00Z" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns create "Segmented Launch" --subject "We shipped" --blocks-file ./campaign-blocks.json','sequenzy campaigns create "Research note" --subject "Quick question" --blocks-file ./note.json --email-preset minimal',`sequenzy campaigns create "Partner Update" --subject "This month at HolaRuta" --target-lists-json '{"type":"lists","listIds":["list_123"]}'`]});var $Fe=rr.command("update <id>").description("Update a draft campaign").option("-n, --name <name>","Campaign name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--email-preset <preset>","Style > Format for native blocks: branded or minimal").option("--campaign-data-json <json>","Inline campaignData JSON object").option("--campaign-data-file <file>","Path to a JSON file with campaignData").option("--computed-lists-json <json>","Inline computedLists JSON array").option("--computed-lists-file <file>","Path to a JSON file with computedLists").option("--from-email <email>","Campaign From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>","Existing sender profile ID; carries its own name, so omit --from-email and --from-name").option("--reply-to <email>","Set reply-to using an existing reply profile email").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile <id>","Set reply-to using a reply profile ID").option("--label <labels...>","Replace label names").option("--segment <id>","Retarget the draft at a saved segment").option("--lists <ids...>","Retarget the draft at one or more lists by ID (shorthand for targetLists type 'lists')").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--clear-target-lists","Clear saved targeting so the audience is chosen when scheduling").option("--send-time-optimization","Enable per-recipient send-time optimization and clear other saved pacing modes").option("--disable-send-time-optimization","Disable send-time optimization on the draft").option("--send-time-window-hours <hours>","Set the send-time optimization window from 1-24 hours").option("--max-recipients <count>","Send to at most this many audience members (the first N by subscriber id) when the campaign is sent").option("--clear-max-recipients","Remove the recipient limit so the campaign goes to the whole audience").option("--attach <files...>","Replace the attachments with these local files (uploaded as Base64)").option("--attachments-json <json>","Replace the attachments: JSON array of filename plus Base64 content or a public path URL").option("--clear-attachments","Remove every attachment from the draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("update",{id:e,...t}));S($Fe,{notes:["Provide at least one update flag, including subject, preview text, content, email preset, labels, reply-to, campaign data, computed lists, audience, or STO pacing.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --email-preset branded or minimal to change Style > Format on native blocks without rewriting copy.","Use --campaign-data-file and --computed-lists-file to upload personalization data for repeat blocks.","Do not combine HTML flags with blocks flags in the same request.","Use either --reply-to or --reply-profile, not both.","Use --segment, --lists, or --target-lists-json to replace the saved audience, or --clear-target-lists to choose it later at schedule time. These audience flags are mutually exclusive.","Use --send-time-optimization with optional --send-time-window-hours (1-24, default 12), or --disable-send-time-optimization to turn STO off. Enabling STO clears a saved spread or recipient-timezone mode.","Use --max-recipients to send to only the first N matching subscribers (for example while ramping up a new domain), or --clear-max-recipients to remove the cap. The cap is applied when the audience is resolved at send time.","Use --attach or --attachments-json to replace the draft's attachments (up to 10 files, 5MB in total), or --clear-attachments to remove them."],examples:['sequenzy campaigns update camp_123 --subject "Updated subject"','sequenzy campaigns update camp_123 --preheader-text "Updated preview"',"sequenzy campaigns update camp_123 --html-file ./campaign-v2.html","sequenzy campaigns update camp_123 --blocks-file ./campaign-v2-blocks.json","sequenzy campaigns update camp_123 --email-preset minimal","sequenzy campaigns update camp_123 --campaign-data-file ./campaign-data.json --computed-lists-file ./computed-lists.json","sequenzy campaigns update camp_123 --reply-to support@example.com","sequenzy campaigns update camp_123 --label edm api","sequenzy campaigns update camp_123 --segment seg_123","sequenzy campaigns update camp_123 --clear-target-lists","sequenzy campaigns update camp_123 --send-time-optimization --send-time-window-hours 8","sequenzy campaigns update camp_123 --max-recipients 100","sequenzy campaigns update camp_123 --attach ./report.pdf ./terms.pdf","sequenzy campaigns update camp_123 --clear-attachments"]});var PFe=rr.command("schedule <id>").description("Schedule a draft or scheduled campaign").requiredOption("--at <datetime>","Future ISO date/time to send, for example 2026-06-01T14:00:00Z").option("--segment <id>","Target a saved segment").option("--lists <ids...>","Target one or more lists by ID (shorthand for targetLists type 'lists')").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--send-time-optimization","Enable send-time optimization for the scheduled send").option("--disable-send-time-optimization","Disable send-time optimization for the scheduled send").option("--send-time-window-hours <hours>","Set the send-time optimization window from 1-24 hours").option("--spread-over-hours <hours>","Spread delivery over 1-72 hours. Disables send-time optimization when set.").option("--max-recipients <count>","Send to at most this many audience members (the first N by subscriber id). Omit to keep the draft's saved cap.").option("--clear-max-recipients","Remove a saved recipient limit for this send").option("--repeat <interval>","Repeat the campaign weekly or monthly starting at --at. Audience membership is re-evaluated at every run.").option("--in-recipient-timezone","Deliver at --at's wall-clock time in each recipient's own timezone. Requires --scheduled-timezone.").option("--no-in-recipient-timezone","Disable recipient-timezone delivery and use the selected fixed-time pacing strategy.").option("--scheduled-timezone <zone>","IANA zone the --at wall-clock time refers to, for example America/New_York").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("schedule",{id:e,...t}));S(PFe,{notes:["The campaign must be draft or already scheduled.","Omit --segment, --lists, and target lists to reuse saved campaign targeting, or default to all active subscribers.","--segment, --lists, and the target list flags are mutually exclusive.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.',"With --repeat, the campaign becomes a recurring template: each run is duplicated and sent automatically. Use campaigns unschedule to stop the series and return it to draft, or re-schedule without --repeat to keep a one-shot send.","With --in-recipient-timezone, every contact receives the campaign at --at's wall-clock time in their own timezone; contacts without a stored timezone get it at --at in --scheduled-timezone. Not combinable with --repeat or --spread-over-hours.","Use --send-time-optimization with optional --send-time-window-hours (1-24, default 12), or --disable-send-time-optimization to turn STO off. A spread or recipient-timezone send disables STO.","Use --max-recipients to send to only the first N matching subscribers; recipients already reached by this campaign count against the cap on resume. Duplicate the campaign and exclude contacts who already received it to send the next batch."],examples:['sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --segment seg_123','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --lists list_123',`sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-json '{"type":"all"}'`,'sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-file ./target-lists.json','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --spread-over-hours 6','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --max-recipients 100','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --send-time-optimization --send-time-window-hours 8','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --repeat monthly','sequenzy campaigns schedule camp_123 --at "2026-06-01T20:00:00-04:00" --in-recipient-timezone --scheduled-timezone America/New_York']});var QFe=rr.command("test <id>").description("Send a test email for a campaign").requiredOption("--to <email>","Recipient email for the test").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("test",{id:e,...t}));S(QFe,{examples:["sequenzy campaigns test camp_123 --to you@example.com"]});var qFe=rr.command("cancel <id>").description("Cancel a scheduled, paused, or sending campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("cancel",{id:e,...t}));S(qFe,{notes:["Cancelling stops scheduled, paused, waiting-approval, and actively sending campaigns immediately.","No confirmation prompt is shown so a bad send can be stopped fast."],examples:["sequenzy campaigns cancel camp_123"]});var FFe=rr.command("unschedule <id>").description("Return a scheduled campaign to draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("unschedule",{id:e,...t}));S(FFe,{notes:["Only scheduled campaigns can be unscheduled.","Unscheduling removes the pending send and recurrence, then returns the campaign to an editable draft."],examples:["sequenzy campaigns unschedule camp_123"]});var LFe=rr.command("pause <id>").description("Pause a campaign that is currently sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("pause",{id:e,...t}));S(LFe,{notes:["Only campaigns in sending status can be paused."],examples:["sequenzy campaigns pause camp_123"]});var UFe=rr.command("resume <id>").description("Resume a paused campaign").option("--spread-over-hours <hours>","Spread the remaining delivery over 1-72 hours").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("resume",{id:e,...t}));S(UFe,{notes:["Only paused campaigns can be resumed."],examples:["sequenzy campaigns resume camp_123","sequenzy campaigns resume camp_123 --spread-over-hours 6"]});var MFe=rr.command("delete <id>").description("Delete a campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("delete",{id:e,...t}));S(MFe,{notes:["Sending, scheduled, and paused campaigns must be cancelled before they can be deleted."],examples:["sequenzy campaigns delete camp_123 --yes"]});var jFe=rr.command("share <id>").description("Create or fetch the campaign's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("share",{id:e,...t}));S(jFe,{notes:["The hosted page is anonymized: sample contact, inert unsubscribe link, no open/click tracking.","Idempotent - rerunning returns the same URL until you run `campaigns unshare`."],examples:["sequenzy campaigns share camp_123"]});var zFe=rr.command("unshare <id>").description("Revoke the campaign's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("unshare",{id:e,...t}));S(zFe,{notes:["The shared URL returns 404 immediately after revocation."],examples:["sequenzy campaigns unshare camp_123"]});var GFe=rr.command("duplicate <id>").description("Duplicate a campaign as a new draft").option("--mode <mode>","Duplicate mode: campaign, ab_test, or variant","campaign").option("--variant-id <id>","A/B test variant to copy when --mode is variant").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("duplicate",{id:e,...t}));S(GFe,{notes:["Mode campaign copies the campaign email, ab_test also copies the A/B test with all variants, and variant copies one variant's content as a plain campaign."],examples:["sequenzy campaigns duplicate camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test","sequenzy campaigns duplicate camp_123 --mode variant --variant-id var_b"]});var HFe=rr.command("resend-to-non-openers <id>").description("Create a draft resend to subscribers who didn't open a sent campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>fr("resend-to-non-openers",{id:e,...t}));S(HFe,{notes:["Only available 6 hours after a sent campaign finishes sending.","Unavailable for imported already-sent campaigns because Sequenzy has no opens for a send it did not deliver.",`Creates a draft targeting the same audience plus a "didn't open this campaign" rule. Review the draft, then schedule or send it.`,"The response includes an estimate of how many subscribers haven't opened the original.","Every audience format keeps hard opener exclusions across manual additions and repeated resends. Live audience membership can include new subscribers.","Recreate older drafts missing excludedCampaignOpenerIds from the original campaign and review before scheduling."],examples:["sequenzy campaigns resend-to-non-openers camp_123"]});function u5(e){return e.option("--description <text>","Goal description").option("--trigger-type <type>","Goal signal: event, attribute_change, or tag_added").option("--trigger-event-name <event>","Event goal signal name").option("--trigger-tag-name <tag>","Tag name for tag_added goals").option("--attribute-path <path>","Subscriber attribute goal path").option("--attribute-condition <condition>","changed, changed_to, or changed_from_to").option("--attribute-value <value>","Target subscriber attribute value").option("--attribute-previous-value <value>","Previous subscriber attribute value").option("--event-property-name <name>","Optional event property whose value is tracked").option("--event-property-label <label>","Display label for the tracked event property").option("--attribution-window-hours <hours>","Goal attribution window in hours")}var uC=rr.command("goals").description("Manage persisted campaign conversion goals");uC.command("list <campaignId>").description("List campaign goals").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>fr("goals",{id:e,...t}));u5(uC.command("create <campaignId> <name>").description("Create a campaign conversion goal")).option("--active","Create the goal with conversion tracking on (default)").option("--inactive","Create the goal with conversion tracking off").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>fr("goal-create",{id:e,name:t,isActive:n.active,notActive:n.inactive,...n}));u5(uC.command("update <campaignId> <goalId>").description("Update a campaign conversion goal").option("--name <name>","Goal name")).option("--active","Enable the goal").option("--inactive","Disable the goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>fr("goal-update",{id:e,goalId:t,isActive:n.active,notActive:n.inactive,...n}));uC.command("delete <campaignId> <goalId>").description("Delete a campaign conversion goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>fr("goal-delete",{id:e,goalId:t,...n}));var ps=rr.command("variations").description("Compare alternative versions of a campaign email (the editor's Canvas tab)").action(()=>ps.help());S(ps,{notes:["Variations never change what the campaign sends until you run `use`.","`generate` returns at once with variations in the generating state; pass --wait to block until each one is ready or failed.","`section-options` saves nothing: apply an option by swapping its replacement blocks into the variation and running `update`.","`edit` changes one variation with the AI and saves it (optionally only --sections).","--style close keeps the source's style, fresh takes different directions, bold designs each version anew with its own layout, colors and fonts."],examples:['sequenzy campaigns variations generate camp_123 --prompt "Three shorter, warmer versions" --wait','sequenzy campaigns variations generate camp_123 --prompt "Completely new style" --count 2 --style bold --parent var_456','sequenzy campaigns variations edit camp_123 var_456 --prompt "Make the hero dark" --sections hero_1',"sequenzy campaigns variations use camp_123 var_456"]});function d5(e){return e.option("--blocks-json <json>","Email blocks as JSON").option("--blocks-file <path>","Read email blocks JSON from a file").option("--html <html>","HTML content, converted to blocks").option("--html-file <path>","Read HTML content from a file").option("--subject <subject>","Subject this variation uses").option("--preview-text <text>","Preview text this variation uses").option("--summary <text>","What this version changes").option("--email-theme-json <json>","The variation's own email theme as JSON (partial themes are completed; null uses the email's)").option("--email-theme-file <path>","Read the variation's email theme JSON from a file").option("--font-family <family>","The variation's own body font (null uses the email's)")}var p5="close (edit, keep the source's style), fresh (default; new structure, brand look) or bold (new structure, colors and fonts)";ps.command("list <campaignId>").description("List a campaign's variations").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("list",{id:e,...t}));ps.command("get <campaignId> <variationId>").description("Show one variation").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("get",{id:e,variationId:t,...n}));ps.command("generate <campaignId>").description("Generate variations with AI").requiredOption("--prompt <text>","Direction for the new versions").option("--count <n>","How many variations, 1-4 (default 3)").option("--parent <variationId>","Branch from this variation").option("--style <style>",`How far to move: ${p5}`).option("--wait","Wait until every variation is ready or failed").option("--timeout <seconds>","How long --wait waits (default 300)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("generate",{id:e,...t}));d5(ps.command("create <campaignId>").description("Save content as a new variation").requiredOption("--name <name>","Variation name").option("--parent <variationId>","Save it as a branch of this variation")).option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("create",{id:e,...t}));d5(ps.command("update <campaignId> <variationId>").description("Rename a variation, replace its content or move it").option("--name <name>","New name").option("--position <x,y>","Place it on the canvas at these coordinates").option("--reset-position","Let the canvas place it automatically")).option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("update",{id:e,variationId:t,...n}));ps.command("discard <campaignId> <variationId>").description("Discard a variation (restorable)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("discard",{id:e,variationId:t,...n}));ps.command("restore <campaignId> <variationId>").description("Bring back a discarded variation").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("restore",{id:e,variationId:t,...n}));ps.command("use <campaignId> <variationId>").description("Put a variation's content in the campaign email (draft campaigns; the previous content is kept as a variation)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("use",{id:e,variationId:t,...n}));ps.command("edit <campaignId> <variationId>").description("Change one variation with AI and save it").requiredOption("--prompt <text>","What should change").option("--sections <ids>","Only change these comma-separated top-level block ids").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>qs("edit",{id:e,variationId:t,...n}));ps.command("section-options <campaignId>").description("Generate options for selected sections (nothing is saved)").requiredOption("--prompt <text>","What should change").requiredOption("--sections <ids>","Comma-separated top-level block ids").option("--variation <variationId>","Vary this variation instead of the email").option("--count <n>","How many options, 1-4 (default 3)").option("--style <style>",`How far to move: ${p5}`).option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>qs("section-options",{id:e,...t}));var WA=Ve.command("forms").description("Inspect and update saved signup forms").action(()=>WA.help());S(WA,{notes:["Run `forms list --json` before replacing blocks so you can preserve the complete current block array.","Saved-form updates are partial: only the options you pass change.","When Webflow is connected, custom form embeds and their submission endpoints are disabled for that workspace; configure selected native forms in Settings -> Integrations -> Webflow."],examples:["sequenzy forms list --json",'sequenzy forms update form_123 --button-text "Join now"',"sequenzy forms update form_123 --theme-file ./theme.json"]});var JFe=WA.command("list").description("List saved forms and their current content").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including content blocks").action((e)=>Qg("list",e));S(JFe,{examples:["sequenzy forms list","sequenzy forms list --json"]});Ve.command("submissions <type> <id>").description("Read form, popup or landing_page submission payloads").option("-c, --company <id>","Company ID override").option("--field <name>","Exact custom field name (requires --value)").option("--value <value>","Exact answer or array member (requires --field)").option("--limit <count>","Page size, 1 to 100 (default 50)").option("--cursor <cursor>","Resume from nextCursor").option("--json","Print complete JSON payloads and labels").option("--csv","Export all matching pages to stdout").action((e,t,n)=>Qg("submissions",{type:e,id:t,...n}));WA.command("submissions <id>").description("Read saved submitted answers and payloads; --csv exports all matching pages").option("-c, --company <id>","Company ID override").option("--field <name>","Exact custom field name (requires --value)").option("--value <value>","Exact answer or array member (requires --field)").option("--limit <count>","Page size, 1 to 100 (default 50)").option("--cursor <cursor>","Resume from nextCursor").option("--json","Print the complete page including labels and payloads").option("--csv","Export matching pages as CSV to stdout").action((e,t)=>Qg("submissions",{id:e,...t}));var KFe=WA.command("update <id>").description("Update a saved form").option("-n, --name <name>","Saved form name").option("-l, --list <ids...>","Replacement list IDs").option("-t, --tag <ids...>","Replacement tag IDs").option("--clear-tags","Remove every saved form tag").option("--duplicate-strategy <strategy>","Existing subscriber handling: skip, merge, or overwrite").option("--resubscribe-behavior <behavior>","Unsubscribed contacts who submit again: reactivate (default) or double_opt_in").option("--bot-protection","Run a Cloudflare bot check before each signup; failed checks confirm by email").option("--no-bot-protection","Turn the bot check off").option("--headline <text>","First main-form heading text").option("--description <text>","First main-form paragraph text").option("--button-text <text>","Submit button label").option("--success-message <text>","Success screen message").option("--redirect-url <url>","HTTP/HTTPS success redirect; pass an empty string to clear").option("--theme-json <json>","Inline partial capture theme JSON").option("--theme-file <file>","Path to partial capture theme JSON").option("--blocks-json <json>","Inline complete content blocks JSON").option("--blocks-file <file>","Path to complete content blocks JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qg("update",{id:e,...t}));S(KFe,{notes:["Use `forms list --json` and send the complete blocks array when replacing blocks.","The form must retain exactly one email field and one submit button.",'Group sibling blocks with { id, kind: "group", label, layout: "stack" | "row" | "grid" | "overlay", columns, gap, padding, overlayColor, overlayPosition, overlayShade, children }. In Overlay, gap spaces the foreground children while the direct image remains the background. Overlay needs exactly one direct image; nested images only enable their subgroup. Groups may nest three levels; IDs stay unique across the full tree.','Input blocks are { id, kind: "form-field", fieldType, name, label, required, mapsTo, options }. fieldType: text, email, phone, number, textarea, select, radio, checkbox, consent, hidden. mapsTo: email, firstName, lastName, phone, customAttribute (default; stores the answer under `name`). Choice fields need options: [{ value, label, id }] - label and id default to value.',"A hidden field with a defaultValue stores that server-owned value and ignores submitted values; a hidden field without one stores the value the page submits.",'Each block kind accepts only its own properties, and anything else is rejected by name: a custom-html block carries markup in "html" with a pixel "height", not "content".',"Use --clear-tags to replace the current tag targeting with an empty list."],examples:['sequenzy forms update form_123 --headline "Weekly planning" --button-text "Get the planner"',"sequenzy forms update form_123 --list list_123 list_456 --clear-tags","sequenzy forms update form_123 --theme-file ./form-theme.json --blocks-file ./form-blocks.json --json"]});var kc=Ve.command("popups").description("Manage on-site signup popups").action(()=>kc.help());S(kc,{notes:["Popups are the on-site overlay capture surface; `forms` covers inline embedded forms.","A popup is deployed with one script tag - `popups embed <id>` prints it.","When Webflow is connected, `popups embed` returns the native Webflow configuration path instead of custom code, and existing popup scripts stop submitting for that workspace.","Popup updates are partial: only the options you pass change.","Trigger, targeting, schedule, frequency, visual, and reward patches are merged key by key, so setting one key keeps the rest.","A reward turns the popup into a scratch card: the visitor scratches a teaser, claims it with their email, and sees the reward value and code after submitting. The same value is saved to the subscriber's `discount` attribute for {{discount.code}} in emails."],examples:["sequenzy popups list --json",'sequenzy popups create --name "Welcome offer" --template discount-offer --list list_123',"sequenzy popups update pop_123 --status draft","sequenzy popups duplicate pop_123","sequenzy popups embed pop_123"]});var VFe=kc.command("list").description("List saved popups with their status and conversion stats").option("-c, --company <id>","Company ID override for personal API keys").option("--include-content","Include every popup's full content blocks (large)").option("--json","Print raw JSON").action((e)=>Tl("list",e));S(VFe,{notes:["Content blocks are omitted by default because each popup adds roughly 1.8k characters. Use `popups get <id> --json` for one popup's full content."],examples:["sequenzy popups list","sequenzy popups list --json","sequenzy popups list --include-content --json"]});var WFe=kc.command("get <id>").description("Show one popup with its complete content").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including content blocks").action((e,t)=>Tl("get",{id:e,...t}));S(WFe,{notes:["Run this with --json before replacing blocks so you can preserve the complete current block array."],examples:["sequenzy popups get pop_123 --json"]});var YFe=kc.command("create").description("Create a popup and print its embed script").requiredOption("-n, --name <name>","Internal popup name").option("--template <id>","Starting design: newsletter-modal, discount-offer, scratch-to-reveal, countdown-launch, minimal-slide-in, exit-lead-magnet, live-demo, launch-modal, paper-digest, stark-takeover, top-bar, announcement-bar, or fullscreen-welcome").option("--status <status>","draft or published (default: published)").option("-l, --list <ids...>","List IDs every signup is added to").option("--all-lists","Capture into every list (the default)").option("-t, --tag <ids...>","Tag IDs applied to every signup").option("--duplicate-strategy <strategy>","Existing subscriber handling: skip, merge, or overwrite").option("--resubscribe-behavior <behavior>","Unsubscribed contacts who submit again: reactivate (default) or double_opt_in").option("--bot-protection","Run a Cloudflare bot check before each signup; failed checks confirm by email").option("--no-bot-protection","Turn the bot check off").option("--headline <text>","First heading text").option("--description <text>","First paragraph text").option("--button-text <text>","Submit button label").option("--success-message <text>","Success screen message").option("--redirect-url <url>","HTTP/HTTPS success redirect").option("--presentation <mode>","modal, slide-in, floating-bar, or fullscreen").option("--placement <spot>","center, left, right, top, or bottom").option("--trigger-json <json>","Inline partial trigger JSON").option("--trigger-file <file>","Path to partial trigger JSON").option("--targeting-json <json>","Inline partial targeting JSON").option("--targeting-file <file>","Path to partial targeting JSON").option("--schedule-json <json>","Inline partial schedule JSON").option("--schedule-file <file>","Path to partial schedule JSON").option("--frequency-json <json>","Inline partial frequency JSON").option("--frequency-file <file>","Path to partial frequency JSON").option("--visual-json <json>","Inline partial visual JSON").option("--visual-file <file>","Path to partial visual JSON").option("--reward-json <json>","Inline partial scratch-to-reveal reward JSON").option("--reward-file <file>","Path to partial scratch-to-reveal reward JSON").option("--theme-json <json>","Inline partial capture theme JSON").option("--theme-file <file>","Path to partial capture theme JSON").option("--blocks-json <json>","Inline complete content blocks JSON").option("--blocks-file <file>","Path to complete content blocks JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Tl("create",e));S(YFe,{notes:["Popups are published by default, so the embed script is live as soon as you paste it. Use --status draft to stage one.","Omit --list (or pass --all-lists) to capture into every list, matching the dashboard default.",`Trigger example: --trigger-json '{"type":"exit-intent"}' or '{"type":"delay","delaySeconds":10}'.`,`Reward example: --reward-json '{"enabled":true,"value":"10% off your first order","code":"WELCOME10","coverStyle":"gold"}'. The value and code are not in the embed script; the submit response returns them.`],examples:['sequenzy popups create --name "Welcome offer" --template discount-offer --list list_123',`sequenzy popups create --name "Scratch card" --template scratch-to-reveal --reward-json '{"value":"10% off your first order","code":"WELCOME10"}'`,`sequenzy popups create --name "Exit capture" --trigger-json '{"type":"exit-intent"}' --status draft`]});var ZFe=kc.command("update <id>").description("Update a popup, including publishing and unpublishing it").option("-n, --name <name>","Internal popup name").option("--status <status>","draft or published").option("-l, --list <ids...>","Replacement list IDs").option("--all-lists","Capture into every list").option("-t, --tag <ids...>","Replacement tag IDs").option("--clear-tags","Remove every popup tag").option("--duplicate-strategy <strategy>","Existing subscriber handling: skip, merge, or overwrite").option("--resubscribe-behavior <behavior>","Unsubscribed contacts who submit again: reactivate (default) or double_opt_in").option("--bot-protection","Run a Cloudflare bot check before each signup; failed checks confirm by email").option("--no-bot-protection","Turn the bot check off").option("--headline <text>","First heading text").option("--description <text>","First paragraph text").option("--button-text <text>","Submit button label").option("--success-message <text>","Success screen message").option("--redirect-url <url>","HTTP/HTTPS success redirect; pass an empty string to clear").option("--presentation <mode>","modal, slide-in, floating-bar, or fullscreen").option("--placement <spot>","center, left, right, top, or bottom").option("--trigger-json <json>","Inline partial trigger JSON").option("--trigger-file <file>","Path to partial trigger JSON").option("--targeting-json <json>","Inline partial targeting JSON").option("--targeting-file <file>","Path to partial targeting JSON").option("--schedule-json <json>","Inline partial schedule JSON").option("--schedule-file <file>","Path to partial schedule JSON").option("--frequency-json <json>","Inline partial frequency JSON").option("--frequency-file <file>","Path to partial frequency JSON").option("--visual-json <json>","Inline partial visual JSON").option("--visual-file <file>","Path to partial visual JSON").option("--reward-json <json>","Inline partial scratch-to-reveal reward JSON").option("--reward-file <file>","Path to partial scratch-to-reveal reward JSON").option("--theme-json <json>","Inline partial capture theme JSON").option("--theme-file <file>","Path to partial capture theme JSON").option("--blocks-json <json>","Inline complete content blocks JSON").option("--blocks-file <file>","Path to complete content blocks JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Tl("update",{id:e,...t}));S(ZFe,{notes:["Use `popups get <id> --json` and send the complete blocks array when replacing blocks.","The popup must retain exactly one email field and one submit button.",'Group sibling blocks with { id, kind: "group", label, layout: "stack" | "row" | "grid" | "overlay", columns, gap, padding, overlayColor, overlayPosition, overlayShade, children }. In Overlay, gap spaces the foreground children while the direct image remains the background. Overlay needs exactly one direct image; nested images only enable their subgroup. Groups may nest three levels; IDs stay unique across the full tree.','Each block kind accepts only its own properties, and anything else is rejected by name: a custom-html block carries markup in "html" with a pixel "height", not "content".',"`--status draft` stops a popup showing without deleting it or changing the embed script; `--status published` puts it back.","Use --clear-tags to replace the current tag targeting with an empty list, and --all-lists to capture into every list."],examples:['sequenzy popups update pop_123 --headline "Take 10% off" --button-text "Send my code"',"sequenzy popups update pop_123 --status draft",`sequenzy popups update pop_123 --targeting-json '{"paths":["/pricing"],"device":"desktop"}'`]});var XFe=kc.command("duplicate <id>").description("Copy a popup into a new draft with its own stats").option("-n, --name <name>",'Name for the copy (default: "... (copy)")').option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Tl("duplicate",{id:e,...t}));S(XFe,{notes:["The copy starts as a draft with its own view and conversion counts, so the original keeps showing and keeps its stats.","Publish the copy with `popups update <new-id> --status published`."],examples:["sequenzy popups duplicate pop_123",'sequenzy popups duplicate pop_123 --name "Welcome offer v2"']});var e1e=kc.command("embed <id>").description("Print a published popup's embed snippets").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including React, WordPress, and Shopify").action((e,t)=>Tl("embed",{id:e,...t}));S(e1e,{notes:["The popup must be published; publish it with `popups update <id> --status published`.","The snippet carries no API key - trigger, targeting, and audience rules stay server-side."],examples:["sequenzy popups embed pop_123","sequenzy popups embed pop_123 --json"]});var t1e=kc.command("delete <id>").description("Permanently delete a popup and its stats").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Tl("delete",{id:e,...t}));S(t1e,{notes:["This also deletes the popup's view and conversion counts. To stop it showing while keeping its stats, use `popups update <id> --status draft`.","Subscribers the popup already captured are not affected."],examples:["sequenzy popups delete pop_123"]});var eo=Ve.command("landing-pages").description("Manage landing pages").action(()=>eo.help());S(eo,{notes:["Landing pages are created as drafts. Publish only after reviewing the page.","Use landing-pages render to open a signed, unlisted preview of a draft without publishing.","Use --content-json or --content-file for full editor-compatible landing page content.","Custom subdomains require a CNAME record pointing to pages.sequenzydns.com; root domains require an A record pointing to 76.76.21.21."],examples:["sequenzy landing-pages list --company comp_123",'sequenzy landing-pages create "Product Waitlist" --template waitlist',"sequenzy landing-pages render lp_123","sequenzy landing-pages stats lp_123 --period 30d","sequenzy landing-pages publish lp_123","sequenzy landing-pages connect-domain pages.example.com"]});var n1e=eo.command("list").description("List landing pages").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ao("list",e));S(n1e,{examples:["sequenzy landing-pages list --company comp_123"]});var r1e=eo.command("get <id>").description("Get landing page details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("get",{id:e,...t}));S(r1e,{examples:["sequenzy landing-pages get lp_123 --company comp_123"]});var i1e=eo.command("stats <id>").description("Get landing page visit analytics").option("-c, --company <id>","Company ID override for personal API keys").option("--period <period>","Time window: 7d, 30d, 90d, or all").option("--start <timestamp>","Custom range start, ISO 8601").option("--end <timestamp>","Custom range end, ISO 8601").option("--include-bots","Include known crawlers in visit totals").option("--json","Print raw JSON").action((e,t)=>Ao("stats",{id:e,...t}));S(i1e,{notes:["Reports visits, unique visits, clicks, subscribes, conversion rate, referrers, and crawler hits. Preview URLs and the editor are never counted."],examples:["sequenzy landing-pages stats lp_123 --period 30d"]});var o1e=eo.command("render <id>").description("Preview a landing page without publishing it").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("render",{id:e,...t}));S(o1e,{notes:["Returns a signed, unlisted preview URL that works for drafts. Signup forms do not collect contacts until you publish."],examples:["sequenzy landing-pages render lp_123"]});var s1e=eo.command("create [name]").description("Create a draft landing page").option("--slug <slug>","Landing page URL slug").option("--template <template>","Template key, e.g. waitlist").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("create",{name:e,...t}));S(s1e,{notes:["When --content-json/--content-file is omitted, a valid default page is generated from --template."],examples:['sequenzy landing-pages create "Product Waitlist" --template waitlist','sequenzy landing-pages create "Launch Page" --slug launch --content-file ./landing-page.json']});var a1e=eo.command("update <id>").description("Edit a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("update",{id:e,...t}));S(a1e,{examples:['sequenzy landing-pages update lp_123 --name "Updated page"',"sequenzy landing-pages update lp_123 --content-file ./landing-page.json"]});var c1e=eo.command("publish <id>").description("Publish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("publish",{id:e,...t}));S(c1e,{examples:["sequenzy landing-pages publish lp_123"]});var l1e=eo.command("unpublish <id>").description("Unpublish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("unpublish",{id:e,...t}));S(l1e,{examples:["sequenzy landing-pages unpublish lp_123"]});var u1e=eo.command("duplicate <id>").description("Duplicate a landing page as a new draft").option("-n, --name <name>","Name for the copy").option("--slug <slug>","URL slug for the copy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("duplicate",{id:e,...t}));S(u1e,{notes:["The copy is always created as a draft with its own slug, views, and conversions.",'Without --name, the copy is named "<original name> (copy)".'],examples:["sequenzy landing-pages duplicate lp_123",'sequenzy landing-pages duplicate lp_123 --name "Spring Sale v2" --slug spring-sale-v2']});var d1e=eo.command("delete <id>").description("Delete a landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("delete",{id:e,...t}));S(d1e,{examples:["sequenzy landing-pages delete lp_123"]});var p1e=eo.command("connect-domain <domain>").description("Connect a workspace or dedicated landing page domain").option("--landing-page <id>","Connect the domain only to this landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("connect-domain",{domain:e,...t}));S(p1e,{examples:["sequenzy landing-pages connect-domain pages.example.com --company comp_123","sequenzy landing-pages connect-domain offer.example.com --landing-page lp_123","sequenzy landing-pages connect-domain example.com --landing-page lp_123"]});var m1e=eo.command("update-domain-settings").description("Update or verify landing page domain settings").option("--domain <domain>","Replace the connected landing page domain").option("--verify","Refresh domain verification state").option("--landing-page <id>","Target a dedicated landing page domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ao("update-domain-settings",e));S(m1e,{examples:["sequenzy landing-pages update-domain-settings --domain pages.example.com","sequenzy landing-pages update-domain-settings --verify","sequenzy landing-pages update-domain-settings --landing-page lp_123 --verify"]});var f1e=eo.command("remove-domain <landing-page-id>").description("Remove a dedicated domain from one landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ao("remove-domain",{landingPage:e,...t}));S(f1e,{examples:["sequenzy landing-pages remove-domain lp_123"]});var xt=Ve.command("sequences").description("Manage email sequences").action(()=>xt.help());S(xt,{notes:["The CLI supports both AI goal-based sequence creation and explicit-step creation.","Trigger-specific options depend on --trigger. For example: contact_added needs --list-id (or --list-ids for several lists), tag_added needs --tag-name (or --tag-names), inactivity needs --event-name and --inactive-days.","Use --goal for AI generation, or --steps-file / --emails-file with JSON arrays that match the API step objects.","Use --enrollment-mode matching_field for product- or variant-specific event sequences.",'Explicit --steps-file input can include dynamic Stripe or Shopify discount actions with {"type":"create_discount","discount":{"provider":"stripe","discountType":"percent","percentOff":20,"duration":"once","appliesToAllPlans":true}}; the code is created when each subscriber reaches the step, and later emails can use {{discount.code}}.',"Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling.",JA],examples:["sequenzy sequences list --company comp_123",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation"',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json","sequenzy sequences enable seq_123","sequenzy sequences simulate seq_123","sequenzy sequences simulate seq_123 --email maya@example.com"]});var g1e=xt.command("list").description("List sequences").option("--status <status>","Filter by draft, active, paused, or archived").option("--search <text>","Search sequence names and descriptions").option("--label <labels...>","Filter by dashboard label names").option("--limit <count>","Page size from 1 to 100").option("--offset <count>","Zero-based result offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Bn("list",e));S(g1e,{examples:["sequenzy sequences list --company comp_123"]});var A1e=xt.command("get <id>").description("Get sequence details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("get",{id:e,...t}));S(A1e,{examples:["sequenzy sequences get seq_123 --company comp_123"]});var h1e=xt.command("pull [key]").description("Save sequence definitions as YAML or JSON files").option("--id <sequenceId>","Pull a sequence that has no key yet, by its id").option("--key <key>","With --id: the key to give the pulled definition").option("--all","Pull every sequence that has a key").option("--dir <dir>","Directory to write files to (default: current directory)").option("--format <format>","yaml (default) or json").option("--stdout","Print the definition instead of writing a file").option("--raw","Pull the explicit form (every step plus a connections list) instead of the readable one").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>p9(e,t));S(h1e,{notes:["A definition is one document per sequence: settings, steps and connections, addressed by keys you choose.","Pushing a pulled file back unchanged changes nothing."],examples:["sequenzy sequences pull onboarding --dir sequences","sequenzy sequences pull --all --dir sequences","sequenzy sequences pull --id seq_123 --key onboarding --dir sequences"]});var y1e=xt.command("new <key>").description("Write a starter sequence definition file").option("--dir <dir>","Directory to write it to (default: current directory)").option("--name <name>","Sequence name (default: from the key)").action((e,t)=>f9(e,t));S(y1e,{examples:["sequenzy sequences new onboarding --dir sequences","sequenzy sequences push sequences/onboarding.yaml --dry-run"]});var b1e=xt.command("push <paths...>").description("Create or update sequences from definition files").option("--dry-run","Show what would change without saving").option("--confirm-live-change","Allow changes to active sequences (they affect current and future recipients)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>m9(e,t));S(b1e,{notes:["Accepts .yaml, .yml and .json files or directories of them. A file without a key uses its file name.","A push never turns a sequence on or off. New sequences start as drafts managed by code, so their steps are read-only in the dashboard.","Steps are matched by key. Contacts waiting on a removed step continue to the next step."],examples:["sequenzy sequences push sequences --dry-run","sequenzy sequences push sequences/onboarding.yaml","sequenzy sequences push sequences --confirm-live-change"]});var v1e=xt.command("edit-emails <id>").description("Change the sequence's emails with AI in one request: every email, the ones the prompt names, or the ones you list").requiredOption("--prompt <text>","What should change").option("--emails <ids>","Only these comma-separated email IDs (from sequences get)").option("--sections <ids>","Only these comma-separated top-level block IDs; needs exactly one --emails ID").option("--dry-run","Return the changes without saving them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>A9({id:e,...t}));S(v1e,{notes:['Without --emails, the prompt decides: it changes every email unless it names some ("change the structure of email 2").',"A look change (background, colors, fonts) is made identical across the emails it touches.","A/B test steps, HTML emails and steps without an email are skipped and listed.","Each email succeeds or fails on its own; changed emails are saved unless --dry-run is set. One request edits up to 12 emails; edit longer sequences in batches with --emails. If the command times out, run sequences get before retrying: changes may already be saved."],examples:['sequenzy sequences edit-emails seq_123 --prompt "Make the background cream"','sequenzy sequences edit-emails seq_123 --prompt "Remove the header" --dry-run --json','sequenzy sequences edit-emails seq_123 --prompt "New structure" --emails email_2','sequenzy sequences edit-emails seq_123 --prompt "Stronger headline" --emails email_2 --sections hero_1']});var Lm=xt.command("variations").description("Design variations of one email of a sequence, then use one for it or every email (the editor's Emails view)").action(()=>Lm.help());S(Lm,{notes:["Variations never change the email until you run `use`.","`generate` returns at once with variations in the generating state; pass --wait to block until each one is ready or failed.","`use` saves the variation's design (blocks, theme, font) into the email, which keeps its subject and preview text. With --all, every other email takes its style too, keeping its own words.","Preview one with: sequenzy sequences render <id> --node <nodeId> --variation <variationId>"],examples:['sequenzy sequences variations generate seq_123 --email email_1 --prompt "A few bolder versions" --wait',"sequenzy sequences variations list seq_123 --email email_1","sequenzy sequences variations use seq_123 var_456 --email email_1 --all --dry-run","sequenzy sequences variations discard seq_123 var_456 --email email_1"]});Lm.command("list <id>").description("List an email's variations").requiredOption("--email <emailId>","The email's ID (from sequences get)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>UA("list",{id:e,...t}));Lm.command("generate <id>").description("Design variations of an email with AI").requiredOption("--email <emailId>","The email's ID (from sequences get)").requiredOption("--prompt <text>","What the variations should explore").option("--count <n>","How many variations, 1-4 (default 3)").option("--style <style>","close (keep its style), fresh (default; other structures, brand look) or bold (also its own look)").option("--wait","Wait until every variation is ready or failed").option("--timeout <seconds>","How long --wait waits (default 300)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>UA("generate",{id:e,...t}));Lm.command("use <id> <variationId>").description("Save a variation's design into the email, or with --all every email's style").requiredOption("--email <emailId>","The email's ID (from sequences get)").option("--all","Every other email takes the variation's style too").option("--dry-run","Show what would change without saving").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>UA("use",{id:e,variationId:t,...n}));Lm.command("discard <id> <variationId>").description("Discard a variation").requiredOption("--email <emailId>","The email's ID (from sequences get)").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>UA("discard",{id:e,variationId:t,...n}));var E1e=VR(xt.command("render <id>").description("Render one sequence email step to email-ready HTML").requiredOption("--node <nodeId>","Email step node ID from sequences get").option("--variant <id>","Render a specific A/B test variant").option("--variation <id>","Render a design variation of the email (from variations list)")).action((e,t)=>Jv({type:"sequence-step",sequenceId:e,nodeId:t.node},t));S(E1e,{notes:ZR,examples:["sequenzy sequences render seq_123 --node node_1 --out preview.html","sequenzy sequences render seq_123 --node node_1 --subscriber sub_123 --json","sequenzy sequences render seq_123 --node node_1 --email you@example.com --tag extended"]});var I1e=WR(xt.command("check <id>").description("Check one sequence email step: broken links and images, placeholders, content and client issues").requiredOption("--node <nodeId>","Email step node ID from sequences get").option("--variant <id>","Check a specific A/B test variant")).action((e,t)=>Kv({type:"sequence-step",sequenceId:e,nodeId:t.node},t));S(I1e,{notes:YR,examples:["sequenzy sequences check seq_123 --node node_1","sequenzy sequences check seq_123 --node node_1 --fail-on warning --json"]});var C1e=xt.command("test <id>").description("Send a test email for one saved sequence step").requiredOption("--node <nodeId>","Email step node ID from sequences get").requiredOption("--to <emails...>","One or more reviewer email addresses (maximum 10)").option("--attr <key=value...>","Render as a contact with this custom attribute (repeatable); contacts are not changed").option("--attrs-json <json>","Render as a contact with these custom attributes, as a JSON object").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("test",{id:e,...t,nodeId:t.node}));S(C1e,{notes:["This sends only the selected saved email step; it does not enable the sequence or enroll subscribers.","Use sequences get first to find the email step nodeId.","--attr/--attrs-json override the recipients' stored attributes for this render only (merge tags and block conditions), so reviewers see the version a contact with those values gets. --attr wins over --attrs-json for the same key; values from --attr are strings. When a reviewer is a stored contact, email and name keys such as firstName or name come from that contact and are ignored."],examples:["sequenzy sequences test seq_123 --node node_email_2 --to reviewer@example.com","sequenzy sequences test seq_123 --node node_email_2 --to reviewer-one@example.com reviewer-two@example.com",`sequenzy sequences test seq_123 --node node_email_2 --to reviewer@example.com --attrs-json '{"trader_type":"prop_firm","goals":["bias","ai"]}'`]});xt.command("test-run <id>").description("Run real sequence actions for one subscriber with optional event properties").requiredOption("--subscriber <id>","Active subscriber ID").option("--event-properties <json>","Trigger event properties as a JSON object, including arrays and nested objects").option("--speed-multiplier <number>","Delay acceleration, 60 to 10000","120").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("test-run",{id:e,...t}));xt.command("test-run-get <id> <runId>").description("Inspect live sequence test status and step logs").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON including step logs").action((e,t,n)=>Bn("test-run-get",{id:e,runId:t,...n}));var w1e=xt.command("simulate <id>").description("Preview who a sequence would enroll and, optionally, one contact's path. Does not send mail or enroll anyone.").option("--subscriber <id>","Walk the graph for this stored subscriber").option("--email <address>","Walk the graph for this stored subscriber email").option("--limit <number>","Maximum current matches to sample (1-25)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("simulate",{id:e,...t,simulateEmail:typeof t.email==="string"?t.email:void 0}));S(w1e,{notes:["Without --subscriber/--email this reports who currently matches and whether the sequence is ready. Nobody is auto-enrolled when you activate; list, tag, and segment matches can still be enrolled by hand.","This does not send mail, mint discounts, or write tags. Use sequences test to send one saved email step to a reviewer.","Readiness errors are the same checks that should be fixed before sequences enable."],examples:["sequenzy sequences simulate seq_123","sequenzy sequences simulate seq_123 --email maya@example.com","sequenzy sequences simulate seq_123 --subscriber sub_123 --limit 25 --json"]});function m5(e){return e.option("--description <text>","Goal description").option("--trigger-type <type>","Goal signal: event, attribute_change, or tag_added").option("--trigger-event-name <event>","Event goal signal name").option("--trigger-tag-name <tag>","Tag name for tag_added goals").option("--attribute-path <path>","Subscriber attribute goal path").option("--attribute-condition <condition>","changed, changed_to, or changed_from_to").option("--attribute-value <value>","Target subscriber attribute value").option("--attribute-previous-value <value>","Previous subscriber attribute value").option("--event-property-name <name>","Optional event property whose value is tracked").option("--event-property-label <label>","Display label for the tracked event property").option("--attribution-window-hours <hours>","Goal attribution window in hours")}var dC=xt.command("goals").description("Manage persisted sequence conversion goals");dC.command("list <sequenceId>").description("List sequence goals").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("goals",{id:e,...t}));m5(dC.command("create <sequenceId> <name>").description("Create a sequence conversion goal")).option("--active","Create the goal with conversion tracking on (default)").option("--inactive","Create the goal with conversion tracking off").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>Bn("goal-create",{id:e,name:t,isActive:n.active,notActive:n.inactive,...n}));m5(dC.command("update <sequenceId> <goalId>").description("Update a sequence conversion goal").option("--name <name>","Goal name")).option("--active","Enable the goal").option("--inactive","Disable the goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>Bn("goal-update",{id:e,goalId:t,isActive:n.active,notActive:n.inactive,...n}));dC.command("delete <sequenceId> <goalId>").description("Delete a sequence conversion goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t,n)=>Bn("goal-delete",{id:e,goalId:t,...n}));var XR=xt.command("webhook").description("Manage a sequence inbound webhook endpoint");XR.command("get <sequenceId>").description("Read a sequence inbound webhook URL and setup status").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("webhook-get",{id:e,...t}));XR.command("configure <sequenceId>").description("Create or update a sequence inbound webhook endpoint").option("--field-mapping-json <json>","Inline mapping with email, optional names, and property paths").option("--field-mapping-file <file>","JSON file containing the webhook field mapping").option("--sample-payload-json <json>","Inline representative webhook payload").option("--sample-payload-file <file>","JSON file containing a representative webhook payload").option("--clear-field-mapping","Clear the saved mapping and return the endpoint to pending setup").option("--clear-sample-payload","Clear the saved sample payload").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("webhook-configure",{id:e,...t}));XR.command("rotate <sequenceId>").description("Rotate a sequence inbound webhook secret and URL").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((e,t)=>Bn("webhook-rotate",{id:e,...t}));var S1e=xt.command("create <name>").description("Create a blank, AI-generated, or explicit-step sequence").option("-t, --trigger <trigger>","Sequence trigger type (defaults to contact_added; manual never auto-enrolls)").option("--description <text>","Sequence description").option("--label <labels...>","Dashboard label names to assign").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>",X9).option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile-id <id>","Existing reply profile ID; carries its own name, so omit --reply-to and --reply-to-name").option("--bcc-emails <emails>","Comma-separated sequence-level BCC addresses (max 10)").option("-g, --goal <goal>","AI generation goal for the sequence").option("--email-count <count>","Number of AI-generated emails when using --goal (1-10)").option("--duration-days <days>","Total duration in days for AI-generated sequence delays when using --goal").option("--email-style <style>","Style for AI-generated emails when using --goal: visual (designed) or plain (text-first)").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--respect-frequency-cap","Skip email steps for contacts already at the company frequency cap").option("--active-subscribers-only","Only enroll active contacts; unsubscribed and bounced contacts do not enter").option("--send-to-not-subscribed <mode>","Send marketing emails to not subscribed contacts too: on, off, or default (on for ecommerce.checkout_started triggers, off otherwise)").option("--key-date <entries...>",'Key date as "Label=2026-11-27T00:00:00" (repeatable; zone-less times are read in --key-dates-timezone); optionally "key:Label=..." to pin the key. Requires --key-dates-timezone').option("--key-dates-timezone <timezone>","IANA timezone the key dates are written in, e.g. America/New_York").option("--key-dates-json <json>",'Inline key dates: {"timezone":"America/New_York","dates":[{"label":"Black Friday starts","at":"2026-11-27T00:00:00-05:00"}]}').option("--key-dates-file <file>","JSON file with the key dates object").option("--send-spread-hours <hours>","Spread each countdown email over this many hours so contacts get it at different times (default 4; 0 sends everyone at the exact time)").option("--list-id <id>","List ID for contact_added triggers").option("--list-ids <ids...>","Several list IDs for contact_added; joining any one of them enrols the contact").option("--list-scope <scope>","contact_added with no list: any_contact (default, includes contacts in no list) or any_list").option("--tag-name <name>","Tag name for tag_added triggers").option("--tag-names <names...>","Several tag names for tag_added; receiving any one of them enrols the contact").option("--segment-id <id>","Segment ID for segment_entered and segment_exited triggers").option("--stop-on-segment-exit","Cancel active enrollments when a contact leaves the trigger segment").option("--event-name <name>","Event name for event_received, inbound_webhook, inactivity, and frequency triggers").option("--integration-slug <slug>","Inbound webhook integration slug").option("--integration-event-key <key>","Inbound webhook integration event key").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file with a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline JSON array of event property filters for event_received triggers").option("--property-filters-file <file>","Path to a JSON file with event property filters").option("--inactive-days <days>","Days of inactivity for inactivity triggers").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum event count for frequency triggers").option("--time-window-days <days>","Time window for frequency triggers").option("--steps-json <json>","Inline JSON array of sequence steps").option("--steps-file <file>","Path to a JSON file with sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("create",{name:e,...t}));S(S1e,{notes:["Provide --goal for AI generation, --steps-json/--steps-file for explicit content, or omit both for a blank dashboard-compatible draft.","Each explicit email step needs subject plus either html or blocks. Discount action steps use type=create_discount to dynamically create a code before an email that references {{discount.code}}.",'SMS steps use type="sms" with a plain-text "text" field (optional label, ineligibleAction skip|exit, imageUrls). Generate copy with `sequenzy generate sms` and check `sequenzy sms settings` first.','Update Subscriber steps use type="update_subscriber", nodeType="action_update_attributes", and config values such as {{event.plan}}, {{event.amount}}, or {{event.active}}.',"For migrated provider flows, put the exact provider HTML in each step's html field; Sequenzy stores it as raw HTML. Use delay or delayMs for waits.",'A step may use waitUntilWeekday to hold until the next weekday window, e.g. {"waitUntilWeekday":{"day":"sunday","startTime":"09:00","endTime":"12:00","timezone":"America/Los_Angeles"},"subject":"Weekly digest","html":"..."}. Contacts already inside the window continue immediately; put it before the first email to guarantee the send day at the graph level. Add "timezoneSource":"subscriber" to use the timezone of each contact; timezone is then the fallback for contacts without one. Add "minimumWait":{"days":6} to wait at least 6 days first, then release at the next window, in one step.',"Prefer --steps-file for anything non-trivial. The CLI passes the JSON through to the API.","Shopify replenishment and back-in-stock event sequences default to matching_field.","Use --enrollment-field-path for custom event keys such as order.id or product.providerVariantId.",'Calendar countdowns: use --trigger manual with --key-date entries (plus --key-dates-timezone) and give steps a waitUntilKeyDate, e.g. {"subject":"7 days to go","waitUntilKeyDate":{"key":"black_friday_starts","days":7}}. Keys are slugs of the labels. Then enable the sequence and run sequenzy sequences enroll-audience.',"Use --property-filters-json/--property-filters-file with event_received triggers to only start the sequence when the event properties match, e.g. scope a purchase sequence to one product.","Use --sending-window-start/--sending-window-end/--sending-window-timezone to hold every email step until the allowed local send window. Add --sending-window-days weekdays for working days only.","Use --trigger segment_exited --segment-id <id> to enroll active contacts who stop matching a saved segment, for example a win-back flow. Unsubscribing or bouncing does not count as leaving, and nobody is enrolled when the sequence is turned on.","Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling.","For customer lifecycle state (customer, trial, past-due, cancelled, churned, refunded, visited-payment-page) prefer --trigger tag_added on the tag over the matching saas.* event: the tag is the contact's current state, also covers imported or hand-tagged contacts, and removing it ends the run. These tags start sequences only when the company's sync rules add them; check `sequenzy sync-rules get` and ask before turning the preset on. Keep event_received when emails need that occurrence's data ({{event.hostedInvoiceUrl}}) or must run once per occurrence."],examples:["sequenzy sequences create dunning --trigger tag_added --tag-name past-due --enrollment-mode unlimited --steps-file ./steps.json",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation" --email-count 4 --duration-days 10','sequenzy sequences create trial --trigger tag_added --tag-name trial --goal "Convert trial users" --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays',"sequenzy sequences create restock --trigger event_received --event-name ecommerce.back_in_stock --enrollment-mode matching_field --steps-file ./steps.json",`sequenzy sequences create deliver-ebook --trigger event_received --event-name ecommerce.order_placed --property-filters-json '[{"path":"lineItems[].providerProductId","operator":"equals","value":"prod_123"}]' --steps-file ./steps.json`,"sequenzy sequences create post-purchase --trigger event_received --event-name ecommerce.order_placed --enrollment-mode matching_field --enrollment-field-path order.id --steps-file ./steps.json",'sequenzy sequences create "Black Friday countdown" --trigger manual --enrollment-mode one_time --key-dates-timezone America/New_York --key-date "Black Friday starts=2026-11-27T00:00:00" --key-date "Black Friday ends=2026-11-29T23:59:00" --steps-file ./countdown-steps.json',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json",`sequenzy sequences create purchase-profile --trigger event_received --event-name saas.purchase --steps-json '[{"type":"update_subscriber","nodeType":"action_update_attributes","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}},{"subject":"Thanks","html":"<p>Purchase received.</p>"}]'`,"sequenzy sequences create rescue --trigger inactivity --event-name login --inactive-days 14 --steps-file ./steps.json"]});var D1e=xt.command("from-example <example>").description("Clone an email gallery sequence into a draft sequence written for your brand").option("--brief <text>","Extra direction for every email (takes priority over the example)").option("--name <name>","Sequence name (defaults to the sequence type)").option("--steps <numbers>","Which of the example's emails to clone, by position, e.g. 1,2,4 (default: the first 12)").option("--email-style <style>","Generated email style: visual or plain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>U3(e,t));S(D1e,{notes:["<example> is a gallery sequence URL (https://sequenzy.com/email-examples/brands/{brand}/sequences/{sequence}) or brand/sequence.","Copies the trigger family and send timing (up to 12 emails; --steps picks which, and each kept email keeps its original timing). AI writes each email in your brand in the background; check progress with sequenzy sequences get <id>.","The sequence is created as a draft and sends nothing until you enable it. Running the command again creates another sequence."],examples:["sequenzy sequences from-example https://sequenzy.com/email-examples/brands/linear/sequences/onboarding",'sequenzy sequences from-example linear/onboarding --brief "Push people to invite a teammate"',"sequenzy sequences from-example linear/onboarding --steps 1,2,4"]});var _1e=xt.command("templates").description("List ready-made sequence templates for your company category (including push-first mobile app journeys)").option("--category <type>","company (default), all, saas, content, ecommerce, offline, mobile_app or other").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>v9(e));S(_1e,{notes:["Defaults to your company category (sequenzy companies get), with templates built for it first. Set the category with sequenzy companies update <id> --category mobile_app.","Mobile journeys (mobile_app) trigger on RevenueCat, Superwall and Adapty events (saas.trial_started, saas.payment_failed, saas.cancelled, saas.churn, saas.purchase.yearly) and on app activity (paywall_viewed, app.screen_viewed)."],examples:["sequenzy sequences templates","sequenzy sequences templates --category mobile_app --json"]});var x1e=xt.command("create-from-template <templateId>").description("Create a draft sequence from a template, as the dashboard does").option("--name <name>","Sequence name (defaults to the template name)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>E9(e,t));S(x1e,{notes:["Push-first journeys branch on whether the contact is reachable by push (an active device on a platform with APNs, FCM or web push set up): those contacts get push and in-app, everyone else gets email. Waits land between 09:00 and 21:00 in each contact's timezone.","Emails are written by AI from your brand; push and in-app copy comes from the template, so review it in the dashboard or with sequenzy sequences get <id> before enabling.","Calendar templates that count down to key dates (Black Friday) are created in the dashboard or with sequenzy sequences create --key-dates."],examples:["sequenzy sequences create-from-template mobile-trial-conversion",'sequenzy sequences create-from-template mobile-billing-recovery --name "Billing recovery"']});var B1e=xt.command("preview-example <example>").description("Preview the first emails of an email gallery sequence written for your brand, without saving").option("--website <site>","Write it for another website instead of your brand, e.g. acme.com").option("--brief <text>","Extra direction for every email (takes priority over the example)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including each email's HTML").action((e,t)=>H3(e,t));S(B1e,{notes:["<example> is a gallery sequence URL (https://sequenzy.com/email-examples/brands/{brand}/sequences/{sequence}) or brand/sequence.","Rewrites the first 3 emails and saves nothing. Clone the sequence with sequenzy sequences from-example to write every email."],examples:["sequenzy sequences preview-example linear/onboarding","sequenzy sequences preview-example linear/onboarding --website acme.com --json"]});var k1e=xt.command("update <id>").description("Update sequence metadata, email step content, stop conditions, or paths").option("-n, --name <name>","Sequence name").option("--description <text>","Sequence description").option("--label <labels...>","Replace dashboard label names").option("--clear-labels","Remove all dashboard labels from the sequence").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--trigger <trigger>","Replace the sequence trigger type").option("--list-id <id>","List ID for contact_added").option("--list-ids <ids...>","Several list IDs for contact_added; joining any one of them enrols the contact").option("--list-scope <scope>","contact_added with no list: any_contact (default, includes contacts in no list) or any_list").option("--tag-name <name>","Tag name for tag_added").option("--tag-names <names...>","Several tag names for tag_added; receiving any one of them enrols the contact").option("--segment-id <id>","Segment ID for segment_entered or segment_exited").option("--stop-on-segment-exit","Stop active enrollments when a contact leaves the trigger segment").option("--no-stop-on-segment-exit","Keep active enrollments running when a contact leaves the trigger segment").option("--event-name <event>","Event name for event, webhook, inactivity, or frequency triggers").option("--integration-slug <slug>","Catalog integration slug for inbound_webhook").option("--integration-event-key <key>","Catalog event key for inbound_webhook").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file containing a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline event trigger property filters").option("--property-filters-file <file>","JSON file containing event trigger property filters").option("--inactive-days <days>","Days required for inactivity").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum frequency event count").option("--time-window-days <days>","Frequency lookback window").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email; picks or creates the identity of that name on the address").option("--sender-profile-id <id>",eZ).option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to; a saved profile keeps its own name and the response warns").option("--reply-profile-id <id>","Existing reply profile ID; carries its own name, so omit --reply-to and --reply-to-name").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--pause-new-enrollments","Stop new sequence enrollments while current recipients continue").option("--resume-new-enrollments","Resume new sequence enrollments while current recipients continue").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--clear-sending-window","Disable the sequence sending window").option("--respect-frequency-cap","Skip email steps for contacts already at the company frequency cap").option("--ignore-frequency-cap","Stop applying the company frequency cap to this sequence").option("--active-subscribers-only","Only enroll active contacts; unsubscribed and bounced contacts do not enter").option("--send-to-not-subscribed <mode>","Send marketing emails to not subscribed contacts too: on, off, or default (on for ecommerce.checkout_started triggers, off otherwise)").option("--include-suppressed-subscribers","Let unsubscribed and bounced contacts enter again (marketing emails stay skipped)").option("--key-date <entries...>",'Key date as "Label=2026-11-27T00:00:00" (repeatable; zone-less times are read in --key-dates-timezone); optionally "key:Label=..." to pin the key. Requires --key-dates-timezone').option("--key-dates-timezone <timezone>","IANA timezone the key dates are written in, e.g. America/New_York").option("--key-dates-json <json>",'Inline key dates: {"timezone":"America/New_York","dates":[{"label":"Black Friday starts","at":"2026-11-27T00:00:00-05:00"}]}').option("--key-dates-file <file>","JSON file with the key dates object").option("--send-spread-hours <hours>","Spread each countdown email over this many hours so contacts get it at different times (default 4; 0 sends everyone at the exact time)").option("--clear-key-dates","Remove every key date from the sequence").option("--auto-enroll-all","Keep enrolling every new contact until the last key date (manual countdowns)").option("--auto-enroll-list-ids <ids...>","Keep enrolling people who join these lists until the last key date").option("--auto-enroll-segment-id <id>","Keep enrolling people who enter this segment until the last key date").option("--auto-enroll-json <json>","Keep enrolling later joiners of this audience object until the last key date").option("--auto-enroll-starts-at <datetime>","With --auto-enroll-*, do not sync before this ISO 8601 date-time (match a scheduled enroll-audience start)").option("--clear-auto-enroll","Stop auto-enrolling later joiners").option("--bcc-emails <emails>","Comma-separated BCC addresses copied on every email this sequence sends, e.g. a support inbox (max 10)").option("--clear-bcc-emails","Remove the sequence BCC addresses").option("--confirm-structural-change","Confirm an insertSteps or branch structural edit to an active sequence").option("--confirm-live-change","Confirm node config edits to an active sequence").option("--steps-json <json>","Inline JSON array of step updates").option("--steps-file <file>","Path to a JSON file with step updates").option("--emails-json <json>","Inline JSON array of email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal, and emailTheme patches that one step's theme (null clears the override)").option("--emails-file <file>","Path to a JSON file with email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal, and emailTheme patches that one step's theme (null clears the override)").option("--sms-steps-json <json>","Inline JSON array of SMS step content updates (targeted by nodeId)").option("--sms-steps-file <file>","Path to a JSON file with SMS step content updates").option("--subscriber-update-steps-json <json>","Inline JSON array of Update Subscriber configs targeted by nodeId").option("--subscriber-update-steps-file <file>","Path to a JSON file with Update Subscriber configs targeted by nodeId").option("--branch-json <json>","Inline JSON object for inserting an if/else branch, or a random A/B split, with path steps and/or existing target node IDs").option("--branch-file <file>","Path to a JSON file for inserting an if/else branch with path steps and/or existing target node IDs").option("--insert-steps-json <json>","Inline JSON object for inserting new linear steps").option("--insert-steps-file <file>","Path to a JSON file for inserting new linear steps").option("--node-updates-json <json>","Inline typed nodeUpdates array from sequences get; action_email changes accept emailTheme to restyle one step without touching the company theme").option("--node-updates-file <file>","JSON file containing typed nodeUpdates").option("--graph-edit-json <json>","Inline graphEdit object using the current graphRevision").option("--graph-edit-file <file>","JSON file containing a graphEdit operation").option("--stop-condition-json <json>","Inline JSON object for updating the sequence stop condition").option("--stop-condition-file <file>","Path to a JSON file for updating the sequence stop condition").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("update",{id:e,...t}));S(k1e,{notes:["Use either the steps form or the emails form, not both.","Each update entry can target a step by nodeId, emailId, or by array order.","Use --insert-steps-json/--insert-steps-file to add new linear steps, including outbound webhooks and AI steps; use --steps-* or --emails-* to edit existing email steps.",'AI steps generate a short per-contact fragment at send time (a sentence or two that a later email inserts, not a whole email): {"nodeType":"action_ai","config":{"prompt":"Write a winback subject for {{first_name}}","resultKey":"winback","outputFields":[{"key":"subject_line","fallback":"We miss you"}]}}. Later steps use {{ai.winback.subject_line}}. Opt into context with includeTags, includeEventProperties, includeRecentEvents (plus recentEventLimit, 1-50), and includeAttributes.','Inserted steps can be SMS steps: {"type":"sms","text":"...","delay":{"days":1}}. Generate copy with `sequenzy generate sms`.','Edit existing SMS steps with --sms-steps-json/--sms-steps-file: [{"nodeId":"node_sms","text":"New message"}]. Entries may also update label and ineligibleAction.','Edit existing Update Subscriber steps with --subscriber-update-steps-json/--subscriber-update-steps-file: [{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}}].',"For migrated provider flow steps, use html/htmlContent to preserve exact HTML as raw HTML and use delay or delayMs for waits.",'A step may use waitUntilWeekday to hold until the next weekday window, e.g. {"type":"delay","waitUntilWeekday":{"day":"sunday","startTime":"09:00","endTime":"12:00","timezone":"America/Los_Angeles"}}. Contacts already inside the window continue immediately. Add "timezoneSource":"subscriber" to use the timezone of each contact, with timezone as the fallback for contacts without one. Add "minimumWait":{"days":6} to wait at least that long before the window. Place it before the first email to guarantee the send day at the graph level (a sequence sendingWindow only shifts send times).',"When inserting steps or branches into an active sequence, pass --confirm-structural-change after confirming the live-flow impact.",'Use --stop-condition-json/--stop-condition-file with values like {"type":"has_tag","value":"customer"}; use {"type":"none","value":null} to clear it.','event_received stop conditions only match events received after enrollment. Add matchConfig to narrow them: {"type":"event_received","value":"product.quota_used","matchConfig":{"mode":"event_property_filter","propertyFilters":[{"path":"quota_used","operator":"greater_than","value":1}]}} stops only when a later event matches every filter (operators: exists, not_exists, equals, not_equals, one_of, contains, greater_than, less_than). {"mode":"event_property","rules":[{"entryFieldPath":"orderId","eventFieldPath":"orderId"}]} stops only when the stop event matches the enrolling event on that field. For field_changed, {"mode":"field_value","operator":"equals","value":"pro"} stops only when the field changes to a matching value.','Stop conditions are re-evaluated before every step, including the first, so {"type":"does_not_have_tag","value":"allowlist"} and {"type":"removed_from_list","value":"list_123"} act as an allowlist: contacts without that tag or list are cancelled before any step sends. Use this to point a live trigger at a chosen set of contacts without editing the graph. Guarded-out contacts still enroll and are then cancelled at the trigger node, so they appear as cancellations there rather than in the active or waiting enrollment counts.',"Clearing the guard does not retry the contacts it already cancelled: nothing re-enrolls them, so they only receive the sequence if the trigger fires for them again, which one-shot triggers never do. On the one_time enrollment mode a repeated trigger is ignored too, because enrollment is blocked by the existence of any earlier run rather than by its outcome. Guard a duplicate sequence and leave the real one ungated, or enroll the missed contacts afterwards with `sequenzy sequences enroll`, which skips the one_time check.","Branch condition types include has_tag, does_not_have_tag, in_list, in_segment, event_received, link_clicked, and field_* comparisons. Use activityScope (this_sequence, previous_email, ever) for event and click checks.","Branch paths may set targetNodeId and elseTargetNodeId to wire directly to existing nodes from sequences get, including the completion node. If path steps are also provided, they run before that target.",'Set "splitMode":"random" with "randomPercentages" to route by percentage instead of by condition, which runs a concurrent A/B test inside the flow (for example two abandoned-cart offers at once instead of one after the other). Each branch then omits conditionType and condition-specific fields, the percentages must sum to 100, and no else path is allowed. To A/B test the content of a single existing email step and have a winner picked automatically, use `sequenzy ab-tests create --automation-node-id` instead.',"Use --clear-sending-window to remove a configured send window.","Use --respect-frequency-cap to skip an email step for contacts already at the company frequency cap (they continue to the next step; set the cap with `sequenzy frequency-cap set`); --ignore-frequency-cap turns it off. Transactional steps are never skipped.","Use --active-subscribers-only to keep unsubscribed and bounced contacts out of the sequence entirely; --include-suppressed-subscribers restores the default, where they still enter on tag, event, list or contact triggers so non-marketing steps run, and only their marketing emails are skipped.","Use --send-to-not-subscribed on to also send marketing emails to contacts with status not_subscribed (known to you, never opted in, never unsubscribed, such as shoppers who started a checkout); off limits them to subscribers; default follows the trigger (on for ecommerce.checkout_started, off otherwise). Unsubscribed and bounced contacts never get marketing emails.","Use --key-date/--key-dates-json to set the key dates a countdown sequence waits for; changing them re-times contacts already waiting. --clear-key-dates removes them (rejected while a step still waits for one). --send-spread-hours sets how many hours each countdown email is spread over (default 4; 0 sends at the exact time).","Use --bcc-emails with a comma-separated list to blind-copy team inboxes on every sequence email; use --clear-bcc-emails to remove them."],examples:['sequenzy sequences update seq_123 --name "User Onboarding"',"sequenzy sequences update seq_123 --pause-new-enrollments","sequenzy sequences update seq_123 --resume-new-enrollments","sequenzy sequences update seq_123 --enrollment-mode matching_field","sequenzy sequences update seq_123 --enrollment-field-path order.id","sequenzy sequences update seq_123 --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays","sequenzy sequences update seq_123 --clear-sending-window","sequenzy sequences update seq_123 --active-subscribers-only","sequenzy sequences update seq_123 --send-to-not-subscribed on","sequenzy sequences update seq_123 --respect-frequency-cap",'sequenzy sequences update seq_123 --key-dates-timezone America/New_York --key-date "Black Friday starts=2026-11-27T00:00:00" --key-date "Black Friday ends=2026-11-29T23:59:00"',"sequenzy sequences update seq_123 --send-spread-hours 6",'sequenzy sequences update seq_123 --bcc-emails "cs-team@yourcompany.com, founder@yourcompany.com"',"sequenzy sequences update seq_123 --clear-bcc-emails","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json",`sequenzy sequences update seq_123 --stop-condition-json '{"type":"has_tag","value":"customer"}'`,`sequenzy sequences update seq_123 --stop-condition-json '{"type":"does_not_have_tag","value":"allowlist"}'`,`sequenzy sequences update seq_123 --stop-condition-json '{"type":"event_received","value":"product.quota_used","matchConfig":{"mode":"event_property_filter","propertyFilters":[{"path":"quota_used","operator":"greater_than","value":1}]}}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"delay":{"days":1},"subject":"Migration check-in","html":"<p>Need help migrating?</p>"}]}' --confirm-structural-change`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"nodeType":"logic_wait_for_event","config":{"label":"Wait for reply","eventName":"email.replied","timeoutDays":5,"timeoutAction":"continue"}}]}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_trigger","steps":[{"nodeType":"action_ai","config":{"prompt":"Write a short winback subject line for {{first_name}} who cancelled because {{event.reason}}.","resultKey":"winback","outputFields":[{"key":"subject_line","maxLength":60,"fallback":"We miss you"}],"includeEventProperties":true}}]}' --confirm-structural-change`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email","branches":[{"conditionType":"link_clicked","linkUrl":"project-invites","activityScope":"previous_email","steps":[{"subject":"Invite accepted","html":"<p>Thanks for accepting.</p>"}]}],"elseSteps":[{"subject":"Reminder","html":"<p>Please accept your invite.</p>"}]}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email_1","branches":[{"id":"replied","conditionType":"event_received","eventName":"email.replied","activityScope":"this_sequence","targetNodeId":"node_complete"}],"elseTargetNodeId":"node_email_2"}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_cart_wait","splitMode":"random","randomPercentages":[50,50],"branches":[{"id":"discount","label":"10% off","steps":[{"subject":"Here is 10% off","html":"<p>Complete your order.</p>"}]},{"id":"bonus","label":"Free shipping + gift","steps":[{"subject":"Free shipping on us","html":"<p>Complete your order.</p>"}]}]}' --confirm-structural-change`,"sequenzy sequences update seq_123 --branch-file ./branch.json",`sequenzy sequences update seq_123 --sms-steps-json '[{"nodeId":"node_sms","text":"Hey {{FIRST_NAME}}, your order shipped!"}]'`,`sequenzy sequences update seq_123 --subscriber-update-steps-json '[{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"mrr","value":"{{event.amount}}","valueType":"number"}]}}]'`]});var R1e=xt.command("enable <id>").description("Enable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("enable",{id:e,...t}));S(R1e,{examples:["sequenzy sequences enable seq_123"]});var T1e=xt.command("disable <id>").description("Disable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("disable",{id:e,...t}));S(T1e,{examples:["sequenzy sequences disable seq_123"]});var O1e=xt.command("duplicate <id>").description("Create an independent draft copy of a sequence").option("-n, --name <name>","Name for the copied sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("duplicate",{id:e,...t}));S(O1e,{notes:["Email templates, graph topology, and sequence A/B tests are copied independently."],examples:["sequenzy sequences duplicate seq_123",'sequenzy sequences duplicate seq_123 --name "Welcome Series v2"']});var N1e=xt.command("archive <id>").description("Archive a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("archive",{id:e,...t}));S(N1e,{examples:["sequenzy sequences archive seq_123"]});var $1e=xt.command("unarchive <id>").description("Restore an archived sequence as a draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("unarchive",{id:e,...t}));S($1e,{examples:["sequenzy sequences unarchive seq_123"]});var P1e=xt.command("enrollments <id>").description("List the contacts currently enrolled in a sequence").option("--status <statuses...>","Enrollment statuses to include (active, waiting, paused, completed, failed, cancelled); defaults to active, waiting, and paused").option("--node-id <nodeIds...>","Only show enrollments sitting on these sequence node IDs").option("--subscriber-id <ids...>","Only show enrollments for these subscriber IDs").option("--email <email>","Only show enrollments for this email address").option("--sort <sort>","enrolled_at_desc (default), enrolled_at_asc, wait_until_asc, or wait_until_desc").option("--stop-condition-match","Also report whether each in-flight enrollment's stop condition already matches (caps the page at 100)").option("--limit <n>","Enrollments per page, 1-500 (default 50)").option("--offset <n>","Number of enrollments to skip").option("--all","Fetch every page").option("--csv [file]","Print CSV, or write it to a file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>R9(e,t));S(P1e,{notes:["Defaults to active, waiting, and paused enrollments, which is every contact still in the sequence.","Get node IDs from sequenzy sequences get <id>, or from enrollmentCounts.byCurrentNode in sequenzy stats --sequence <id>.","waitUntil is when a waiting enrollment resumes; it is empty for enrollments that are not scheduled.","A stop condition does not cancel a waiting enrollment when its event arrives. It is re-checked when the enrollment next runs a step, so a matching contact keeps reporting waiting until its delay expires. Use --stop-condition-match to inspect the current match. The result is a non-atomic snapshot; a step already past its stop check may still finish."],examples:["sequenzy sequences enrollments seq_123","sequenzy sequences enrollments seq_123 --node-id node_wave_1","sequenzy sequences enrollments seq_123 --status waiting --sort wait_until_asc","sequenzy sequences enrollments seq_123 --subscriber-id sub_123 --stop-condition-match","sequenzy sequences enrollments seq_123 --all --csv enrollments.csv"]});var Q1e=xt.command("enrollment <sequenceId> <enrollmentId>").description("Show how one enrollment entered and which branches it already took").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>T9(e,t,n));S(Q1e,{notes:["Use list_sequence_enrollments / sequenzy sequences enrollments to get enrollmentId.","nodeHistory is the recorded graph walk. Compared field values are redacted summaries, never the raw recipient value."],examples:["sequenzy sequences enrollment seq_123 tok_abc","sequenzy sequences enrollment seq_123 tok_abc --json"]});var q1e=xt.command("move-enrollments <id>").description("Release a bounded batch of enrolled contacts from one sequence step onto another").requiredOption("--from-node <nodeId>","Node ID the contacts are currently waiting on").option("--to-node <nodeId>","Node ID to move them onto; defaults to the source step's only next step").option("--limit <n>","Maximum enrollments to move, 1-500 (default 100)").option("--sort <sort>","wait_until_asc (default), wait_until_desc, enrolled_at_asc, or enrolled_at_desc").option("--subscriber-ids <ids...>","Only move these subscriber IDs, up to 500").option("--daily-limit <n>","Refuse to move more than this many onto the target step in a rolling 24 hours").option("--tag <tags...>","Existing tag names to apply to the moved contacts").option("--reason <reason>","Note stored on every moved enrollment").option("--apply","Actually move the batch; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>P9(e,t));S(q1e,{notes:["Use this instead of cancelling and re-enrolling: the enrollment keeps its entry event properties, stop-condition snapshots, and start date.","Moved contacts become active on the target step immediately, so the sequence emails them as soon as the worker picks them up.","Without --apply, this command only reports which enrollments would move.","The batch is deliberately not auto-drained: re-run the command to release the next batch while remainingCount is above zero.","This works even while the sequence has new enrollment paused, because the contacts are already enrolled.","Get node IDs from sequenzy sequences enrollments <id> (currentNodeId) or sequenzy sequences get <id>."],examples:["sequenzy sequences move-enrollments seq_123 --from-node node_delay_2","sequenzy sequences move-enrollments seq_123 --from-node node_delay_2 --limit 180 --apply","sequenzy sequences move-enrollments seq_123 --from-node node_delay_2 --to-node node_email_3 --limit 180 --daily-limit 500 --tag wave-3-released --reason 'Wave 3' --apply"]});var F1e=xt.command("pause-subscribers <id>").description("Hold specific subscribers on their current sequence step until you resume them").option("--subscriber-ids <ids...>","Subscriber IDs to pause").option("-e, --email <emails...>","Subscriber email addresses to pause").option("--reason <reason>","Note stored on each paused enrollment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>L9(e,t));S(F1e,{notes:["Provide --subscriber-ids, --email, or both (up to 500 combined). Applies immediately; there is no dry run.","A paused contact gets no further steps from this sequence, keeps its place and entry data, and cannot be enrolled in it again while paused. Unsubscribes, bounces, and cancel-enrollments still end the enrollment.","A wait-for-event step does not react while paused; if its event arrived meanwhile, the step continues as soon as the contact is resumed.","An enrollment whose current step is running at that moment is reported as in_progress; run the command again shortly.","This is per contact. pause-enrollments only stops new contacts from entering the whole sequence."],examples:["sequenzy sequences pause-subscribers seq_123 --email ada@example.com --reason 'Project blocked'","sequenzy sequences pause-subscribers seq_123 --subscriber-ids sub_123 sub_456"]});var L1e=xt.command("resume-subscribers <id>").description("Continue paused subscribers from the sequence step they were paused on").option("--subscriber-ids <ids...>","Subscriber IDs to resume").option("-e, --email <emails...>","Subscriber email addresses to resume").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>U9(e,t));S(L1e,{notes:["Nothing restarts or is skipped. Waits keep their original wall-clock time: a wait that ran out while paused continues right away, one that has not still ends when it would have.","If the sequence itself is disabled, resumed contacts continue once it is enabled again."],examples:["sequenzy sequences resume-subscribers seq_123 --email ada@example.com","sequenzy sequences resume-subscribers seq_123 --subscriber-ids sub_123 sub_456 --json"]});var U1e=xt.command("pause-enrollments <id>").description("Stop new enrollments while current sequence recipients continue").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("pause-enrollments",{id:e,...t}));S(U1e,{notes:["The sequence must already be active. Existing active and waiting recipients keep moving through the sequence.","Use sequences disable when you want to freeze current recipients too."],examples:["sequenzy sequences pause-enrollments seq_123"]});var M1e=xt.command("resume-enrollments <id>").description("Resume new enrollments for an active sequence without changing current recipients").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("resume-enrollments",{id:e,...t}));S(M1e,{notes:["The sequence must already be active. Use sequences enable to resume a fully disabled sequence."],examples:["sequenzy sequences resume-enrollments seq_123"]});var j1e=xt.command("enroll <id>").description("Manually enroll subscribers in a sequence").option("-e, --email <emails...>","Email addresses to enroll").option("--subscriber-ids <ids...>","Subscriber IDs to enroll").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--target-node-id <nodeId>","Sequence node to enroll at; defaults to the first step after the trigger").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("enroll",{id:e,...t}));S(j1e,{notes:["Provide at least one target using --subscriber-ids or exactly one email source: --email, --emails-json, or --emails-file.","Subscribers must be active; unknown emails are reported as not found and inactive, unavailable, or already enrolled subscribers are skipped.","Enrollment requires the sequence to be accepting entrants (enabled and not paused for enrollment)."],examples:["sequenzy sequences enroll seq_123 --email one@example.com two@example.com","sequenzy sequences enroll seq_123 --subscriber-ids sub_123 sub_456 --target-node-id node_email_2","sequenzy sequences enroll seq_123 --emails-file ./vips.csv","sequenzy sequences enroll seq_123 --email one@example.com --target-node-id node_email_2"]});var z1e=xt.command("enroll-audience <id>").description("Enroll a whole audience (everyone, lists, or a segment) in a sequence as a background run").option("--all","Enroll every active contact with an email").option("--list-ids <ids...>","Enroll members of these lists").option("--segment-id <id>","Enroll members of this segment").option("--audience-json <json>",'Campaign-style audience object, e.g. {"type":"rules","include":[{"type":"lists","listIds":["list_1"]}],"exclude":[{"type":"segments","segmentIds":["seg_2"]}]}').option("--audience-file <file>","JSON file with the audience object").option("--target-node-id <nodeId>","Sequence node to start at; defaults to the first step after the trigger").option("--apply","Start enrolling; otherwise only report the estimate").option("--schedule-at <datetime>","With --apply, start at this ISO 8601 date-time instead of now").option("--keep-enrolling","With --apply, also enroll people who join this audience later, until the last key date").option("--data-json <json>",'With --apply, run-level data shared by everyone in this run and read in emails as {{enrollment.<field>}}, e.g. {"sale_ends_at":"2026-11-29T23:59:00Z","discount_percent":20} (JSON object, up to 8 KB)').option("--data-file <file>","With --apply, JSON file with the run-level data object").option("--wait","With --apply, poll until the run finishes").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>I9(e,t));S(z1e,{notes:["Without --apply the command only estimates: matching contacts, how many are already in the sequence, and how many would be enrolled.","The sequence must be enabled and accepting entrants. Contacts already active, waiting, or paused in it are skipped; one_time sequences also skip anyone who completed or was cancelled before. Unsubscribed and bounced contacts are never enrolled.","Late enrollees in a countdown sequence skip the steps whose key date already passed and continue from the next one.","Only one audience enrollment per sequence can be queued or running at a time; use sequenzy sequences audience-enrollments (or audience-enrollment <id> <runId>) to watch it and cancel-audience-enrollment to stop it.","--data-json/--data-file attach run-level values that are the same for everyone in the run (a sale end time, a discount percentage). Every enrolled contact keeps a copy, and the sequence's emails and conditions read them as {{enrollment.<field>}}. Auto-enroll syncs (--keep-enrolling) do not carry run data."],examples:["sequenzy sequences enroll-audience seq_123 --all","sequenzy sequences enroll-audience seq_123 --segment-id seg_past_buyers --apply --wait","sequenzy sequences enroll-audience seq_123 --list-ids list_1 list_2 --apply","sequenzy sequences enroll-audience seq_123 --audience-file ./audience.json --apply --json",`sequenzy sequences enroll-audience seq_123 --segment-id seg_past_buyers --apply --data-json '{"sale_ends_at":"2026-11-29T23:59:00Z","discount_percent":20,"order_cutoff_utc":"2026-11-29T22:00:00Z"}'`]});var G1e=xt.command("audience-enrollments <id>").description("List audience enrollment runs for a sequence").option("--limit <n>","Runs to return, 1-100 (default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>C9(e,t));S(G1e,{notes:["Each run reports its status (queued, running, completed, cancelled, failed) and how many contacts were enrolled or skipped."],examples:["sequenzy sequences audience-enrollments seq_123","sequenzy sequences audience-enrollments seq_123 --limit 5 --json"]});var H1e=xt.command("audience-enrollment <id> <runId>").description("Show one audience enrollment run with its progress").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>w9(e,t,n));S(H1e,{notes:["Poll this while the status is queued or running; enroll-audience --wait does the polling for you."],examples:["sequenzy sequences audience-enrollment seq_123 run_abc --json"]});var J1e=xt.command("cancel-audience-enrollment <id> <runId>").description("Stop a queued or running audience enrollment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>S9(e,t,n));S(J1e,{notes:["A queued run is cancelled immediately; a running run stops after the batch it is enrolling. Contacts already enrolled stay in the sequence (use cancel-enrollments to remove them)."],examples:["sequenzy sequences cancel-audience-enrollment seq_123 run_abc"]});var K1e=xt.command("schedule <id>").description("Show or set a recurring schedule that re-enrolls an audience into a manual-trigger sequence").option("--daily","Run every day").option("--weekly <days>","Run on these weekdays, comma-separated: mon,fri or 1,5 (0 = Sunday)").option("--monthly <days>","Run on these days of the month, comma-separated: 1,15,last").option("--at <time>",'24-hour run time, e.g. "10:00"').option("--timezone <zone>","IANA timezone the time is read in (default: this machine's timezone)").option("--all","Enroll every contact at each run").option("--list-ids <ids...>","Enroll members of these lists at each run").option("--segment-id <id>","Enroll members of this segment at each run").option("--audience-json <json>","Campaign-style audience object").option("--audience-file <file>","JSON file with the audience object").option("--disable","Save the schedule switched off").option("--until <datetime>",'ISO 8601 date-time after which no run starts (e.g. 2027-06-30T23:59:00Z); "none" removes the end date').option("--enrollment-mode <mode>","Who enters at each run: unlimited (everyone who matches) or one_time (only people who never entered); changes the sequence's enrollment mode").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>j9(e,t));S(K1e,{notes:["Without --daily, --weekly or --monthly the command shows the current schedule and its next runs.","Only manual-trigger sequences can repeat (--trigger manual), and not while --keep-enrolling is on. The sequence must be enabled for runs to happen; occurrences while it is paused, disabled or closed to new entrants are skipped.","Each run is an audience enrollment run (source recurring): contacts who finished an earlier run enter again, contacts still in the sequence are skipped, and one_time sequences never re-enroll anyone. Nothing is enrolled until the first scheduled time.","Days past the end of a shorter month run on its last day; use last for the end of every month. A run that cannot start within 6 hours of its time is skipped.","Saving replaces the existing schedule (an omitted --until means no end date); use sequenzy sequences unschedule to remove it.","--enrollment-mode sets the sequence's enrollment mode, which also applies to enrollments you start by hand; omit it to keep the current mode."],examples:["sequenzy sequences schedule seq_123","sequenzy sequences schedule seq_123 --monthly 1,last --at 10:00 --timezone Europe/London --all","sequenzy sequences schedule seq_123 --daily --at 09:30 --segment-id seg_low_balance","sequenzy sequences schedule seq_123 --weekly mon,thu --at 18:00 --list-ids list_members --json","sequenzy sequences schedule seq_123 --monthly last --at 09:00 --all --until 2027-06-30T23:59:00Z --enrollment-mode one_time"]});var V1e=xt.command("unschedule <id>").description("Remove a sequence's recurring schedule").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>z9(e,t));S(V1e,{notes:["Stops future runs. Runs already started and contacts already enrolled are not affected."],examples:["sequenzy sequences unschedule seq_123"]});var W1e=xt.command("cancel-enrollments <id>").description("Cancel active, waiting, or paused subscriber enrollments in a sequence").option("--all","Cancel every active, waiting, or paused enrollment in the sequence").option("--subscriber-id <id>","Cancel enrollments for one subscriber ID").option("--subscriber-ids <ids...>","Cancel enrollments for up to 500 subscriber IDs").option("--field-path <path>","Entry event property dot path to match, such as order.id").option("--field-values <values>","Comma-separated entry field values to match").option("--reason <reason>","Reason stored on cancelled enrollments").option("--apply","Actually cancel matches; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("cancel-enrollments",{id:e,...t}));S(W1e,{notes:["sequenceId is always required. Provide exactly one target: --all, --subscriber-id, --subscriber-ids, or --field-values.","Use --all to fully stop a live sequence when enrollments came from a segment and share no entry field value.","Without --apply, this command only reports matching enrollments.","With --apply, the command keeps calling the API until every match is drained and prints running progress.","When --field-path is omitted, the API uses the sequence enrollmentFieldPath if configured."],examples:["sequenzy sequences cancel-enrollments seq_123 --all","sequenzy sequences cancel-enrollments seq_123 --all --apply --reason 'Lifecycle cutover'","sequenzy sequences cancel-enrollments seq_123 --subscriber-id sub_123 --apply","sequenzy sequences cancel-enrollments seq_123 --subscriber-ids sub_1 sub_2 --apply","sequenzy sequences cancel-enrollments seq_123 --field-path order.id --field-values ord_123,ord_456"]});var Y1e=xt.command("realign-enrollments <id>").description("Move waiting enrollments to the start of the sequence sending window on the day they are already scheduled for").option("--node-ids <ids...>","Only realign enrollments sitting on these step IDs").option("--subscriber-ids <ids...>","Only realign enrollments for up to 500 subscriber IDs").option("--cursor <cursor>","Continue a capped scan from the cursor returned by the previous run").option("--job-id <job-id>","Check a previously queued realignment job instead of starting one").option("--apply","Actually move the wait times; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("realign-enrollments",{id:e,...t}));S(Y1e,{notes:["Run this after changing a live sequence's sending window: existing waits keep their original time, so a widened window never reaches them and a narrowed one defers them to the next allowed day.","A wait only ever moves earlier, never onto a different local day, and never before now. Nobody is cancelled or re-enrolled.","Without --apply, this command only reports the new wait times.","When more enrollments remain, run the complete continuation command printed in the result; applied runs retain --apply and any targeting filters.","Applied realignments run in the background. Use the printed --job-id command to read the result.","Use `sequenzy sequences enrollments <id> --status waiting --sort wait_until_asc` first to see who is affected."],examples:["sequenzy sequences realign-enrollments seq_123","sequenzy sequences realign-enrollments seq_123 --apply","sequenzy sequences realign-enrollments seq_123 --node-ids node_week_2 --apply","sequenzy sequences realign-enrollments seq_123 --subscriber-ids sub_1 sub_2 --apply","sequenzy sequences realign-enrollments seq_123 --job-id realign-sequence-enrollments-seq_123-..."]});var Z1e=xt.command("delete <id>").description("Delete a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Bn("delete",{id:e,...t}));S(Z1e,{examples:["sequenzy sequences delete seq_123"]});var bo=Ve.command("ab-tests").description("Inspect and edit A/B test variants").action(()=>bo.help());S(bo,{notes:["Use get to discover variant IDs, then update-variant to edit a specific A/B variant.","Campaign test time and audience can change during testing. Variant content stays locked after sending starts.","create, add-variant, and delete-variant work on campaign and sequence A/B tests; delete works on campaign A/B tests only."],examples:["sequenzy ab-tests list --sequence seq_123","sequenzy ab-tests get ab_123","sequenzy ab-tests update ab_123 --winner-criteria open_rate","sequenzy ab-tests stats ab_123 --period 7d","sequenzy ab-tests create camp_123 --test-percentage 20 --winner-criteria open_rate",'sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"',"sequenzy ab-tests restart ab_123 --source-variant var_b","sequenzy ab-tests select-winner ab_123 var_b","sequenzy ab-tests resume ab_123",'sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --blocks-file ./variant-b.json"]});var X1e=bo.command("list").description("List A/B tests").option("--sequence <id>","Filter by sequence ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Po("list",e));S(X1e,{examples:["sequenzy ab-tests list --sequence seq_123"]});var eLe=bo.command("get <id>").description("Get A/B test details and variants").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("get",{id:e,...t}));S(eLe,{examples:["sequenzy ab-tests get ab_123"]});var tLe=bo.command("update <id>").description("Update campaign or sequence A/B test settings").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Campaign test audience share (5-50)").option("--duration-minutes <minutes>","Campaign test duration before winner selection (15-1440)").option("--winner-criteria <criteria>","Winner criteria: open_rate, click_rate, goal_conversion_rate, goal_value, or event_rate").option("--winner-goal <goalId>",'Goal for goal_conversion_rate or goal_value: a goal ID or "default-revenue" for purchase revenue').option("--winner-event <eventName>","Event for event_rate").option("--test-type <type>","Sequence variant strategy: subject or content").option("--winner-threshold <count>","Sequence recipients before winner selection (10-1000)").option("--auto-select-winner","Sequence tests: pick the leading variant once the sample size is reached").option("--no-auto-select-winner","Sequence tests: keep splitting contacts until you select a winner").option("--confirm-live-change","Confirm a settings change to an active or already-used sequence test").option("--cancel-sample-update","Discard a failed campaign sample change").option("--end-now","End a running campaign test now and pick the winner by its criteria").option("--expected-updated-at <timestamp>","Reject settings changes if the test has changed since this timestamp").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("update",{id:e,...t}));S(tLe,{notes:["During campaign testing, duration is measured from the original start (from when the last test email is due when delivery is spread); a past deadline starts winner selection immediately. Audience changes are queued and preserve committed sends. Retry the same percentage after a queue failure, or use --cancel-sample-update to discard a failed request. --end-now stops a running campaign test early: the winner is picked by its criteria from the results so far and sent to the rest of the audience.","Sequence tests use --test-type, --winner-threshold, --winner-criteria, and --auto-select-winner / --no-auto-select-winner.","Use --confirm-live-change when sequence settings affect an active test or a test with recorded activity.","goal_conversion_rate and goal_value judge variants by conversions of --winner-goal attributed to each variant (an open or click within the goal's window; for campaigns, revenue and campaign goals also credit a recipient who received the email in that window); default-revenue is built-in purchase revenue. event_rate judges by recipients who fire --winner-event after receiving the variant. When no variant converts, campaign tests fall back to click rate and sequence tests keep splitting. Campaign criteria are locked once testing starts."],examples:["sequenzy ab-tests update ab_123 --test-percentage 30 --duration-minutes 120 --winner-criteria open_rate","sequenzy ab-tests update ab_123 --test-type content --winner-criteria open_rate --winner-threshold 150 --confirm-live-change","sequenzy ab-tests update ab_123 --no-auto-select-winner --confirm-live-change","sequenzy ab-tests update ab_123 --winner-criteria goal_value --winner-goal default-revenue","sequenzy ab-tests update ab_123 --winner-criteria event_rate --winner-event trial.converted","sequenzy ab-tests update ab_123 --end-now"]});var nLe=bo.command("stats <id>").description("Get A/B test variant stats").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Custom range start as ISO 8601").option("--end <iso>","Custom range end as ISO 8601").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("stats",{id:e,...t}));S(nLe,{notes:["Use --period or both --start and --end. Custom ranges max at 90 days.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy ab-tests stats ab_123","sequenzy ab-tests stats ab_123 --period 30d","sequenzy ab-tests stats ab_123 --include-bots"]});var rLe=bo.command("select-winner <id> <variantId>").description("Select a campaign A/B winner, or select or change a sequence A/B winner").option("--confirm-live-change","Confirm changing the winner of a test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Po("select-winner",{id:e,variantId:t,...n}));S(rLe,{notes:["Campaign A/B tests must be in the testing phase; selection immediately queues winner delivery for the remaining audience.","Sequence A/B tests can change an existing winner, including one picked automatically. Contacts who already got a variant keep it; everyone who reaches the step afterwards gets the new winner.","Use --confirm-live-change when the sequence is active."],examples:["sequenzy ab-tests select-winner ab_123 var_b","sequenzy ab-tests select-winner ab_123 var_c --confirm-live-change"]});var iLe=bo.command("resume <id>").description("Clear a sequence A/B winner and keep testing until you select one").option("--confirm-live-change","Confirm resuming a test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("resume",{id:e,...t}));S(iLe,{notes:["Contacts reaching the step are split across the variants again. Results collected so far are kept.","Automatic selection stays off for this test; finish it with `sequenzy ab-tests select-winner <id> <variantId>`.","Use --confirm-live-change when the sequence is active."],examples:["sequenzy ab-tests resume ab_123","sequenzy ab-tests resume ab_123 --confirm-live-change"]});var oLe=bo.command("restart <id>").description("Run another sequence A/B test from an existing variant").option("--source-variant <id>","Variant to use as the new control. Defaults to the selected winner.").option("--test-type <type>","Test type for generated variants: subject or content").option("--winner-threshold <count>","Subscribers before selecting a winner (10-1000)").option("--variant-count <count>","Total variants including control (2-4)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("restart",{id:e,...t}));S(oLe,{notes:["Only sequence A/B tests with a selected winner can be restarted.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:["sequenzy ab-tests restart ab_123","sequenzy ab-tests restart ab_123 --source-variant var_b --test-type content --variant-count 3"]});var sLe=bo.command("update-variant <id> <variantId>").description("Update an A/B test variant").option("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--html <html>","Replacement HTML body").option("--html-file <file>","Read replacement HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm a sequence variant edit that may affect A/B test accuracy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Po("update-variant",{id:e,variantId:t,...n}));S(sLe,{notes:["Provide either HTML or blocks, not both.","Campaign variants remain editable only in draft.","Use --confirm-live-change when a sequence is active or its test already has activity; earlier sends stay unchanged and combined results may be inaccurate.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:['sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --html-file ./variant-b.html",'sequenzy ab-tests update-variant ab_123 var_b --subject "Revised future send" --confirm-live-change']});var aLe=bo.command("create [campaignId]").description("Create a campaign or sequence-node A/B test").option("--automation-node <nodeId>","Convert this sequence email node into an A/B test node").option("--confirm-live-change","Confirm conversion of an email node in an active sequence").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Campaign test audience share (5-50, default 20)").option("--duration-minutes <minutes>","Campaign test duration before winner selection (15-1440, default 240)").option("--winner-criteria <criteria>","Winner criteria: open_rate, click_rate, goal_conversion_rate, goal_value, or event_rate (campaign default open_rate; overrides sequence test-type default)").option("--winner-goal <goalId>",'Goal for goal_conversion_rate or goal_value: a goal ID or "default-revenue" for purchase revenue').option("--winner-event <eventName>","Event for event_rate").option("--test-type <type>","Sequence variant strategy: subject or content (default content)").option("--winner-threshold <count>","Sequence test sample size (10-1000, default 100)").option("--variants-json <json>","Inline JSON array of extra variants ({subject, previewText?, blocks?})").option("--variants-file <file>","Path to a JSON file with extra variants ({subject, previewText?, blocks?})").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("create",{campaignId:e,automationNodeId:t.automationNode,...t}));S(aLe,{notes:["Provide either a campaign ID or --automation-node, but not both.","Campaigns must be in draft or rejected status. Sequence node IDs must reference an email node.","Campaigns use --test-percentage and --duration-minutes; sequences use --winner-threshold.","Variant A is created automatically from the campaign email; provided variants are added after it."],examples:["sequenzy ab-tests create camp_123",`sequenzy ab-tests create --automation-node node_123 --test-type content --winner-threshold 100 --variants-json '[{"subject":"Variant B"}]'`,"sequenzy ab-tests create camp_123 --test-percentage 30 --duration-minutes 120 --winner-criteria click_rate",`sequenzy ab-tests create camp_123 --variants-json '[{"subject":"Alternative subject"}]'`]});var cLe=bo.command("add-variant <id>").description("Add a variant to a draft campaign or sequence A/B test").requiredOption("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm adding a variant to an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("add-variant",{id:e,...t}));S(cLe,{notes:["Variants can only be added while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:['sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"','sequenzy ab-tests add-variant ab_123 --subject "Alternative subject" --blocks-file ./variant.json']});var lLe=bo.command("delete-variant <id> <variantId>").description("Remove a variant from a draft campaign or sequence A/B test").option("-y, --yes","Skip the confirmation prompt").option("--confirm-live-change","Confirm deleting a variant from an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Po("delete-variant",{id:e,variantId:t,...n}));S(lLe,{notes:["Variant A is the control variant and cannot be deleted.","Variants can only be removed while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:["sequenzy ab-tests delete-variant ab_123 var_b --yes"]});var uLe=bo.command("delete <id>").description("Delete a campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Po("delete",{id:e,...t}));S(uLe,{notes:["Running A/B tests cannot be deleted; the linked campaign must be draft or rejected."],examples:["sequenzy ab-tests delete ab_123 --yes"]});var Rc=Ve.command("components").description("Manage reusable email components and the default email footer").action(()=>Rc.help());S(Rc,{notes:["Components are saved block groups you can reuse across emails.","The component pinned to the footer slot is the footer every new sequence, campaign, and AI-generated email gets. Edit it here to change the footer everywhere at once - editing one email's blocks only changes that email.","A default footer always keeps its unsubscribe link enabled. Transactional sends hide it at render time.","Existing emails change only with explicit --apply-to scopes and a reviewed --preview-token. Use footer preview first; --output-dir exports before/after HTML for visual inspection."],examples:["sequenzy components footer get --json > footer.json","sequenzy components footer set --blocks-file ./footer.json --yes","sequenzy components list --company comp_123","sequenzy components create 'Promo banner' --blocks-file ./banner.json"]});var pC=Rc.command("footer").description("Read or replace the company's default email footer").action(()=>pC.help()),dLe=pC.command("get").description("Print the current default email footer").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qa("footer-get",void 0,e));S(dLe,{notes:["Exits with a not-found error when no default footer is set, which means emails fall back to the footer generated from the company profile.","Pipe --json to a file, edit the blocks, then write it back with `components footer set`."],examples:["sequenzy components footer get","sequenzy components footer get --json > footer.json"]});var pLe=pC.command("preview").description("Preview a footer change and optionally export before/after HTML without saving").option("--blocks-json <json>","Proposed footer blocks as inline JSON").option("--blocks-file <path>","Proposed footer blocks as a JSON file").option("--name <name>","Proposed component name").option("--description <text>","Proposed component description").option("--apply-to <scopes>","Comma-separated sequences,campaigns,transactional,templates; omit for future emails only").option("--include-customized","Also replace customized footers").option("--render-preview","Include footer and before/after HTML in JSON output").option("--output-dir <path>","Write visual HTML previews to this directory").option("--sample-id <id>","Render a specific affected item instead of category samples").option("--sample-kind <kind>","Sample kind: email, ab_variant, localization").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including the preview token").action((e)=>qa("footer-preview",void 0,e));S(pLe,{notes:["The preview does not save or send. Dynamic content is not personalized. Open exported HTML in a browser to inspect it visually.","Use the same blocks, metadata and scope options when applying the returned token. Stale previews return a conflict; review a fresh preview before retrying."],examples:["sequenzy components footer preview --blocks-file footer.json --apply-to sequences,campaigns,transactional,templates --output-dir ./footer-preview --json"]});var mLe=pC.command("set").description("Create or replace the company's default email footer").option("--blocks-json <json>","Footer blocks as inline JSON").option("--blocks-file <path>","Footer blocks as a JSON file").option("--apply-to <scopes>","Comma-separated sequences,campaigns,transactional,templates").option("--include-customized","Also replace customized footers, matching the preview").option("--preview-token <token>","Reviewed footer preview token; required with --apply-to").option("--name <name>","Component name (default: Default Footer)").option("--description <text>","Component description").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").option("-y, --yes","Skip the confirmation prompt").action((e)=>qa("footer-set",void 0,e));S(mLe,{notes:["Replaces the whole footer. Read the current one with `components footer get --json` first if you only mean to change part of it.","The unsubscribe link is always re-enabled on save."],examples:["sequenzy components footer set --blocks-file ./footer.json --yes",'sequenzy components footer set --blocks-file ./footer.json --name "2026 Footer"']});var fLe=Rc.command("list").description("List email components, newest first").option("--type <type>","Filter by component type (section, footer)").option("--defaults-only","Only components pinned as a company default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qa("list",void 0,e));S(fLe,{examples:["sequenzy components list","sequenzy components list --defaults-only --json"]});var gLe=Rc.command("get <componentId>").description("Show one email component").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("get",e,t));S(gLe,{examples:["sequenzy components get cmp_123 --json"]});var ALe=Rc.command("create <name>").description("Create a reusable email component").option("--blocks-json <json>","Component blocks as inline JSON").option("--blocks-file <path>","Component blocks as a JSON file").option("--description <text>","Component description").option("--type <type>","Component type (section, footer). Default: section").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("create",e,t));S(ALe,{notes:["Component names are unique per company.","Creating one with --type footer does not pin it as the default footer. Use `components footer set` for that."],examples:["sequenzy components create 'Promo banner' --blocks-file ./banner.json"]});var hLe=Rc.command("update <componentId>").description("Update an email component's metadata or blocks").option("--name <name>","New component name").option("--description <text>","New description").option("--type <type>","New component type (section, footer)").option("--blocks-json <json>","Replacement blocks as inline JSON").option("--blocks-file <path>","Replacement blocks as a JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("update",e,t));S(hLe,{notes:["Replacing blocks bumps the component version. Emails built earlier keep the copy they were created with."],examples:["sequenzy components update cmp_123 --name 'Promo banner v2'","sequenzy components update cmp_123 --blocks-file ./banner-v2.json"]});var yLe=Rc.command("duplicate <componentId>").description("Copy an email component into a new component").option("-n, --name <name>",'Name for the copy (default: "<name> (Copy)", numbered if taken)').option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qa("duplicate",e,t));S(yLe,{notes:["The copy keeps the description, type and blocks. It is never pinned as a default, so duplicating the default footer gives you a regular component to edit."],examples:["sequenzy components duplicate cmp_123","sequenzy components duplicate cmp_123 --name 'Promo banner (winter)'"]});var bLe=Rc.command("delete <componentId>").description("Delete an email component").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").option("-y, --yes","Skip the confirmation prompt").action((e,t)=>qa("delete",e,t));S(bLe,{notes:["Emails that already rendered the component keep their copied blocks.","Deleting the pinned default footer makes new emails fall back to the generated footer."],examples:["sequenzy components delete cmp_123 --yes"]});var vo=Ve.command("templates").description("Manage email templates").action(()=>vo.help());S(vo,{notes:["Template content can be provided as raw HTML or as Sequenzy blocks JSON.","Templates can be assigned labels and listed by label for integration dashboards.","Use blocks when you need conditional content, per-block styles, or an exact editor-compatible structure.",JA],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123",'sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json','sequenzy templates update tmpl_123 --subject "Updated" --html-file ./welcome-v2.html','sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr"]});var vLe=vo.command("list").description("List templates, newest first").option("--label <labels...>","Filter by label name").option("--templates-only","Only reusable master designs (emails marked as templates)").option("-l, --limit <number>","Templates per page, 1-100 (default: 50)").option("--offset <number>","Templates to skip before returning results").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ha("list",e));S(vLe,{notes:["Returns 50 templates per call by default. When pagination.hasMore is true, re-run with --offset advanced by pagination.count to read the rest.","Templates are every saved email body - standalone templates plus the bodies behind campaigns and transactional emails - so the count grows with your campaign history."],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123","sequenzy templates list --templates-only --json","sequenzy templates list --limit 100 --json","sequenzy templates list --limit 100 --offset 100 --json"]});var ELe=vo.command("get <id>").description("Get template details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("get",{id:e,...t}));S(ELe,{examples:["sequenzy templates get tmpl_123 --company comp_123"]});var ILe=VR(vo.command("render <id>").description("Render a template to email-ready HTML")).action((e,t)=>Jv({type:"template",id:e},t));S(ILe,{notes:ZR,examples:["sequenzy templates render tmpl_123 --out preview.html","sequenzy templates render tmpl_123 --email you@example.com --var plan=Pro --json"]});var CLe=WR(vo.command("check <id>").description("Check a template: broken links and images, placeholders, content and client issues")).action((e,t)=>Kv({type:"template",id:e},t));S(CLe,{notes:YR,examples:["sequenzy templates check tmpl_123","sequenzy templates check tmpl_123 --var resetUrl=https://acme.io/reset --json"]});var wLe=vo.command("create <name>").description("Create a template").option("-s, --subject <subject>","Email subject (optional with --prompt)").option("--preview-text <text>","Email preview text override").option("--prompt <prompt>","Generate branded native blocks from a prompt").option("--style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("--tone <tone>","Prompt generation tone").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Label names to assign").option("--template","Save as a reusable master design that sequence steps and campaigns can start from").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("create",{name:e,...t}));S(wLe,{notes:["Provide exactly one of prompt, HTML, or blocks JSON content.","Use blocks when you need conditional content, per-block styles, or exact editor parity."],examples:['sequenzy templates create welcome --prompt "Welcome new customers"','sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json']});var SLe=vo.command("from-example <example>").description("Remix an email gallery example into a new template written for your brand").option("--brief <text>","Extra direction for the new email (takes priority over the example)").option("--name <name>","Template name (defaults to the generated subject)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>L3(e,t));S(SLe,{notes:["<example> is a gallery email URL (https://sequenzy.com/email-examples/brands/{brand}/emails/{email}, or a sequence page URL ending in #email-{email} for an email in a sequence) or brand/email.","Keeps the example's exact layout; every word is rewritten for your company and your logo, brand color and links are swapped in. Saved as an HTML template. The example brand is never named in the new email.","Saved as a reusable template. Nothing is saved if generation fails; running the command again creates another template."],examples:["sequenzy templates from-example https://sequenzy.com/email-examples/brands/linear/emails/welcome-to-linear",'sequenzy templates from-example linear/welcome-to-linear --brief "Mention our 14-day trial"']});var DLe=vo.command("preview-example <example>").description("Preview an email gallery example written for your brand, without saving").option("--website <site>","Write it for another website instead of your brand, e.g. acme.com").option("--brief <text>","Extra direction for the email (takes priority over the example)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including the HTML").action((e,t)=>G3(e,t));S(DLe,{notes:["<example> is a gallery email URL (https://sequenzy.com/email-examples/brands/{brand}/emails/{email}, or a sequence page URL ending in #email-{email}) or brand/email.","Same rewrite as sequenzy templates from-example, but nothing is saved. Run from-example to keep it as a template."],examples:["sequenzy templates preview-example linear/welcome-to-linear","sequenzy templates preview-example linear/welcome-to-linear --website acme.com --json"]});var _Le=vo.command("update <id>").description("Update a template").option("-n, --name <name>","Template name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Replace label names").option("--template","Mark as a reusable master design").option("--no-template","Remove the reusable master design mark").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("update",{id:e,...t}));S(_Le,{notes:["Provide at least one of --name, --subject, --preview-text, --label, --template/--no-template, --html, --html-file, --blocks-json, or --blocks-file.","Do not combine HTML flags with blocks flags in the same request.","To edit the double opt-in confirmation email, pass its ID from `sequenzy tracking settings` (Confirmation email). New content must keep {{DOUBLE_OPT_IN_URL}}, or the update is rejected."],examples:['sequenzy templates update tmpl_123 --subject "Updated"','sequenzy templates update tmpl_123 --preview-text "A warmer inbox preview"',"sequenzy templates update tmpl_123 --label edm template","sequenzy templates update tmpl_123 --html-file ./welcome-v2.html","sequenzy templates update tmpl_123 --blocks-file ./welcome-v2-blocks.json"]});var Um=vo.command("localizations").description("Manage localized template variants").action(()=>Um.help());S(Um,{notes:["Set stores caller-supplied localized content immediately.","Sync queues AI translation for selected locales, or every enabled non-primary locale when --locale is omitted.","Coverage and translate-missing work across every sequence email and enabled transactional email at once."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123","sequenzy templates localizations coverage","sequenzy templates localizations translate-missing --locale fr"]});var xLe=Um.command("coverage").description("Show how many sequence and transactional emails are translated into each language").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>LR("coverage",{company:e.company,json:e.json}));S(xLe,{notes:["Counts cover every email step and A/B variant in sequences that are not archived, plus enabled transactional emails.","Outdated translations were made before the original changed; they still send."],examples:["sequenzy templates localizations coverage","sequenzy templates localizations coverage --json"]});var BLe=Um.command("translate-missing").description("Queue AI translation for every sequence and transactional email missing a language").option("--locale <locales...>","Enabled locales to translate into; omit for every non-primary locale").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>LR("translate-missing",{locales:e.locale,company:e.company,json:e.json}));S(BLe,{notes:["Translates emails that have no translation in a language yet, or whose last translation failed.","Edited, up-to-date and outdated translations are left alone. Use sync on one template to retranslate it.","Adding a language in the dashboard runs this automatically for that language."],examples:["sequenzy templates localizations translate-missing","sequenzy templates localizations translate-missing --locale fr de"]});var kLe=Um.command("set <id> <locale>").description("Create or replace a localized template variant").requiredOption("-s, --subject <subject>","Localized email subject").option("--preview-text <text>","Localized email preview text").option("--html <html>","Localized email HTML content").option("--html-file <file>","Read localized HTML from file").option("--blocks-json <json>","Inline JSON array of localized Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with localized Sequenzy email blocks").option("--keep-edits","Protect this localization from automatic translation on save").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Ha("set-localization",{id:e,locale:t,...n}));S(kLe,{notes:["The locale must be enabled in the company's localization settings and cannot be the primary locale.","Provide exactly one HTML or blocks content source.","Without --keep-edits, saving the template retranslates it when automatic translation is on."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html','sequenzy templates localizations set tmpl_123 fr-CA --subject "Bienvenue" --blocks-file ./welcome-fr-ca.json']});var RLe=Um.command("sync <id>").description("Queue AI translation for template locales").option("--locale <locales...>","Enabled locales to sync; omit to sync every non-primary locale").option("--skip-edited","Keep localizations someone edited instead of retranslating them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("sync-localizations",{id:e,locales:t.locale,...t.skipEdited===!0&&{skipEdited:!0},company:t.company,json:t.json}));S(RLe,{examples:["sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123","sequenzy templates localizations sync tmpl_123 --skip-edited"]});var TLe=vo.command("delete <id>").description("Delete a template").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("delete",{id:e,...t}));S(TLe,{notes:["Deletion fails when the template is still referenced by a campaign or sequence."],examples:["sequenzy templates delete tmpl_123"]});var OLe=vo.command("share <id>").description("Create or fetch the email's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("share",{id:e,...t}));S(OLe,{notes:["Accepts an email ID or a transactional email's ID or slug, so transactional and sequence emails can be shared with the ID you already hold.","The hosted page is anonymized: sample contact, inert unsubscribe link, no open/click tracking.","Idempotent - rerunning returns the same URL until you run `templates unshare`.","Campaigns have their own link that follows the A/B winner - use `campaigns share`."],examples:["sequenzy templates share tmpl_123","sequenzy templates share order-confirmation"]});var NLe=vo.command("unshare <id>").description("Revoke the email's public view-in-browser link").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ha("unshare",{id:e,...t}));S(NLe,{notes:["The shared URL returns 404 immediately after revocation."],examples:["sequenzy templates unshare tmpl_123"]});var Mm=Ve.command("companies").description("Inspect or create companies").action(()=>Mm.help());S(Mm,{notes:["Creating a company with a domain starts background website processing automatically; --without-website creates a ready company."],examples:["sequenzy companies list","sequenzy companies get comp_123","sequenzy companies update comp_123 --primary-color '#0ea5e9'","sequenzy companies create example.com --name Example"]});var $Le=Mm.command("list").description("List accessible companies").option("--json","Print raw JSON").action((e)=>$g("list",e));S($Le,{examples:["sequenzy companies list"]});var PLe=Mm.command("get <id>").description("Get company details").option("--json","Print raw JSON").action((e,t)=>$g("get",{id:e,...t}));S(PLe,{examples:["sequenzy companies get comp_123"]});var QLe=Mm.command("update <id>").description("Update company info, brand context, and reply tracking").option("-n, --name <name>","Company display name").option("--description <text>","Short product or company summary").option("--description-file <path>","Read description from a file").option("--logo-url <url>","Public logo URL").option("--dark-mode-logo-url <url>","Your own dark-mode version of the logo, used in every email instead of the automatic outlined copy").option("--automatic-dark-mode-logo","Remove your own dark-mode logo and go back to the automatic one").option("--founder-name <name>","Founder or sender name").option("--founder-photo-url <url>",'Square founder photo personal footers sign off with ("" removes it)').option("--founder-photo-file <path>","Upload a founder photo (JPG, PNG, WebP or GIF, up to 10MB); it is cropped to a square").option("--primary-color <hex>","Primary brand color, e.g. #f97316").option("--brand-colors-json <json>","Brand colors object as JSON").option("--brand-colors-file <path>","Read brand colors JSON from a file").option("--value-props-json <json>","Value propositions array as JSON").option("--value-props-file <path>","Read value propositions JSON from a file").option("--testimonials-json <json>","Testimonials array as JSON").option("--testimonials-file <path>","Read testimonials JSON from a file").option("--tone-voice <text>","Tone of voice guidance").option("--company-context <text>","Product knowledge for AI writing").option("--company-context-file <path>","Read product knowledge from a file").option("--email-design-prompt <text>","Art direction for AI-designed emails (layout, density, imagery)").option("--email-design-prompt-file <path>","Read the design prompt from a file").option("--email-length-preference <value>","Email length: concise, balanced, or detailed (new workspaces default to concise)").option("--email-style <style>","How AI writes emails by default: visual (designed), plain (simple text), or ask (clear the choice)").option("--category <type>","Company category: saas, content, ecommerce, offline, mobile_app or other (none clears it so website detection can set it). Drives recommended templates").option("--email-preset <preset>","Default header and footer: branded (logo and full footer) or minimal (compact footer, no logo)").option("--footer-style <style>","Footer style for new AI-designed emails: auto (fits your brand), classic, mono, band or editorial").option("--footer-mode <mode>","Footer type for new AI-designed emails: branded (the default) or personal (opens with the founder's sign-off: photo, name and title, in any style)").option("--footer-theme-json <json>","Auto-added footer colors and copy as JSON, merged into the stored theme (backgroundColor, companyTextColor, metaTextColor, linkColor, borderColor, reasonText, unsubscribeText, privacyPolicyText, showCompanyLine, style, mode; null resets a field, or pass null to reset all)").option("--footer-theme-file <path>","Read the auto-added footer theme JSON from a file").option("--social-links-json <json>","Social links object as JSON, keyed by platform (x, linkedin, ..., appstore, googleplay)").option("--social-links-file <path>","Read social links JSON from a file").option("--privacy-policy-url <url>","Privacy policy URL").option("--terms-url <url>","Terms of service URL").option("--address <address>","Physical mailing address").option("--language <code>","Primary language code").option("--pricing-json <json>","Pricing object as JSON").option("--pricing-file <path>","Read pricing JSON from a file").option("--font-family <family>","Default email font family").option("--email-theme-json <json>","Default email theme as JSON (partial: presetId, colors, typography, layout; pass null to reset)").option("--email-theme-file <path>","Read the default email theme JSON from a file").option("--email-direction <direction>","Default email direction: ltr or rtl").option("--sender-profile-id <id>","Existing sender profile to make the default (see `sequenzy sender-profiles list`)").option("--from-email <email>","Account-wide default From address (domain must be verified)").option("--from-name <name>","Display name of the default From profile (alone, it renames the current one)").option("--reply-profile-id <id>","Existing reply profile to make the default (see `sequenzy sender-profiles list`)").option("--reply-to <email>","Account-wide default Reply-To address").option("--reply-to-name <name>","Display name of the default Reply-To profile (alone, it renames the current one)").option("--enable-reply-tracking","Enable inbound reply tracking").option("--disable-reply-tracking","Disable inbound reply tracking").option("--reply-tracking-domain-mode <mode>","Reply domain mode: sequenzy or custom").option("--enable-reply-forwarding","Enable captured reply forwarding").option("--disable-reply-forwarding","Disable captured reply forwarding").option("--default-list <id>","List new contacts join by default when nothing targets them (repeatable)",(e,t=[])=>[...t,e]).option("--default-lists-none","New contacts join no list unless something targets them").option("--rename-matching-footers","Rename exact matching footer names in editable emails and saved components; requires --name and --previous-company-name").option("--previous-company-name <name>","Current company name to match when renaming footers").option("--default-lists-all","New contacts join every current and future list").option("--json","Print raw JSON").action((e,t)=>$g("update",{id:e,...t}));S(QLe,{notes:["The default-list flags set which lists a new contact joins when nothing targets it explicitly - forms, API writes, events, imports, and live ingestion from integrations without their own list targeting (Dodo Payments, PostHog, WooCommerce). Payment-provider backfills follow this setting; PostHog history imports instead create contacts without list memberships. `companies get <id>` reports the current value.","`--default-lists-all`, `--default-lists-none`, and `--default-list` are three different things: all lists, no list at all, and exactly the listed ones. They are mutually exclusive.","Changing this only affects later writes. Nobody is moved or removed from a list retroactively, so a list already polluted by a backfill still needs `sequenzy lists remove-subscribers`.","The default-list flags need an API key with the companies:manage scope. In the dashboard the same setting lives under Contacts -> Lists -> Default Lists.","Footer type (font, size, line height) lives in the email theme: `--email-theme-json` with typography.footerFontFamily, footerFontSize (10-16px) and footerLineHeight (1-2). It applies to footer blocks and the auto-added footer; null resets each field. `--footer-theme-json` sets the auto-added footer's colors and copy.","`--enable-reply-tracking` turns Inbox on. A workspace that has never received a conversation needs a verified receiving domain first (otherwise the API answers 409 receiving_domain_required): add one with `sequenzy receiving-domains add <domain>`, and Inbox turns on by itself once its DNS records are verified."],examples:["sequenzy companies update comp_123 --primary-color '#0ea5e9'","sequenzy companies update comp_123 --default-list list_abc --default-list list_def","sequenzy companies update comp_123 --category mobile_app","sequenzy companies update comp_123 --founder-photo-file ./founder.jpg --footer-mode personal","sequenzy companies update comp_123 --default-lists-none",`sequenzy companies update comp_123 --email-theme-json '{"colors":{"mutedText":"#4b5563"},"typography":{"baseFontSize":16}}'`,`sequenzy companies update comp_123 --email-theme-json '{"typography":{"footerFontFamily":"Georgia, serif","footerFontSize":13,"footerLineHeight":1.5}}'`,`sequenzy companies update comp_123 --footer-theme-json '{"linkColor":"#0ea5e9","reasonText":"You signed up at example.com."}'`,"sequenzy companies update comp_123 --company-context-file ./product.md --tone-voice 'clear, direct, warm'","sequenzy companies update comp_123 --from-name 'Example'","sequenzy companies update comp_123 --sender-profile-id sender_abc123 --from-name 'Example News'","sequenzy companies update comp_123 --enable-reply-tracking --reply-tracking-domain-mode sequenzy",`sequenzy companies update comp_123 --value-props-json '[{"title":"Fast setup","description":"Launch lifecycle emails in minutes."}]'`]});var qLe=Mm.command("create [domain]").description("Create a company with or without a website").option("-n, --name <name>","Company name").option("--without-website","Start without a website (requires --name)").option("-d, --description <text>","Business description, up to 500 characters. With a domain, website processing may replace it").option("--description-file <path>","Read the business description from a file").option("--with-welcome-sequence","Create and generate the four-email welcome sequence").option("--category <type>","Company category: saas, content, ecommerce, offline, mobile_app or other. Omit to detect it from the website").option("--json","Print raw JSON").action((e,t)=>$g("create",{domain:e,...t}));S(qLe,{examples:["sequenzy companies create example.com","sequenzy companies create https://example.com --name Example","sequenzy companies create calmly.app --category mobile_app",'sequenzy companies create --without-website --name Acme --description "Meal plans for night-shift nurses" --with-welcome-sequence']});var Pi=Ve.command("accounts").alias("organizations").description("Manage your customers' organizations (accounts) and their members").option("--search <text>","Match name, external ID or domain").option("--page <n>","Page number").option("--limit <n>","Results per page (max 100)").option("--sort <field>","Sort by updatedAt, createdAt, name, memberCount or lastEventAt").option("--order <dir>","asc or desc").option("--without-event-recipients","Only accounts with members but no owner or admin").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Qo("list",e));S(Pi,{notes:["Running `sequenzy accounts` without a subcommand lists accounts.","These are your customers' organizations. For your own Sequenzy login, API key and workspaces, use `sequenzy account`.","The first account turns Accounts on for the workspace. It fails with a 409 error if contacts already use a custom attribute named `account` or `account.*`; rename that attribute first.","Accounts are identified by your own external ID (the organization or workspace id in your app).","The dashboard calls accounts Organizations; `sequenzy organizations` is the same command.","Organization attributes reach every member as `organization.<name>` for segments and sequence conditions and as `{{organization.<name>}}` merge tags. `account.*` is an older alias."],examples:["sequenzy accounts list --search acme","sequenzy accounts get org_123","sequenzy accounts upsert org_123 --name Acme --domain acme.com --attr plan=pro --attr seats=5","sequenzy accounts add-member org_123 --email jane@acme.com --role owner","sequenzy accounts event org_123 trial_ending --property daysLeft=3 --recipients owners","sequenzy accounts suggestions","sequenzy accounts detect-org-ids"]});var FLe=Pi.command("list").description("List accounts").option("--search <text>","Match name, external ID or domain").option("--page <n>","Page number").option("--limit <n>","Results per page (max 100)").option("--sort <field>","updatedAt, createdAt, name, memberCount, lastEventAt").option("--order <dir>","asc or desc").option("--without-event-recipients","Only accounts with members but no owner or admin").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("list",t.optsWithGlobals()));S(FLe,{notes:["Account events go to owners (or admins) by default. `--without-event-recipients` finds accounts whose alerts reach nobody, such as bulk-created accounts where everyone is a member."],examples:["sequenzy accounts list --sort memberCount --order desc","sequenzy accounts list --without-event-recipients"]});var LLe=Pi.command("get <externalId>").description("Show a customer organization (account) and its members").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("get",{externalId:e,...t}));S(LLe,{examples:["sequenzy accounts get org_123"]});var ULe=Pi.command("upsert <externalId>").description("Create or update a customer organization (account) by external ID").option("--name <name>","Display name").option("--domain <domain>","Primary domain, e.g. acme.com").option("--attr <key=value>","Account attribute (repeatable). `key=` clears a key.",(e,t=[])=>[...t,e]).option("--replace-attributes","Replace all attributes instead of merging").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("upsert",{externalId:e,...t}));S(ULe,{notes:["Numbers and booleans in --attr are coerced; everything else stays a string."],examples:["sequenzy accounts upsert org_123 --name Acme --attr plan=pro --attr seats=5","sequenzy accounts upsert org_123 --attr legacyPlan="]});var MLe=Pi.command("delete <externalId>").description("Delete a customer organization (account); contacts are kept. Never your Sequenzy account").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("delete",{externalId:e,...t}));S(MLe,{notes:["Deletes one of your customers' organizations (Subscribers > Organizations in the dashboard) and its memberships. Member contacts are kept and their `organization.*` attributes are cleared.","It never deletes your Sequenzy account, workspace or login. Nothing in the CLI does."],examples:["sequenzy accounts delete org_123 --yes"]});var jLe=Pi.command("members <externalId>").description("List a customer organization's members with roles").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("members",{externalId:e,...t}));S(jLe,{examples:["sequenzy accounts members org_123"]});var zLe=Pi.command("add-member <externalId>").description("Add a contact to a customer organization").option("--email <email>","Contact email (created when new)").option("--subscriber-external-id <id>","Contact external ID").option("--role <role>","owner, admin or member").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("add-member",{externalId:e,...t}));S(zLe,{notes:["Re-adding a member without --role keeps the current role."],examples:["sequenzy accounts add-member org_123 --email jane@acme.com --role owner"]});var GLe=Pi.command("remove-member <externalId>").description("Remove a contact from a customer organization").option("--email <email>","Contact email").option("--subscriber-external-id <id>","Contact external ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("remove-member",{externalId:e,...t}));S(GLe,{examples:["sequenzy accounts remove-member org_123 --email bob@acme.com"]});var HLe=Pi.command("events <externalId>").description("List recent events on a customer organization").option("--limit <n>","Number of events (max 500)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("events",{externalId:e,...t}));S(HLe,{examples:["sequenzy accounts events org_123 --limit 20"]});var JLe=Pi.command("event <externalId> <event>").description("Trigger an event on a customer organization and deliver it to members").option("--property <key=value>","Event property (repeatable)",(e,t=[])=>[...t,e]).option("--recipients <rule>","owners (default), admins, all or none").option("--event-id <id>","Idempotency key for retries").option("--occurred-at <timestamp>","Original event time (ISO 8601)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Qo("event",{externalId:e,event:t,...n}));S(JLe,{notes:["Recipients receive the event as a contact event with `event.organization.*` (also `event.account.*`) properties, so sequences and sync rules run per person. Use enrollment field `organization.externalId` to run a sequence once per organization.","Owners fall back to admins when an account has no owner."],examples:["sequenzy accounts event org_123 trial_ending --property daysLeft=3","sequenzy accounts event org_123 seat_limit_reached --recipients admins"]});var KLe=Pi.command("suggestions").description("Suggest accounts from work email domains contacts share").option("--min-contacts <n>","Contacts a domain needs (default 3)").option("--limit <n>","Number of suggestions (default 25, max 100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Qo("suggestions",e));S(KLe,{notes:["Skips personal and disposable email providers, your own sending domains, domains where any contact already belongs to an account, and domains an account already uses. Shows up to three sample emails per domain.","Read-only: nothing is created until you run `accept-suggestions`."],examples:["sequenzy accounts suggestions","sequenzy accounts suggestions --min-contacts 5 --json"]});var VLe=Pi.command("accept-suggestions <domains...>").description("Create accounts from suggested email domains").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Qo("accept-suggestions",{domains:e,...t}));S(VLe,{notes:["Each domain becomes an account (external ID and domain set to the domain) with the domain's contacts as members. Contacts already in another account stay there, and a domain already partly grouped is skipped.","When one account already uses the domain, contacts are added to it instead. Up to 25 domains per call; safe to retry. No sync rules or segment-entered sequences run."],examples:["sequenzy accounts accept-suggestions acme.com globex.com"]});var WLe=Pi.command("detect-org-ids").description("Find the organization ID your app already sends in events or contact attributes").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ng("detect",e));S(WLe,{notes:["Looks for event properties from the last 180 days and contact attributes named like workspaceId, organization_id, team_id or account_id, with how many organizations each holds and the matching name key when there is one.","Read-only. Preview a key with `preview-org-id` before creating accounts from it."],examples:["sequenzy accounts detect-org-ids","sequenzy accounts detect-org-ids --json"]});var YLe=Pi.command("preview-org-id <propertyKey>").description("Preview the accounts an organization ID would create").option("--source <source>","event (default) or attribute").option("--name-key <key>","Property or attribute with the organization name").option("--limit <n>","Organizations to show (default 5, max 50)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ng("preview",{propertyKey:e,...t}));S(YLe,{notes:["Shows the biggest organizations first: the name each account would get (from --name-key, otherwise the work email domain most of its contacts share), its contact count and sample emails.","Read-only: nothing is created until you run `create-from-org-id`."],examples:["sequenzy accounts preview-org-id workspaceId","sequenzy accounts preview-org-id account_id --source attribute --name-key company_name --limit 20"]});var ZLe=Pi.command("create-from-org-id <propertyKey>").description("Create one account per organization ID and add its contacts").option("--source <source>","event (default) or attribute").option("--name-key <key>","Property or attribute with the organization name").option("--wait","Wait until the accounts are created").option("-y, --yes","Skip the preview and confirmation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ng("create",{propertyKey:e,...t}));S(ZLe,{notes:["Shows a preview and asks before starting. Runs in the background; use --wait to wait, or check with `org-id-job`.","Accounts are named from --name-key, otherwise after the work email domain their contacts share. Existing names, domains and roles are kept, no emails are sent and no sequences start. Safe to rerun."],examples:["sequenzy accounts create-from-org-id workspaceId","sequenzy accounts create-from-org-id workspaceId --name-key workspaceName --yes --wait"]});var XLe=Pi.command("org-id-job <jobId>").description("Check a create-from-org-id run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ng("job",{jobId:e,...t}));S(XLe,{notes:["States: queued, running, completed (with accounts and memberships created) or failed (with the error)."],examples:["sequenzy accounts org-id-job backfill-accounts:comp_123:workspaceId"]});var YA=Ve.command("tags").description("Manage tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Pm("list",e));S(YA,{notes:["Running `sequenzy tags` without a subcommand lists tag definitions.","Tag names are normalized to lowercase with dashes; system tags cannot be changed or deleted."],examples:["sequenzy tags --company comp_123","sequenzy tags list","sequenzy tags create vip --color purple","sequenzy tags update tag_123 --color red","sequenzy tags delete tag_123 --yes"]});var eUe=YA.command("list").description("List tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Pm("list",e));S(eUe,{examples:["sequenzy tags list --company comp_123"]});var tUe=YA.command("create <name>").description("Create a tag definition").option("--color <color>","Tag color, e.g. gray, red, green, blue, purple").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Pm("create",{name:e,...t}));S(tUe,{notes:["Names are normalized to lowercase with dashes, so `VIP Customer` becomes `vip-customer`."],examples:["sequenzy tags create vip","sequenzy tags create vip --color purple"]});var nUe=YA.command("update <tagId>").description("Update a tag definition color").requiredOption("--color <color>","New tag color").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Pm("update",{tagId:e,...t}));S(nUe,{notes:["System tags cannot be updated."],examples:["sequenzy tags update tag_123 --color red"]});var rUe=YA.command("delete <tagId>").description("Delete a tag definition").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Pm("delete",{tagId:e,...t}));S(rUe,{notes:["Deleting a tag removes it from every subscriber.","Tags used by sequences cannot be deleted until those sequences stop referencing them."],examples:["sequenzy tags delete tag_123 --yes"]});var Tc=Ve.command("lists").description("Manage subscriber lists").action(()=>Tc.help());S(Tc,{examples:["sequenzy lists list --company comp_123",'sequenzy lists create Newsletter --description "Public newsletter list"','sequenzy lists update list_123 --name "Weekly Newsletter" --private',"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv","sequenzy lists remove-subscribers list_123 --email one@example.com","sequenzy lists import list_123 --emails-file ./batch-001.csv","sequenzy lists delete list_123 --yes"]});var iUe=Tc.command("list").description("List subscriber lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Rl("list",e));S(iUe,{examples:["sequenzy lists list --company comp_123"]});var oUe=Tc.command("create <name>").description("Create a subscriber list").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--allow-member-unsubscribe","Allow existing private-list members to opt out").option("--no-allow-member-unsubscribe","Hide private lists from member preferences").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("create",{name:e,...t}));S(oUe,{examples:['sequenzy lists create Newsletter --description "Public newsletter list"',"sequenzy lists create VIP --private --company comp_123"]});var sUe=Tc.command("add-subscribers <listId>").description("Add subscribers to a list from emails, JSON, or a file").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("add-subscribers",{listId:e,...t}));S(sUe,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used.","New subscribers are not enrolled in matching sequences unless --enroll-sequences is set."],examples:["sequenzy lists add-subscribers list_123 --email one@example.com two@example.com",`sequenzy lists add-subscribers list_123 --emails-json '["one@example.com","two@example.com"]'`,"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv"]});var aUe=Tc.command("import <listId>").description("Alias for add-subscribers; import subscribers into a list").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("add-subscribers",{listId:e,...t}));S(aUe,{notes:["`lists import` is an alias for `lists add-subscribers`.","Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used."],examples:["sequenzy lists import list_123 --emails-file ./batch-001.csv",`sequenzy lists import list_123 --emails-json '["one@example.com","two@example.com"]'`]});var cUe=Tc.command("update <listId>").description("Update a subscriber list").option("-n, --name <name>","List name").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--allow-member-unsubscribe","Allow existing private-list members to opt out").option("--no-allow-member-unsubscribe","Hide private lists from member preferences").option("--no-private","Mark the list as public").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("update",{listId:e,...t}));S(cUe,{notes:["Provide at least one of --name, --description, --private, --no-private, --allow-member-unsubscribe, or --no-allow-member-unsubscribe."],examples:['sequenzy lists update list_123 --name "Weekly Newsletter"',"sequenzy lists update list_123 --private","sequenzy lists update list_123 --no-private"]});var lUe=Tc.command("remove-subscribers <listId>").description("Remove subscribers from a list by email").option("-e, --email <emails...>","Email addresses to remove").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("remove-subscribers",{listId:e,...t}));S(lUe,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Subscribers are only removed from the list; they stay in your audience.","Emails that do not match a subscriber are reported as not found."],examples:["sequenzy lists remove-subscribers list_123 --email one@example.com two@example.com","sequenzy lists remove-subscribers list_123 --emails-file ./churned.csv"]});var uUe=Tc.command("delete <listId>").description("Delete a subscriber list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Rl("delete",{listId:e,...t}));S(uUe,{notes:["Deleting a list removes all of its memberships; subscribers themselves are kept."],examples:["sequenzy lists delete list_123 --yes"]});var _d=Ve.command("segments").description("Manage segments").action(()=>_d.help());S(_d,{notes:["Use --filter-json for arbitrary segment filters. The CLI will fill in missing filter IDs.","Use --match any to create a segment that matches any filter instead of all filters.",'Engagement filters (emailSent, emailDelivered, emailOpened, emailClicked, emailBounced, emailComplained) accept a time range as the value ("24h", "7d", "30d", "90d", "180d", "all"; whole hours go from "1h" to "8760h", and count filters are exact up to "168h"), a specific campaign ("campaign:<campaign_id>"), or an email-type scope ("marketing:<timeRange>" for marketing-policy campaign, automation, and Send API traffic; "transactional:<timeRange>" for transactional-policy sends). Policy scopes use send-time policy snapshots; ambiguous older automation and Send API events without a snapshot are not assigned to either scope. Combine multiple engagement filters with --match all to build things like "bounced campaign A but not campaign B".','Push filters: pushDevice (is/is_not with "any", "web", "ios" or "android") matches active push devices; pushSent, pushDelivered and pushClicked take is/is_not with a time range ("30d", "all") and ignore test sends.','Phone filters: phone takes is_not_empty/is_empty, or starts_with/not_starts_with/contains/not_contains with digits matched against the stored international number ("+44", "+1 415"); phoneCountry takes is/is_not with ISO country codes ("GB", or "US,CA" for several).'],examples:["sequenzy segments list --company comp_123",'sequenzy segments create --name "Bought Pro" --stripe-product prod_pro',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`,`sequenzy segments create --name "No marketing email this week" --filter-json '[{"field":"emailSent","operator":"is_not","value":"marketing:7d"}]'`,`sequenzy segments create --name "iOS, no push clicks" --filter-json '[{"field":"pushDevice","operator":"is","value":"ios"},{"field":"pushClicked","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "UK SMS subscribers" --filter-json '[{"field":"phoneCountry","operator":"is","value":"GB"},{"field":"smsStatus","operator":"is","value":"subscribed"}]'`,`sequenzy segments create --name "San Francisco numbers" --filter-json '[{"field":"phone","operator":"starts_with","value":"+1415"}]'`]});var dUe=_d.command("list").description("List all segments").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zp("list",e));S(dUe,{examples:["sequenzy segments list --company comp_123"]});var pUe=_d.command("create").description("Create a segment").requiredOption("-n, --name <name>","Segment name").option("-c, --company <id>","Company ID override for personal API keys").option("--match <mode>","How filters combine: all or any","all").option("--stripe-product <id>","Stripe product ID to segment on").option("--commerce-product <id>","Commerce product to segment on, as provider:productId (e.g. shopify:42); a bare ID matches any provider").option("--commerce-collection <key>","Commerce collection to segment on, as a collection ID or handle (e.g. skincare); optionally prefixed with a provider").option("--purchase-operator <operator>","Purchase operator (bought, didnt-buy, at-least, less-than)","bought").option("--payments <number>","Payment threshold for at-least/less-than").option("--orders <number>","Order threshold for at-least/less-than with --commerce-product or --commerce-collection").option("--engagement <field>","Email engagement field: emailSent, emailDelivered, emailOpened, emailClicked, emailBounced, or emailComplained").option("--engagement-operator <operator>","Engagement operator: is, is_not, is_temporary_bounce, is_permanent_bounce, at_least, or less_than_count","is").option("--engagement-scope <scope>","Engagement scope: any, marketing, transactional, or campaign","any").option("--engagement-range <range>","Engagement time range: hours such as 6h or 24h, days such as 7d or 30d, or all","all").option("--engagement-campaign <id>","Campaign ID when --engagement-scope is campaign").option("--engagement-count <number>","Event count for at_least/less_than_count engagement operators").option("--filter-json <json>","Raw JSON array of segment filters (IDs are optional)").option("--json","Print raw JSON").action((e)=>Zp("create",e));S(pUe,{notes:["For array-of-object attributes, positive filters sharing a wildcard array prefix (such as history_events[].venue and history_events[].date) and connected only by AND must match one shared array element. Negative is_not, not_contains, and is_empty filters remain independent."],examples:['sequenzy segments create --name "Bought Pro" --stripe-product prod_pro','sequenzy segments create --name "3+ Pro Payments" --stripe-product prod_pro --purchase-operator at-least --payments 3','sequenzy segments create --name "Starter Kit Buyers" --commerce-product api:prod-starter-kit','sequenzy segments create --name "Repeat Kit Buyers" --commerce-product api:prod-starter-kit --purchase-operator at-least --orders 2','sequenzy segments create --name "Skincare Buyers" --commerce-collection skincare','sequenzy segments create --name "Repeat Skincare Buyers" --commerce-collection skincare --purchase-operator at-least --orders 2','sequenzy segments create --name "Marketing openers" --engagement emailOpened --engagement-scope marketing --engagement-range all','sequenzy segments create --name "Did not open campaign" --engagement emailOpened --engagement-operator is_not --engagement-scope campaign --engagement-campaign cmp_abc',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var mUe=_d.command("count <id>").description("Get subscriber count for a segment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zp("count",{id:e,...t}));S(mUe,{examples:["sequenzy segments count seg_123 --company comp_123"]});var fUe=_d.command("update <id>").description("Update a segment name, filters, or join operator").option("-n, --name <name>","Segment name").option("--filters-json <json>","Raw JSON array of segment filters, or an object with a root group").option("--filters-file <file>","Path to a JSON file with segment filters or a root group").option("--join-operator <operator>","How filters combine: and or or").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zp("update",{id:e,...t}));S(fUe,{notes:["Provide at least one of --name, --filters-json, --filters-file, or --join-operator.","Filters replace the existing filter set; missing filter IDs are filled in by the CLI.","For array-of-object attributes, positive filters sharing a wildcard array prefix (such as history_events[].venue and history_events[].date) and connected only by AND must match one shared array element. Negative is_not, not_contains, and is_empty filters remain independent."],examples:['sequenzy segments update seg_123 --name "Churn Risk"',`sequenzy segments update seg_123 --filters-json '[{"field":"tag","operator":"contains","value":"vip"}]'`,"sequenzy segments update seg_123 --join-operator or"]});var gUe=_d.command("delete <id>").description("Delete a segment").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zp("delete",{id:e,...t}));S(gUe,{examples:["sequenzy segments delete seg_123 --yes"]});var eu=Ve.command("audience-syncs").description("Sync segments to Meta custom audiences").action(()=>eu.help());S(eu,{notes:["Requires the Meta Ads integration to be connected in the dashboard (Settings -> Integrations).",'Use --template to start from a ready-made segment ("zero-ltv", "no-purchase-1y", "recent-buyers", "high-spenders-ecom", "non-buyers", "engaged"); the segment is created automatically on first use.',"Audiences are add-only: subscribers who leave the segment stay in the Meta audience."],examples:["sequenzy audience-syncs list",'sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"']});var AUe=eu.command("list").description("List audience syncs with schedule and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yu("list",e));S(AUe,{examples:["sequenzy audience-syncs list --company comp_123"]});var hUe=eu.command("ad-accounts").description("List the connected Meta ad accounts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yu("ad-accounts",e));S(hUe,{examples:["sequenzy audience-syncs ad-accounts"]});var yUe=eu.command("create").description("Create an audience sync (segment -> Meta custom audience)").option("--segment <id>","Existing segment ID to sync").option("--template <id>",'Predefined segment template (for example "recent-buyers", "zero-ltv", "no-purchase-1y")').requiredOption("--ad-account <id>","Meta ad account ID (see `sequenzy audience-syncs ad-accounts`)").requiredOption("-n, --name <name>","Audience name in Meta Ads Manager").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly","daily").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yu("create",e));S(yUe,{examples:['sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"','sequenzy audience-syncs create --segment seg_123 --ad-account act_123 --name "Sequenzy - VIPs" --frequency hourly']});var bUe=eu.command("update <id>").description("Change an audience sync's frequency or pause/resume it").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly").option("--active <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yu("update",{id:e,...t}));S(bUe,{examples:["sequenzy audience-syncs update sync_123 --frequency weekly","sequenzy audience-syncs update sync_123 --active false"]});var vUe=eu.command("delete <id>").description("Remove an audience sync (the Meta audience itself is kept)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yu("delete",{id:e,...t}));S(vUe,{examples:["sequenzy audience-syncs delete sync_123"]});var EUe=eu.command("sync <id>").description("Trigger an immediate sync run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yu("sync",{id:e,...t}));S(EUe,{examples:["sequenzy audience-syncs sync sync_123"]});var mC=Ve.command("warehouse").description("Sync contacts and events from Snowflake, BigQuery, Redshift or Postgres").action(()=>mC.help());S(mC,{notes:["Connect a warehouse with a read-only user, then create syncs that run a SELECT query on a schedule.","Subscriber syncs import contacts through the same pipeline as imports; event syncs record events on existing contacts.","Each run only sends rows that changed. Set --cursor-column (for example updated_at) so runs read only new rows."],examples:[`${Vl}=... sequenzy warehouse connections create --provider postgres --name Analytics --host db.example.com --database analytics --username reader`,"sequenzy warehouse connections preview conn_123 --query 'select email, plan from customers'",`sequenzy warehouse syncs create --connection conn_123 --name Customers --query-file customers.sql --mapping-json '{"emailColumn":"email","attributes":[{"column":"plan","attribute":"plan"}]}' --cursor-column updated_at`]});var tu=mC.command("connections").description("Manage warehouse connections").action(()=>tu.help());tu.command("list").description("List warehouse connections").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Wl("list",e));tu.command("get <id>").description("Show a warehouse connection").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("get",{id:e,...t}));var IUe=tu.command("create").description("Connect a warehouse (runs a test query before saving)").requiredOption("--provider <provider>","snowflake, bigquery, redshift or postgres").requiredOption("-n, --name <name>","Display name").option("--config-json <json>","Connection settings as JSON (merged with the flags below)").option("--account <account>","Snowflake account identifier").option("--username <user>","Database user").option("--warehouse <warehouse>","Snowflake warehouse").option("--database <database>","Database name").option("--schema <schema>","Snowflake schema").option("--role <role>","Snowflake role").option("--project-id <id>","BigQuery project ID").option("--location <location>","BigQuery location, for example US").option("--host <host>","Redshift/Postgres host").option("--port <port>","Redshift/Postgres port").option("--ssl-mode <mode>","require or verify-full").option("--private-key-file <path>","Snowflake PKCS#8 private key (PEM file)").option("--private-key-passphrase <passphrase>","Passphrase for an encrypted key").option("--service-account-file <path>","BigQuery service account key (JSON file)").option("--password <password>",`Redshift/Postgres password (or set ${Vl})`).option("--credentials-file <path>","All credentials as a JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Wl("create",e));S(IUe,{examples:["sequenzy warehouse connections create --provider snowflake --name Snowflake --account myorg-myaccount --username SEQUENZY_READER --warehouse ANALYTICS_WH --database PROD --private-key-file rsa_key.p8","sequenzy warehouse connections create --provider bigquery --name BigQuery --project-id acme-analytics --service-account-file key.json",`${Vl}=... sequenzy warehouse connections create --provider redshift --name Redshift --host cluster.abc.us-east-1.redshift.amazonaws.com --database analytics --username reader`]});tu.command("update <id>").description("Rename, change settings or rotate credentials (re-tested before saving)").option("-n, --name <name>","Display name").option("--config-json <json>","Connection settings as JSON (merged with the flags below)").option("--account <account>","Snowflake account identifier").option("--username <user>","Database user").option("--warehouse <warehouse>","Snowflake warehouse").option("--database <database>","Database name").option("--schema <schema>","Snowflake schema").option("--role <role>","Snowflake role").option("--project-id <id>","BigQuery project ID").option("--location <location>","BigQuery location, for example US").option("--host <host>","Redshift/Postgres host").option("--port <port>","Redshift/Postgres port").option("--ssl-mode <mode>","require or verify-full").option("--private-key-file <path>","Snowflake PKCS#8 private key (PEM file)").option("--private-key-passphrase <passphrase>","Passphrase for an encrypted key").option("--service-account-file <path>","BigQuery service account key (JSON file)").option("--password <password>","New Redshift/Postgres password").option("--password-from-env",`Rotate the Redshift/Postgres password to ${Vl}`).option("--credentials-file <path>","All credentials as a JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("update",{id:e,...t}));tu.command("delete <id>").description("Delete a connection (delete its syncs first)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("delete",{id:e,...t}));tu.command("test <id>").description("Run a test query with the stored credentials").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("test",{id:e,...t}));tu.command("preview <id>").description("Run a query with a 20-row limit to see its columns").option("--query <sql>","SELECT query").option("--query-file <path>","File with the SELECT query").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wl("preview",{id:e,...t}));var nu=mC.command("syncs").description("Manage warehouse syncs").action(()=>nu.help());nu.command("list").description("List syncs with status and the latest run").option("--connection <id>","Only syncs of this connection").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yl("list",e));nu.command("get <id>").description("Show a sync").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("get",{id:e,...t}));var CUe=nu.command("create").description("Create a sync (columns are checked against the query; the first run starts now)").requiredOption("--connection <id>","Warehouse connection ID").requiredOption("-n, --name <name>","Display name").option("--kind <kind>","subscribers or events","subscribers").option("--query <sql>","SELECT query").option("--query-file <path>","File with the SELECT query").option("--mapping-json <json>","Column mapping as JSON").option("--mapping-file <path>","Column mapping as a JSON file").option("--cursor-column <column>","Column for incremental reads (for example updated_at)").option("--frequency <frequency>","every_15_minutes, hourly, daily, weekly or manual").option("--lists <ids>","Comma-separated list IDs for new contacts (subscriber syncs)").option("--opt-in-mode <mode>","confirmed or double_opt_in (subscriber syncs)").option("--trigger-automations","Let new contacts or recent events start automations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Yl("create",e));S(CUe,{notes:['Subscriber mapping: {"emailColumn","phoneColumn","externalIdColumn","firstNameColumn","lastNameColumn","tagsColumn","attributes":[{"column","attribute"}]}.','Event mapping: {"emailColumn" or "externalIdColumn", "eventNameColumn" or "eventName", "eventIdColumn", "occurredAtColumn", "properties":[{"column","property"}]}.'],examples:[`sequenzy warehouse syncs create --connection conn_123 --name Customers --query 'select email, first_name, plan, updated_at from customers' --mapping-json '{"emailColumn":"email","firstNameColumn":"first_name","attributes":[{"column":"plan","attribute":"plan"}]}' --cursor-column updated_at --frequency hourly`,`sequenzy warehouse syncs create --connection conn_123 --name Orders --kind events --query-file orders.sql --mapping-json '{"emailColumn":"email","eventName":"order_placed","eventIdColumn":"order_id","occurredAtColumn":"placed_at"}'`]});nu.command("update <id>").description("Change the query, mapping, schedule or options; pause or resume").option("-n, --name <name>","Display name").option("--query <sql>","SELECT query").option("--query-file <path>","File with the SELECT query").option("--mapping-json <json>","Column mapping as JSON").option("--mapping-file <path>","Column mapping as a JSON file").option("--cursor-column <column>","Column for incremental reads (for example updated_at)").option("--frequency <frequency>","every_15_minutes, hourly, daily, weekly or manual").option("--lists <ids>","Comma-separated list IDs for new contacts (subscriber syncs)").option("--opt-in-mode <mode>","confirmed or double_opt_in (subscriber syncs)").option("--trigger-automations","Let new contacts or recent events start automations").option("--no-trigger-automations","Stop starting automations").option("--enabled <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("update",{id:e,...t}));nu.command("delete <id>").description("Delete a sync (imported contacts and events stay)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("delete",{id:e,...t}));nu.command("run <id>").description("Run a sync now").option("--full-resync","Forget what was sent and send every row again").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("run",{id:e,...t}));nu.command("runs <id>").description("Show recent runs with row counts, import progress and errors").option("--limit <n>","Number of runs (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Yl("runs",{id:e,...t}));var Ka=Ve.command("data-exports").description("Stream events and subscriber snapshots to your S3 or GCS bucket").action(()=>Ka.help());S(Ka,{notes:["Files are gzipped JSON lines under <prefix>/<dataset>/date=YYYY-MM-DD/, ready for Snowflake, BigQuery, Redshift, Athena or DuckDB.","Datasets: email_events, sms_events, custom_events, subscribers (daily snapshot). Rows are delivered at least once; deduplicate on id.",`Pass the secret with --secret-access-key or the ${Qa} environment variable. It is never returned by the API.`],examples:["sequenzy data-exports list",`${Qa}=... sequenzy data-exports create --name "Lake" --bucket acme-exports --region us-east-1 --access-key-id AKIA...`,"sequenzy data-exports runs exp_123"]});var wUe=Ka.command("list").description("List data exports with progress and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>bc("list",e));S(wUe,{examples:["sequenzy data-exports list --json"]});var SUe=Ka.command("get <id>").description("Show one data export").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("get",{id:e,...t}));S(SUe,{examples:["sequenzy data-exports get exp_123"]});var DUe=Ka.command("create").description("Add a bucket destination (verifies access with a test file)").requiredOption("-n, --name <name>","Display name").option("--provider <provider>","s3 (AWS or S3-compatible) or gcs","s3").requiredOption("--bucket <bucket>","Bucket name").option("--region <region>","Bucket region (required for AWS S3)").option("--endpoint <url>","Custom S3-compatible endpoint (R2, MinIO, Backblaze)").option("--prefix <path>","Path prefix inside the bucket").requiredOption("--access-key-id <id>","Access key ID (GCS: HMAC access ID)").option("--secret-access-key <secret>",`Secret access key (or set ${Qa})`).option("--datasets <list>","Comma-separated: email_events,sms_events,custom_events,subscribers").option("--frequency <frequency>","every_5_minutes, every_15_minutes, hourly or daily").option("--backfill-days <days>","Include up to 30 days of events already recorded (default 0)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>bc("create",e));S(DUe,{examples:[`${Qa}=... sequenzy data-exports create --name "Lake" --bucket acme-exports --region us-east-1 --access-key-id AKIA... --prefix sequenzy`,`${Qa}=... sequenzy data-exports create --name "GCS" --provider gcs --bucket acme --access-key-id GOOG1... --datasets email_events,subscribers --backfill-days 7`]});var _Ue=Ka.command("update <id>").description("Change datasets, frequency, location or credentials; pause or resume").option("-n, --name <name>","Display name").option("--bucket <bucket>","Bucket name").option("--region <region>","Bucket region").option("--endpoint <url>","Custom S3-compatible endpoint").option("--prefix <path>","Path prefix inside the bucket").option("--access-key-id <id>","New access key ID (rotates credentials)").option("--secret-access-key <secret>",`New secret (or set ${Qa})`).option("--datasets <list>","Comma-separated datasets").option("--frequency <frequency>","every_5_minutes, every_15_minutes, hourly or daily").option("--enabled <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("update",{id:e,...t}));S(_Ue,{examples:["sequenzy data-exports update exp_123 --frequency hourly","sequenzy data-exports update exp_123 --enabled false","sequenzy data-exports update exp_123 --datasets email_events,custom_events"]});var xUe=Ka.command("delete <id>").description("Delete a data export (files already written are kept)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("delete",{id:e,...t}));S(xUe,{examples:["sequenzy data-exports delete exp_123 --yes"]});var BUe=Ka.command("test <id>").description("Write a test file to confirm the credentials still work").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("test",{id:e,...t}));S(BUe,{examples:["sequenzy data-exports test exp_123"]});var kUe=Ka.command("run <id>").description("Start an export now instead of waiting for the schedule").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("run",{id:e,...t}));S(kUe,{examples:["sequenzy data-exports run exp_123"]});var RUe=Ka.command("runs <id>").description("Show recent export runs (last 14 days)").option("--limit <n>","Number of runs (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>bc("runs",{id:e,...t}));S(RUe,{examples:["sequenzy data-exports runs exp_123 --limit 5"]});var ru=Ve.command("products").description("Manage products and digital delivery files").action(()=>ru.help());S(ru,{notes:["Products sync from Stripe, Shopify, and WooCommerce integrations.","Attach a deliverable file to a Stripe product, then reference it in purchase sequence emails with {{event.download.url}} and {{event.download.name}}."],examples:["sequenzy products list --provider stripe","sequenzy products sync",'sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --file ./ebook.pdf',"sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/guide.pdf --name guide.pdf","sequenzy products detach-file prod_abc","sequenzy products delete my-ebook"]});var TUe=ru.command("list").description("List synced products including attached delivery files").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Filter by provider (stripe, shopify, woocommerce, manual)").option("--search <query>","Filter products by title").option("--limit <number>","Products per page (1-100, default 50)").option("--offset <number>","Number of products to skip").option("--all","Fetch every page instead of just the first").option("--json","Print raw JSON").action((e)=>rd("list",e));S(TUe,{notes:["Returns one page by default. The header shows 'N of TOTAL' when the catalog is larger than the page.","Use --all to page through catalogs larger than the 100-per-request cap."],examples:["sequenzy products list --provider stripe","sequenzy products list --all","sequenzy products list --limit 100 --offset 100"]});var OUe=ru.command("sync").description("Queue a Stripe product catalog sync").option("-c, --company <id>","Company ID override for personal API keys").option("--integration <id>","Stripe integration ID to sync").option("--json","Print raw JSON").action((e)=>rd("sync",e));S(OUe,{examples:["sequenzy products sync --company comp_123","sequenzy products sync --integration int_123"]});var NUe=ru.command("upsert [productId]").description("Create or update products in the catalog (Commerce API, keyed by your productId)").option("--title <title>","Product title (required for single upserts)").option("--description <text>","Product description").option("--price-cents <cents>","Price in the smallest currency unit").option("--currency <code>","ISO currency code, e.g. USD").option("--image-url <url>","Product image URL").option("--product-url <url>","Product page URL").option("--provider-created-at <iso>","Product creation time from the source catalog (ISO 8601)").option("--clear-provider-created-at","Clear the stored source-catalog creation time").option("--in-stock","Mark the product as in stock").option("--out-of-stock","Mark the product as out of stock").option("--file <path>","Deliverable file to upload and attach in one step").option("--url <link>","External deliverable http(s) link to attach in one step").option("--name <fileName>","Display name for the attached deliverable").option("--products-json <json>","Inline JSON array of products to upsert").option("--products-file <file>","Path to a JSON file with products to upsert").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("upsert",t,e));S(NUe,{notes:["Products are keyed by your own productId and stored under the api provider.","Combine --file or --url with a single-product upsert to attach the deliverable file in the same command.","Use --products-json/--products-file for bulk upserts of up to 100 products."],examples:['sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --currency USD --file ./ebook.pdf','sequenzy products upsert my-course --title "The Course" --url https://files.example.com/course.zip',"sequenzy products upsert --products-file ./products.json"]});var $Ue=ru.command("delete <productId>").description("Delete a product previously pushed via the Commerce API").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("delete",t,e));S($Ue,{examples:["sequenzy products delete my-ebook"]});var PUe=ru.command("attach-file <id>").description("Attach the deliverable file buyers receive after purchase").option("--file <path>","Local file to upload (PDF, ePub, ZIP, media)").option("--url <link>","External http(s) link instead of an upload").option("--name <fileName>","Display name for the file (e.g. guide.pdf)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("attach-file",t,e));S(PUe,{examples:["sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/template.zip --name template.zip"]});var QUe=ru.command("detach-file <id>").description("Remove the attached delivery file from a product").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>rd("detach-file",t,e));S(QUe,{examples:["sequenzy products detach-file prod_abc"]});var ZA=Ve.command("team").description("Manage team members and invitations").action(()=>ZA.help());S(ZA,{notes:["Inviting and cancelling invitations requires owner or admin access.","Billing access can only be granted by the company owner."],examples:["sequenzy team list","sequenzy team invite teammate@example.com --role admin","sequenzy team cancel-invitation inv_123"]});var qUe=ZA.command("list").description("List team members and pending invitations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>eC("list",e));S(qUe,{examples:["sequenzy team list --company comp_123"]});var FUe=ZA.command("invite <email>").description("Invite a team member or add an existing user").requiredOption("--role <role>","Member role: admin, viewer, or restricted").option("--billing-access","Allow the member to manage billing (owner only)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>eC("invite",{email:e,...t}));S(FUe,{notes:["Existing Sequenzy users with a confirmed email are added to the team immediately; everyone else receives an email invitation.","Invitations expire automatically and can be re-sent by inviting the same email again after cancelling."],examples:["sequenzy team invite teammate@example.com --role admin","sequenzy team invite editor@example.com --role restricted","sequenzy team invite finance@example.com --role viewer --billing-access"]});var LUe=ZA.command("cancel-invitation <invitationId>").description("Cancel a pending team invitation").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>eC("cancel-invitation",{invitationId:e,...t}));S(LUe,{notes:["Run `sequenzy team list` first to find invitation IDs."],examples:["sequenzy team cancel-invitation inv_123 --yes"]});var Eo=Ve.command("inbox").description("Read and answer email in your inbox").action(()=>Eo.help());S(Eo,{notes:["The inbox receives replies to your campaigns, sequences, and transactional email, plus any email sent to your inbox address (sequenzy inbox address).","Use --note on replies to add an internal note instead of emailing the contact."],examples:["sequenzy inbox address","sequenzy inbox list --status open --unread","sequenzy inbox get conv_123","sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox close conv_123","sequenzy inbox close conv_123 conv_456"]});var UUe=Eo.command("address").description("Show or set the address anyone can email to reach your inbox").option("--local-part <name>","Use <name>@<domain> on one of your receiving domains (with --domain)").option("--domain <domain>","Receiving domain for --local-part").option("--reset","Go back to your Sequenzy inbox address").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qo("address",e));S(UUe,{notes:["Email sent to this address arrives as a new conversation, or joins an existing thread when it answers one.","Receiving must be on (Settings > Inbox) for mail to arrive.","With --local-part and --domain the address becomes <name>@<domain>, where <domain> is one of your receiving domains (see `sequenzy receiving-domains`). It starts receiving once that domain is verified; inbox+{companyId}@inbound.sequenzy.com keeps working.","Any other address on a receiving domain also lands in Inbox."],examples:["sequenzy inbox address","sequenzy inbox address --local-part support --domain acme.com","sequenzy inbox address --reset"]});var MUe=Eo.command("list").description("List conversations").option("-s, --status <status>","Filter by status: open, closed, or all").option("--search <query>","Search by contact email, name, or subject").option("--unread","Only conversations with unread messages").option("--spam","List the Spam folder instead of the inbox").option("--sent-to <address>","Only conversations that started at this inbox address").option("-p, --page <number>","Page number (default 1)").option("-l, --limit <number>","Results per page (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qo("list",e));S(MUe,{notes:["Mail the spam or virus scan flags goes to the Spam folder; other lists leave it out. See `sequenzy inbox recipients` for the addresses --sent-to accepts."],examples:["sequenzy inbox list","sequenzy inbox list --status open --unread",'sequenzy inbox list --search "refund" --limit 50',"sequenzy inbox list --spam","sequenzy inbox list --sent-to admin@example.com"]});var jUe=Eo.command("recipients").description("List the inbox addresses conversations started at").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>qo("recipients",e));S(jUe,{examples:["sequenzy inbox recipients"]});var zUe=Eo.command("get <conversationId>").description("Get a conversation with its full message history").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("get",{conversationId:e,...t}));S(zUe,{examples:["sequenzy inbox get conv_123","sequenzy inbox get conv_123 --json"]});var GUe=Eo.command("reply <conversationId>").description("Reply to a conversation or add an internal note").option("-t, --text <text>","Plain text message body").option("--html-file <file>","Read an HTML message body from file").option("-s, --subject <subject>","Override the reply subject").option("--note","Add an internal note instead of emailing the subscriber").option("--sender-profile-id <id>","Reply from this sender profile instead of the default. See sequenzy sender-profiles list").option("--attach <file>","Attach a file (repeat for up to 10 files, 15 MB total)",(e,t=[])=>[...t,e]).option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("reply",{conversationId:e,...t}));S(GUe,{notes:["Provide a body with --text and/or --html-file.","Outbound replies are emailed to the subscriber and reopen closed conversations; notes are internal only.","--sender-profile-id sends the reply from that sender profile; its domain must be verified. Without it, the reply uses the API key owner's address.","--attach can be repeated; attachments need attachment storage on the server (see sequenzy inbox address)."],examples:["sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox reply conv_123 --text 'Invoice attached' --attach ./invoice.pdf","sequenzy inbox reply conv_123 --text 'Happy to help' --sender-profile-id sp_123","sequenzy inbox reply conv_123 --html-file ./reply.html","sequenzy inbox reply conv_123 --text 'Customer asked for a refund' --note"]});var HUe=Eo.command("close <conversationIds...>").description("Close one or more conversations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("close",{conversationIds:e,...t}));S(HUe,{notes:["Pass up to 100 conversation IDs to close them in one request. Already closed conversations are reported as unchanged; missing IDs are reported and exit with status 1."],examples:["sequenzy inbox close conv_123","sequenzy inbox close conv_123 conv_456 conv_789"]});var JUe=Eo.command("reopen <conversationIds...>").description("Reopen one or more closed conversations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("reopen",{conversationIds:e,...t}));S(JUe,{notes:["Pass up to 100 conversation IDs to reopen them in one request. Missing IDs are reported and exit with status 1."],examples:["sequenzy inbox reopen conv_123","sequenzy inbox reopen conv_123 conv_456"]});var KUe=Eo.command("spam <conversationIds...>").description("Move one or more conversations to the Spam folder").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("spam",{conversationIds:e,...t}));S(KUe,{notes:["Pass up to 100 conversation IDs. Missing IDs are reported and exit with status 1."],examples:["sequenzy inbox spam conv_123 conv_456"]});var VUe=Eo.command("not-spam <conversationIds...>").description("Move one or more conversations from Spam back to the inbox").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("not-spam",{conversationIds:e,...t}));S(VUe,{notes:["Pass up to 100 conversation IDs. Missing IDs are reported and exit with status 1."],examples:["sequenzy inbox not-spam conv_123"]});var WUe=Eo.command("mark-read <conversationId>").description("Mark all messages in a conversation as read").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("mark-read",{conversationId:e,...t}));S(WUe,{examples:["sequenzy inbox mark-read conv_123"]});var YUe=Eo.command("mark-unread <conversationId>").description("Mark a conversation unread again").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>qo("mark-unread",{conversationId:e,...t}));S(YUe,{notes:["Its latest received message becomes unread again."],examples:["sequenzy inbox mark-unread conv_123"]});var ZUe=Eo.command("forward <conversationId> <messageId>").description("Email a copy of one message to another address").requiredOption("--to <email>","Address to forward the message to").option("--sender-profile-id <id>","Forward from this sender profile instead of the company default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>qo("forward",{conversationId:e,messageId:t,...n}));S(ZUe,{notes:["Get message IDs from sequenzy inbox get. Received and sent emails can be forwarded, including their attachments; notes cannot.","The forward is recorded in the conversation and does not change its status or unread state."],examples:["sequenzy inbox forward conv_123 msg_456 --to teammate@example.com"]});var Oc=Ve.command("webhooks").description("Manage outbound webhook endpoints").action(()=>Oc.help());S(Oc,{notes:["Webhook payloads are signed; the signing secret is only shown once at creation time.","Valid events cover email.*, sms.*, campaign.*, subscriber.*, and sequence.* types; omit --event to use the default set. campaign.sent is explicit-only."],examples:["sequenzy webhooks list","sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks deliveries wh_123 --limit 50","sequenzy webhooks replay wh_123 del_456"]});var XUe=Oc.command("list").description("List outbound webhook endpoints").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zl("list",e));S(XUe,{examples:["sequenzy webhooks list --company comp_123"]});var eMe=Oc.command("create").description("Create an outbound webhook endpoint").requiredOption("-n, --name <name>","Webhook name").requiredOption("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Event types to deliver, e.g. email.bounced campaign.sent subscriber.list_subscribed subscriber.list_unsubscribed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zl("create",e));S(eMe,{notes:["The signing secret is printed once on creation and cannot be retrieved later - store it immediately.","Omit --event to subscribe to the default event set.","email.received (new mail to your inbox addresses and receiving domains, not replies to your emails; not sent for spam) is opt-in: pass it with --event."],examples:["sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks create --name Inbox --url https://example.com/hook --event email.received","sequenzy webhooks create --name 'All events' --url https://example.com/hook"]});var tMe=Oc.command("update <id>").description("Update an outbound webhook endpoint").option("-n, --name <name>","Webhook name").option("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Replacement event types").option("--enable","Enable the webhook").option("--disable","Disable the webhook").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("update",{id:e,...t}));S(tMe,{notes:["Provide at least one of --name, --url, --event, --enable, or --disable.","Changing the URL or re-enabling resets the failure circuit breaker."],examples:["sequenzy webhooks update wh_123 --url https://example.com/new-hook","sequenzy webhooks update wh_123 --event email.bounced email.complained","sequenzy webhooks update wh_123 --disable"]});var nMe=Oc.command("delete <id>").description("Delete an outbound webhook endpoint").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("delete",{id:e,...t}));S(nMe,{examples:["sequenzy webhooks delete wh_123 --yes"]});var rMe=Oc.command("test <id>").description("Send a test event to a webhook endpoint").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("test",{id:e,...t}));S(rMe,{notes:["The webhook must be enabled to receive a test event."],examples:["sequenzy webhooks test wh_123"]});var iMe=Oc.command("deliveries <id>").description("List recent deliveries for a webhook endpoint").option("-l, --limit <number>","Maximum deliveries to return (1-100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zl("deliveries",{id:e,...t}));S(iMe,{examples:["sequenzy webhooks deliveries wh_123","sequenzy webhooks deliveries wh_123 --limit 50"]});var oMe=Oc.command("replay <id> <deliveryId>").description("Replay a webhook delivery").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Zl("replay",{id:e,deliveryId:t,...n}));S(oMe,{notes:["Run `sequenzy webhooks deliveries <id>` first to find delivery IDs."],examples:["sequenzy webhooks replay wh_123 del_456"]});var iu=Ve.command("geofences").description("Manage geofences the mobile SDKs watch").action(()=>iu.help());S(iu,{notes:["Signed-in app users entering, leaving or staying in a geofence record app.geofence_entered, app.geofence_exited and app.geofence_dwelled events.","Radius is 100-10,000 meters (200+ recommended); dwell is 60-14,400 seconds; cooldown is 300-604,800 seconds (default 3,600)."],examples:["sequenzy geofences list --group stores","sequenzy geofences create --name Soho --lat 51.5136 --lng -0.1365 --radius 200 --group stores","sequenzy geofences import stores.csv"]});function f5(e,t){return e.option("-n, --name <name>","Geofence name").option("--lat <latitude>","Center latitude (-90 to 90)").option("--lng <longitude>","Center longitude (-180 to 180)").option("-r, --radius <meters>","Radius in meters (100-10000)").option("--dwell <seconds>","Record app.geofence_dwelled after this many seconds inside").option("--cooldown <seconds>","Ignore repeat transitions per contact for this long").option("-g, --group <group>","Group label, e.g. stores").option("--external-id <id>","Your own ID for the place, used by imports").option("--pause",t?"Pause the geofence":"Create it paused").option("--resume","Resume a paused geofence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON")}var sMe=iu.command("list").description("List geofences").option("-g, --group <group>","Only this group").option("--active <true|false>","Only active or only paused geofences").option("-l, --limit <n>","Page size, 1-500 (default 100)").option("--cursor <id>","Cursor from the previous page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Zu("list",e));S(sMe,{examples:["sequenzy geofences list --active true --limit 500"]});iu.command("get <id>").description("Show one geofence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zu("get",{id:e,...t}));var aMe=f5(iu.command("create").description("Create a geofence"),!1).action((e)=>Zu("create",e));S(aMe,{notes:["--name, --lat, --lng and --radius are required."],examples:["sequenzy geofences create --name 'Kings Cross' --lat 51.5308 --lng -0.1238 --radius 350 --dwell 600"]});var cMe=f5(iu.command("update <id>").description("Update a geofence"),!0).option("--clear-dwell","Stop recording dwell events").option("--clear-group","Remove the group").option("--clear-external-id","Remove the external ID").action((e,t)=>Zu("update",{id:e,...t}));S(cMe,{examples:["sequenzy geofences update geo_123 --radius 300","sequenzy geofences update geo_123 --pause"]});iu.command("delete <id>").description("Delete a geofence").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zu("delete",{id:e,...t}));var lMe=iu.command("import <file>").description("Create or update geofences from a CSV or GeoJSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Zu("import",{file:e,...t}));S(lMe,{notes:["CSV headers: name, latitude, longitude, radius, dwell, cooldown, group, external_id, active. GeoJSON: Point features with the same property names.","Rows are matched by external_id, which every row needs, so importing the same file again updates instead of duplicating."],examples:["sequenzy geofences import stores.csv","sequenzy geofences import stores.geojson --json"]});var uMe=Ve.command("account").description("Verify the active API key, permissions, and your Sequenzy account context").option("--json","Print JSON").action(EJ);S(uMe,{notes:["Makes a live API request with the active credential. Compare its key name and prefix with Settings after replacing a key."],examples:["sequenzy account","sequenzy account --json"]});var eT=Ve.command("notifications").description("Manage which account notifications Sequenzy emails you");eT.command("get").description("Show your notification settings for the current company").option("--json","Print JSON").action(Y4);eT.command("set").description("Change your notification settings for the current company").option("--new-subscriber <mode>","Notify when a contact joins: off, instant, or daily").option("--form-submitted <mode>","Notify on form, popup, or landing-page submissions: off or instant (50/day cap)").option("--campaign-completed <mode>","Notify when a campaign finishes sending: off or instant").option("--weekly-report <mode>","Monday one-screen summary of last week's sends, engagement, revenue, and slipping sequences: off or weekly").option("--account-health <mode>","Findings of the scheduled account health check, inside the Monday report or as their own email: off or instant").option("--json","Print JSON").action(Z4);S(eT,{notes:["These are your own settings, not the workspace's. Teammates choose their own and this never changes theirs.","New-subscriber notifications fall back to a daily summary automatically once a day passes the instant cap, and imports never trigger them.","'daily' is not valid for --form-submitted or --campaign-completed: each submission and each campaign finish is its own event.","The weekly report is on by default and only goes out for weeks in which the workspace sent more than 10 emails; 'weekly' is its only delivery mode.","Account health findings are on by default for the workspace owner. They ride inside the Monday report when you get it, otherwise they arrive as their own email; 'off' stops both."],examples:["sequenzy notifications get","sequenzy notifications set --new-subscriber daily","sequenzy notifications set --form-submitted instant","sequenzy notifications set --weekly-report off","sequenzy notifications set --account-health off","sequenzy notifications set --new-subscriber off --form-submitted off --campaign-completed off --weekly-report off"]});var s5=(e,t=[])=>[...t,e],dMe=Ve.command("feedback <message>").description("Send product feedback about Sequenzy to the Sequenzy team").option("--category <category>","Category: missing_capability, bug, docs, ux, praise, other (default: other)").option("--context <context>","What you were trying to accomplish when you hit the gap").option("--intent <text>","Bug reports: the user's request, verbatim or closely paraphrased").option("--expected <text>","Bug reports: what you expected to happen").option("--actual <text>","Bug reports: what actually happened instead").option("--tool-call <call>",'Bug reports: a command/tool call that led to the problem, as "<tool> | <args summary> | <error>" (args and error optional). Repeatable, in order.',s5).option("--resource-id <id>","Bug reports: ID of an affected resource (campaign, sequence, subscriber, ...). Repeatable.",s5).option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>N3(e,t));S(dMe,{notes:["Agents: send feedback whenever the user wanted something the CLI, API, or MCP tools do not support. The Sequenzy team reads every submission.","When a command misbehaved or produced a wrong result, include --intent, --expected, --actual, --tool-call, and --resource-id so the team can reproduce it. Summarize arguments - do not paste raw subscriber data or secrets."],examples:['sequenzy feedback "No command to bulk-delete campaigns by label" --category missing_capability','sequenzy feedback "Segment count and list output disagree for seg_123" --category bug --context "Auditing a re-engagement segment"','sequenzy feedback "Campaign update dropped the scheduled time" --category bug --intent "Move the promo send to 9am Tuesday" --tool-call "campaigns update | --schedule 2026-08-11T09:00" --expected "Campaign rescheduled" --actual "Campaign reverted to draft" --resource-id cmp_123']});var ou=Ve.command("api-keys").description("Manage company API keys").action(()=>ou.help());S(ou,{notes:["The plain API key is only returned on creation. Save it immediately.","Listing and revocation return metadata only; secrets and stored hashes are never returned.","Every subcommand except 'handoff' needs the api_keys:manage scope. Use 'handoff' when the active key does not have it."],examples:["sequenzy api-keys list --company comp_123","sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123',"sequenzy api-keys update key_123 --preset agent_safe","sequenzy api-keys revoke key_123 --company comp_123 --yes","sequenzy api-keys handoff --preset agent_safe --replaces current"]});var pMe=ou.command("create").description("Create a company API key").option("-n, --name <name>","Human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender (default: full_access)").option("--scopes <scopes>","Comma-separated explicit permission scopes (overrides --preset)").option("--json","Print raw JSON").action((e)=>Wu("create",e));S(pMe,{notes:["Keys default to full access. Pass --preset or --scopes to restrict what the key can do."],examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123','sequenzy api-keys create --preset transactional_sender --name "Order emails"','sequenzy api-keys create --scopes "subscribers:read,subscribers:write,events:write"']});var mMe=ou.command("handoff").description("Get an owner-confirmed dashboard link for creating or rotating a key").option("-n, --name <name>","Suggested name for the new API key").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Suggested permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender").option("--scopes <scopes>","Comma-separated explicit permission scopes (overrides --preset)").option("--replaces <api-key-id>","Key the new one replaces. Pass 'current' for the key you are authenticated with").option("--json","Print raw JSON").action((e)=>Wu("handoff",e));S(mMe,{notes:["Use this when key management fails because the active key lacks api_keys:manage. That scope fails closed on purpose and cannot be granted through the API by the key missing it.","This creates nothing and never prints a key. The link opens the dashboard create-key form prefilled; the owner reviews it, clicks Create, and copies the key from the browser.","With --replaces, the dashboard offers to revoke the predecessor once the replacement exists, which finishes a rotation in one visit."],examples:['sequenzy api-keys handoff --name "Production sync (rotated)" --preset agent_safe --replaces current','sequenzy api-keys handoff --scopes "subscribers:read,events:write" --company comp_123']});var fMe=ou.command("list").description("List company API keys without secret values").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Wu("list",e));S(fMe,{notes:["Use the returned ID, name, prefix, and current-key marker to identify a key before revoking it."],examples:["sequenzy api-keys list","sequenzy api-keys list --company comp_123 --json"]});var gMe=ou.command("update").description("Rename a company API key or change its permissions in place").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-n, --name <name>","New human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Replacement permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender").option("--scopes <scopes>","Comma-separated replacement permission scopes (overrides --preset)").option("--json","Print raw JSON").action((e,t)=>Wu("update",{apiKeyId:e,...t}));S(gMe,{notes:["The key value does not change, so clients holding it keep working with the new permissions.","--preset and --scopes replace the whole selection rather than merging into it. Run 'sequenzy api-keys list --json' first to see the current scopes."],examples:["sequenzy api-keys update key_123 --preset agent_safe",'sequenzy api-keys update key_123 --scopes "subscribers:read,subscribers:tag,tags:read"','sequenzy api-keys update key_123 --name "Agent key"']});var AMe=ou.command("revoke").description("Permanently revoke a company API key").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wu("revoke",{apiKeyId:e,...t}));S(AMe,{notes:["Revocation cannot be undone. Run 'sequenzy api-keys list' first and verify the exact ID and prefix."],examples:["sequenzy api-keys revoke key_123 --company comp_123 --yes"]});var hMe=ou.command("delete").description("Alias for api-keys revoke").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Wu("delete",{apiKeyId:e,...t}));S(hMe,{notes:["This is a compatibility alias for 'sequenzy api-keys revoke'."],examples:["sequenzy api-keys delete key_123 --company comp_123 --yes"]});var Nc=Ve.command("websites").description("Manage sending domains and integration guides").action(()=>Nc.help());S(Nc,{notes:["Use 'guide' for code examples, 'check' to inspect current DNS verification details, and 'verify' to run a fresh check.","Use 'upgrade-dns' to move a domain on the previous record set onto the current DNS records without removing it."],examples:["sequenzy websites list --company comp_123","sequenzy websites add example.com --company comp_123","sequenzy websites guide --framework nextjs --use-case transactional"]});var yMe=Nc.command("list").description("List sending domains for a company").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Xl("list",e));S(yMe,{examples:["sequenzy websites list --company comp_123"]});var bMe=Nc.command("add <domain>").description("Add a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--mail-from-prefix <label>","Return-path (MAIL FROM) subdomain label, default rp").option("--tracking-prefix <label>","Label of the company tracking domain (<label>.<domain>) if the company has none yet, default links").option("--json","Print raw JSON").action((e,t)=>Xl("add",{domain:e,...t}));S(bMe,{notes:["Publish the DKIM record, the bounce records on the `Bounce:` line (one CNAME for new domains; domains added earlier keep their SPF TXT and MX records) and DMARC when present; record shapes vary between unified and legacy domains.","Tracked links use the company tracking domain, shared by every sending domain. The first domain creates it under itself (links.<domain>) and returns its CNAME as trackingRecord. It is optional: sending never waits for it, and links use the shared Sequenzy domain until it verifies. Manage it with `sequenzy tracking domain`.","A domain belongs to exactly one company and cannot be moved or removed from the CLI afterwards. Confirm --company before adding; moving it later requires removal in the dashboard and new DNS verification."],examples:["sequenzy websites add example.com --company comp_123","sequenzy websites add mail.example.com --mail-from-prefix bounce"]});var vMe=Nc.command("check <domain>").description("Inspect sending domain verification details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("check",{domain:e,...t}));S(vMe,{examples:["sequenzy websites check example.com --company comp_123"]});var EMe=Nc.command("verify <domain>").description("Run a fresh DNS check for a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("verify",{domain:e,...t}));S(EMe,{notes:["'verified' is the DNS verdict only. Sending is reported separately as 'Sending' - a domain with correct DNS can still be activating.","Receiving mail (inbox addresses and replies) is set up on receiving domains, not sending domains: see `sequenzy receiving-domains`."],examples:["sequenzy websites verify example.com --company comp_123"]});var IMe=Nc.command("upgrade-dns <domain>").description("Recommended one-time upgrade of a verified sending domain to the current DNS records, without removing it").option("--mail-from-prefix <label>","Return-path subdomain label for the new records, default rp (rp1, then sqrp if taken)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("upgrade-dns",{domain:e,...t}));S(IMe,{notes:["Optional and needed only once: it improves deliverability and security. Once started it runs to the switch. Add the printed CNAMEs next to your current records and remove nothing yet. The domain keeps sending on its current records, then switches by itself about an hour after the required ones (DKIM and return path) are visible on public DNS. Sending is normally not interrupted at the switch; if that isn't possible for a domain, emails sent through Amazon SES can be held for a few minutes. `sequenzy websites verify <domain>` checks now but does not skip the wait.","After the switch, `websites check` lists the old records you can optionally delete and the date from which it is safe (8 days after the switch). For an older SES-only domain these include the old return path records (MX and TXT at send.<domain>) and the DKIM TXT; keep DMARC.",'Only verified domains on the previous record set can upgrade, including older SES-only domains that have a working DMARC record; `websites check` shows `DNS upgrade: available` for them. Without DMARC the start fails with "Add a DMARC record for this domain before upgrading its DNS records."'],examples:["sequenzy websites upgrade-dns mail.example.com --company comp_123","sequenzy websites upgrade-dns mail.example.com --mail-from-prefix bounce"]});var CMe=Nc.command("configure <domain>").description("Deprecated: set <label>.<domain> as the company tracking domain; use `tracking domain set`").requiredOption("--tracking-prefix <label>","Label beneath the sending domain, e.g. links").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Xl("configure",{domain:e,...t}));S(CMe,{notes:["Deprecated: tracking is company-wide. Sets <label>.<domain> as the company tracking domain when the company has none; the company's current hostname is a no-op, and a different one changes nothing (the response explains why).","Prefer `sequenzy tracking domain set <hostname>`, which also changes an existing tracking domain."],examples:["sequenzy websites configure mail.example.com --tracking-prefix links"]});var wMe=Nc.command("guide").description("Print framework-specific integration code").option("--framework <name>","Framework name, e.g. nextjs, express, python").option("--use-case <name>","Use case, e.g. transactional, subscribe_form, event_tracking").option("--json","Print raw JSON").action((e)=>Xl("guide",e));S(wMe,{examples:["sequenzy websites guide","sequenzy websites guide --framework nextjs --use-case transactional","sequenzy websites guide --framework python --use-case event_tracking"]});hK(Ve);var Yr=Ve.command("integrations").description("Inspect and manage connected integrations").action(()=>Yr.help());S(Yr,{notes:["Credentials, access tokens, and webhook secrets are never returned.","`connect` covers API-key / webhook-secret providers (Polar, Paddle, Dodo, Lemon Squeezy, Whop, RevenueCat, Superwall, Adapty, Creem, Chargebee, Clerk, PostHog, Segment, Mixpanel, Amplitude, Affonso, Attio, SparkLoop). OAuth and app-install providers (Stripe, Shopify, Supabase, GitHub, WooCommerce) connect in the dashboard. Lemon Squeezy and SparkLoop support `disconnect`; other provider disconnects use the dashboard.","Use `catalog` to see what a provider does before connecting it, and `get` to see what a connected one is doing now."],examples:["sequenzy integrations list","sequenzy integrations catalog --provider stripe","sequenzy integrations connect clerk --webhook-secret whsec_...","sequenzy integrations get int_123","sequenzy integrations activity --status failed"]});Yr.command("disconnect <id>").description("Disconnect Lemon Squeezy or SparkLoop and remove its managed webhook; repeat to retry Lemon Squeezy cleanup").option("--company <id>","Company ID").option("--json","Print raw JSON").action((e,t)=>I4(e,t));var SMe=Yr.command("connect <provider>").description("Connect an API-key / webhook-secret integration").option("-c, --company <id>","Company ID override for personal API keys").option("--api-key <key>","Provider API key (or set SEQUENZY_INTEGRATION_API_KEY)").option("--webhook-secret <secret>","Webhook signing secret (Lemon Squeezy manual setup: 16-40 characters; Superwall: the webhook's whsec_ signing secret; Adapty: the webhook's authorization header value, at least 16 characters; Mixpanel and Amplitude: optional, generated and printed once when omitted; SparkLoop: optional, the webhook authentication token; or set SEQUENZY_INTEGRATION_WEBHOOK_SECRET)").option("--account-id <id>","Provider account id: Paddle seller ID, Dodo business ID, Lemon Squeezy numeric store ID, Whop company ID, Creem store ID, Chargebee site name, RevenueCat project ID (only when the key can access several projects), or SparkLoop publication ID (only when the account has several publications)").option("--attio-list <mapping...>","Attio only: map SEQUENZY_LIST_ID=ATTIO_LIST_ID_OR_SLUG (one or more)").option("--attio-clear-lists","Attio only: remove every saved Sequenzy-to-Attio list mapping").option("--attio-enable-company-domain","Attio only: create or match companies from work email domains").option("--attio-disable-company-domain","Attio only: do not create or match companies from work email domains").option("--event-allowlist <events...>","PostHog, Segment, and Amplitude only: sync only these event names instead of everything").option("--include-internal-events","PostHog, Segment, and Amplitude only: keep provider-internal events (Amplitude sessions and autocapture, PostHog $ events, Segment page/screen) that new connections skip").option("--match-by-distinct-id","PostHog only: match events without an email to the contact whose external ID equals the distinct_id (default for new connections)").option("--no-match-by-distinct-id","PostHog only: skip events without an email instead of matching them by distinct_id").option("--history-region <region>","PostHog and Segment history import region: us or eu").option("--history-project-id <id>","PostHog history import project ID").option("--history-space-id <id>","Segment history import Unify space ID (spa_...)").option("--history-api-key <key>","History import credential: the PostHog personal API key (or SEQUENZY_POSTHOG_PERSONAL_API_KEY) or the Segment Profile API token (or SEQUENZY_SEGMENT_PROFILE_API_TOKEN)").option("--json","Print raw JSON").action((e,t)=>$4(e,t));S(SMe,{notes:["Run `sequenzy integrations catalog --provider <provider>` first: its connectFields list what this provider needs.","Pass secrets via the environment variables instead of flags to keep them out of shell history.","The response includes the webhook URL. Lemon Squeezy creates and manages it when --webhook-secret is omitted, and SparkLoop always registers its own; other inbound providers use the supplied secret. Mixpanel and Amplitude generate a secret when --webhook-secret is omitted and print it once with the setup values. Attio is outbound-only.","Reconnecting an already-connected provider replaces its stored credentials.","OAuth and app-install providers (Stripe, Shopify, Supabase, GitHub, WooCommerce) cannot be connected here - use the dashboard."],examples:["sequenzy integrations connect clerk --webhook-secret whsec_...","sequenzy integrations connect paddle --api-key pdl_... --webhook-secret pdl_ntf_... --account-id 12345","sequenzy integrations connect polar --api-key polar_oat_... --webhook-secret whsec_...","sequenzy integrations connect lemon_squeezy --api-key ls_... --account-id 12345","sequenzy integrations connect revenuecat --api-key sk_... --webhook-secret <authorization-header-value>","sequenzy integrations connect superwall --webhook-secret whsec_...","sequenzy integrations connect adapty --webhook-secret sqz_your_authorization_value","sequenzy integrations connect posthog --webhook-secret phc_shared_secret --history-region us --history-project-id 12345 --history-api-key phx_...","sequenzy integrations connect posthog --webhook-secret phc_shared_secret --no-match-by-distinct-id","sequenzy integrations connect segment --webhook-secret my_shared_secret","sequenzy integrations connect segment --webhook-secret my_shared_secret --history-region us --history-space-id spa_abc123 --history-api-key profile_token","sequenzy integrations connect mixpanel","sequenzy integrations connect amplitude --event-allowlist 'Song Played' 'Plan Upgraded'","sequenzy integrations connect affonso --api-key aff_... --webhook-secret whsec_...","sequenzy integrations connect attio --api-key attio_... --attio-list list_123=field-guide","sequenzy integrations connect sparkloop --api-key <api-key> --account-id pub_..."]});var DMe=Yr.command("set-amplitude-events <id>").description("Choose which Amplitude events sync, without the webhook secret").option("-c, --company <id>","Company ID override for personal API keys").option("--event-allowlist <events...>","Sync only these Amplitude event types").option("--all-events","Sync every event type again").option("--include-internal-events","Also sync session_start, session_end, [Amplitude] autocapture, and other $ events").option("--skip-internal-events","Skip session, autocapture, and $ events unless allowlisted (the default for new connections)").option("--json","Print raw JSON").action((e,t)=>N4(e,t));S(DMe,{notes:["Identify calls always sync. Reconnecting would replace the webhook secret, so change events here instead."],examples:["sequenzy integrations set-amplitude-events int_123 --event-allowlist 'Song Played' 'Plan Upgraded'","sequenzy integrations set-amplitude-events int_123 --all-events --include-internal-events"]});var _Me=Yr.command("list").description("List connected integrations and their sync health").option("-c, --company <id>","Company ID override for personal API keys").option("--all","Include disconnected/inactive integrations").option("--json","Print raw JSON").action((e)=>L4(e));S(_Me,{examples:["sequenzy integrations list --company comp_123","sequenzy integrations list --all"]});var xMe=Yr.command("catalog").description("Show what each integration provider syncs, emits, and supports").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Only show one provider, e.g. stripe").option("--category <category>","Filter by category: payments, ecommerce, auth, analytics, ads, affiliate, cms, crm, developer").option("--json","Print raw JSON").action((e)=>P4(e));S(xMe,{notes:["Works whether or not the provider is connected, so you can compare providers before picking one.","Events listed here are the ones a sequence can trigger on. A provider that emits nothing cannot drive automations."],examples:["sequenzy integrations catalog","sequenzy integrations catalog --provider stripe","sequenzy integrations catalog --category ecommerce --json"]});var BMe=Yr.command("suggestions").description("Suggest integrations to connect, based on what is on your website").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>q4(e));S(BMe,{notes:["Lists tools Sequenzy found on your homepage or sign-in page (Clerk, Supabase, PostHog, Segment, Mixpanel, Amplitude, Webflow, Wix, WordPress, WooCommerce, Shopify) that are not connected yet.","Payment providers are never guessed: when your website lists pricing and nothing handles payments yet, every payment provider is listed instead."],examples:["sequenzy integrations suggestions","sequenzy integrations suggestions --json"]});var kMe=Yr.command("get <id>").description("Show one integration: what it does, its events, and its wiring").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Q4(e,t));S(kMe,{notes:["Lists every event the provider emits, the tags each one applies through your sync rules, and which sequences trigger on it.","Events with no sequence are reported so you can see what the integration is feeding you that nothing acts on.","Get the id from `sequenzy integrations list`."],examples:["sequenzy integrations get int_123","sequenzy integrations get int_123 --json"]});var RMe=Yr.command("activity").description("Show recent integration webhook and sync activity").option("-c, --company <id>","Company ID override for personal API keys").option("--integration <id>","Only show one integration's activity").option("--provider <provider>","Only show one provider's activity").option("--status <status>","Filter by status: received, queued, processed, skipped, failed").option("--limit <n>","Rows to return (1-100, default 25)").option("--json","Print raw JSON").action((e)=>T4(e));S(RMe,{notes:["Activity is retained for 24 hours.","Use `--status failed` when an integration reports connected but contacts are not appearing."],examples:["sequenzy integrations activity","sequenzy integrations activity --status failed --limit 50","sequenzy integrations activity --integration int_123"]});var TMe=Yr.command("sync <id>").description("Queue a manual re-sync for a connected integration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>C4(e,t));S(TMe,{notes:["Supported for Stripe, Polar, Paddle, Dodo, Lemon Squeezy, Creem, Chargebee, Whop, Supabase, PostHog, and Segment. Other providers re-sync from the dashboard.","For Supabase this backfills users from the table already configured for the integration; it cannot target a different table. Run it once after connecting, because the database trigger only sends rows that change after it is installed.","For PostHog and Segment this re-runs the event-history import with the stored credentials and is the supported retry for one that failed. It restarts from the beginning; already-imported events dedupe.","Returns immediately; poll `sequenzy integrations get <id>` to watch syncStatus and lastSyncAt.","Fails with a conflict if a sync is already running."],examples:["sequenzy integrations sync int_123"]});var OMe=Yr.command("enable-sync <id>").description("Turn sync back on for an integration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Nx(e,!0,t));S(OMe,{examples:["sequenzy integrations enable-sync int_123"]});var NMe=Yr.command("disable-sync <id>").description("Pause bulk imports without disconnecting the integration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Nx(e,!1,t));S(NMe,{notes:["Stops bulk imports and backfills but keeps the connection, credentials, and live webhook delivery active.","This does NOT stop the integration creating contacts. The provider's live webhook keeps writing every new signup or customer. Use `set-lists` to control where they land, or use `disconnect` for Lemon Squeezy or SparkLoop (the dashboard for other providers) to stop it entirely."],examples:["sequenzy integrations disable-sync int_123"]});var $Me=Yr.command("set-lists <id>").description("Choose which lists this integration's new contacts join").option("-c, --company <id>","Company ID override for personal API keys").option("--list <id>","Target this list (repeatable)",(e,t=[])=>[...t,e]).option("--none","Target no list at all").option("--default","Fall back to the workspace default lists").option("--json","Print raw JSON").action((e,t)=>S4(e,t));S($Me,{notes:["Takes effect on future provider writes. Nothing is applied retroactively and nobody is ever removed from a list. Wix/Webflow submissions, Shopify customer updates, and Supabase resubscriptions can add existing contacts to the new targets; Stripe applies targeting only when its webhook creates a subscriber.","This changes list membership only. Contacts are still created, their attributes still sync, sync-rule tags still apply, and sequences triggered by contact_added on any list still enroll them - pair it with `sequences pause-enrollments` if you need those stopped too.","`--none` and `--default` are different: --none means new contacts join no list, --default means they follow the workspace default lists setting.","Webflow requires explicit targeting, so --default is rejected for Webflow. Use --none or --list here; configure native forms, allowed fields, required double opt-in, and sequence enrollment in Settings -> Integrations -> Webflow. With no selected forms, capture is off and no contacts are created.","Supported for Supabase, Stripe, Shopify, Wix, Webflow, and SparkLoop. `integrations get <id>` reports the current targeting under `ingestion`, with list names."],examples:["sequenzy integrations set-lists int_123 --list list_abc --list list_def","sequenzy integrations set-lists int_123 --none","sequenzy integrations set-lists int_123 --default"]});var PMe=Yr.command("pixel <id>").description("Show the Shopify storefront tracking pixel state").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>_4(e,t));S(PMe,{notes:["Shopify only. Read live from the store, because a merchant can remove the pixel without notifying Sequenzy.","Check this before trusting product views, cart activity, or browse abandonment: without the pixel those events never arrive and any sequence triggered by them silently never fires."],examples:["sequenzy integrations pixel int_123"]});var QMe=Yr.command("enable-pixel <id>").description("Install or repoint the Shopify storefront tracking pixel").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>x4(e,t));S(QMe,{notes:["Idempotent: an already-live pixel is reported with `changed: false`.","Events start arriving on the next storefront visit; nothing is backfilled for the period the pixel was off.","Fails with guidance if the store granted an older permission set - reconnect Shopify from the dashboard, then retry."],examples:["sequenzy integrations enable-pixel int_123"]});var qMe=Yr.command("attio <id>").description("Show Attio list mappings and available people-lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>k4(e,t));S(qMe,{notes:["Attio only. Reads live people-lists from Attio using the stored access token — you do not need the secret again.","Shows every mapping in both directions and whether inbound sync is listening. Map with `set-attio-lists` rather than reconnecting."],examples:["sequenzy integrations attio int_123"]});var FMe=Yr.command("set-attio-lists <id>").description("Map Sequenzy lists and tags to and from Attio lists without reconnecting").option("-c, --company <id>","Company ID override for personal API keys").option("--map <mapping...>","Complete SEQUENZY_LIST_ID=ATTIO_LIST_ID_OR_SLUG map, Sequenzy to Attio (one or more)").option("--clear-maps","Remove every saved Sequenzy-to-Attio list mapping").option("--tag-map <mapping...>","Complete TAG=ATTIO_LIST_ID_OR_SLUG map, Sequenzy tags to Attio (one or more)").option("--clear-tag-maps","Remove every saved tag-to-Attio mapping").option("--from-attio <mapping...>","Complete ATTIO_LIST_ID_OR_SLUG=SEQUENZY_LIST_ID map, Attio to Sequenzy lists (one or more)").option("--clear-from-attio","Remove every saved Attio-to-list mapping").option("--from-attio-tag <mapping...>","Complete ATTIO_LIST_ID_OR_SLUG=TAG map, Attio to Sequenzy tags (one or more)").option("--clear-from-attio-tags","Remove every saved Attio-to-tag mapping").option("--enable-removals","Mirror removals: leaving a mapped list or tag removes the person on the other side").option("--disable-removals","Add-only sync: never remove anyone").option("--enable-company-domain","Create or match companies from work email domains").option("--disable-company-domain","Do not create or match companies from work email domains").option("--json","Print raw JSON").action((e,t)=>R4(e,t));S(FMe,{notes:["Uses the stored Attio access token. Do not reconnect just to change mappings.","Each map flag replaces that saved map entirely; maps you do not pass are kept. Run `sequenzy integrations attio <id>` first to see Sequenzy list ids, tags, and live Attio list ids/slugs.","--from-attio and --from-attio-tag pull changes from Attio. Sequenzy creates the Attio webhook itself; the token needs the webhook:read-write scope.","Unmapped lists and tags are not synced. Removals sync only with --enable-removals."],examples:["sequenzy integrations set-attio-lists int_123 --map list_abc=field-guide list_def=benchmark","sequenzy integrations set-attio-lists int_123 --tag-map vip=key-accounts","sequenzy integrations set-attio-lists int_123 --from-attio key-accounts=list_abc --from-attio-tag key-accounts=vip --enable-removals","sequenzy integrations set-attio-lists int_123 --clear-maps","sequenzy integrations set-attio-lists int_123 --disable-company-domain"]});var LMe=Yr.command("guide").description("Print integration code examples for your stack").option("-c, --company <id>","Company ID override for personal API keys").option("--framework <framework>","Framework or language, e.g. nextjs").option("--use-case <use-case>","transactional, subscribe_form, event_tracking, or ecommerce").option("--json","Print raw JSON").action((e)=>v4(e));S(LMe,{notes:["Same examples the MCP `get_integration_guide` tool returns.","For Stripe, Polar, Paddle, Dodo, Creem, Shopify, or WooCommerce, connect the native integration instead of writing tracking code by hand."],examples:["sequenzy integrations guide --use-case transactional --framework nextjs","sequenzy integrations guide --use-case ecommerce"]});var XA=Ve.command("sender-profiles").description("Inspect, rename, and delete sending identity profiles").action(()=>XA.help());S(XA,{notes:["Shows which profiles are account defaults and whether each sender address sits on a verified sending domain.","`update` renames one profile in place and never changes the account defaults. To change which profile is the default, use `sequenzy companies update <id> --sender-profile-id <id>`."],examples:["sequenzy sender-profiles list","sequenzy sender-profiles update sender_abc123 --name 'SnapCount'","sequenzy sender-profiles delete sender_abc123 --yes"]});var UMe=XA.command("list").description("List sender and reply-to profiles").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>z8(e));S(UMe,{examples:["sequenzy sender-profiles list --company comp_123"]});var MMe=XA.command("update <id>").description("Rename a sender or reply-to profile without changing defaults").requiredOption("--name <name>","New display name for the profile").option("--reply","Treat <id> as a reply-to profile instead of a sender").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>G8(e,t));S(MMe,{notes:["Renames the profile only. The account default From/Reply-To selection is left exactly as it was.","Get profile IDs from `sequenzy sender-profiles list`.","A company cannot have two sender identities with the same name on one address, so a colliding rename is rejected with the ID of the profile already using that name.","Requires the companies:manage scope."],examples:["sequenzy sender-profiles update sender_abc123 --name 'SnapCount'","sequenzy sender-profiles update reply_abc123 --name 'SnapCount' --reply","sequenzy sender-profiles update sender_abc123 --name 'SnapCount' --company comp_123 --json"]});var jMe=XA.command("delete <id>").description("Permanently delete a sender (From) profile").option("--yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>H8(e,t));S(jMe,{notes:["This cannot be undone. Reply-to profiles are not supported by this command.","Deletion is blocked for the last sender and for profiles used by live campaigns, active sequences, or transactional emails.","Eligible draft campaigns and the account default move to the best remaining sender when needed; the result reports that fallback profile ID.","Requires the companies:manage scope."],examples:["sequenzy sender-profiles delete sender_abc123","sequenzy sender-profiles delete sender_abc123 --yes --json"]});var fC=Ve.command("sending").description("Check company-level sending status and restore paused sending").action(()=>fC.help());S(fC,{notes:["Company-level sending can be paused automatically when the permanent-bounce, temporary-bounce, or complaint rate crosses its threshold. While paused, every send is blocked - campaigns, sequence steps, transactional email, and test sends.","Sender-health enforcement uses all-time totals counted from a reset watermark, NOT a rolling window. A paused rate does not expire on its own, so waiting does not restore sending.","`status` needs account:read. `resume` needs companies:manage plus owner or admin access."],examples:["sequenzy sending status","sequenzy sending resume --confirm-list-sanitized"]});var zMe=fC.command("status").description("Show sending status, sender-health rates, and how to restore sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Y8(e));S(zMe,{notes:["Run this first whenever a send or test send fails for a reason that is not a validation error.","Shows the exact pause reason, the measured rates against the thresholds that apply at your volume, the automated sender-health review state, whether one-click resume is available, and ordered remediation steps.","`metricsWindow` reports the enforcement watermarks. `expiresAt` is always null because there is no rolling window to wait out."],examples:["sequenzy sending status","sequenzy sending status --json","sequenzy sending status --company comp_123"]});var GMe=fC.command("resume").description("Restore paused sending after fixing the cause of the bounces").option("--confirm-list-sanitized","Required. Confirms you fixed the source of the invalid addresses and left every permanent bounce suppressed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Z8(e));S(GMe,{notes:["This is the supported remediation path, not a bypass. It never removes suppressions.","Only a permanent-bounce pause can be cleared this way, and only after the automated sender-health review has cleared it. Any other state needs a support review, and the error names which gate stopped you.","Check `selfResume.canSelfResume` with `sequenzy sending status` before calling this.","On success the bounce watermark resets, so the paused rate is recalculated from sends made after the resume, and the service attempts to requeue paused campaigns plus due sequence steps. If that handoff is only partial, the success message gives recovery guidance.","The confirmation is recorded on the account audit trail, so only pass --confirm-list-sanitized once the fix is actually shipped."],examples:["sequenzy sending resume --confirm-list-sanitized","sequenzy sending resume --confirm-list-sanitized --json"]});var eh=Ve.command("tracking").description("Inspect and update email tracking configuration").action(()=>eh.help());S(eh,{notes:["Covers open/click/unsubscribe tracking, attribution window, double opt-in for new contacts, auto UTM, the company tracking domain, and reply tracking."],examples:["sequenzy tracking settings","sequenzy tracking update --opens off --clicks off","sequenzy tracking domain set links.example.com"]});NZ(eh);Q3(Ve);hJ(Ve);bK(Ve);NJ(Ve);JZ(Ve);var HMe=eh.command("settings").description("Show the company's tracking configuration").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>J8(e));S(HMe,{examples:["sequenzy tracking settings --company comp_123"]});var JMe=eh.command("update").description("Update account-wide tracking defaults").option("--opens <on|off>","Enable or disable open tracking").option("--clicks <on|off>","Enable or disable click tracking").option("--transactional-opens <on|off>","Enable or disable open tracking by default for Transactional API sends").option("--transactional-clicks <on|off>","Enable or disable click tracking by default for Transactional API sends").option("--strict-bot-filtering <on|off>","Enable or disable aggressive bot filtering (can lower reported open/click rates)").option("--unsubscribes <on|off>","Route unsubscribe links to other services through your tracking domain").option("--store-content <on|off>","Keep sent email content and subjects, and the IP address, user agent and country of opens and clicks").option("--attribution-window-hours <hours>","Default revenue attribution window in hours (1-720)").option("--double-opt-in <on|off>","Require email confirmation before new contacts become subscribed").option("--double-opt-in-redirect-url <url>","Where the confirmation page sends subscribers after they confirm; pass an empty string to clear it").option("--auto-utm <on|off>","Enable or disable automatic UTM tagging").option("--utm-source <template>","utm_source template").option("--utm-medium <template>","utm_medium template").option("--utm-campaign <template>","utm_campaign template").option("--utm-content <template>","utm_content template").option("--utm-term <template>","utm_term template").option("--reset-utm","Reset every UTM parameter to the platform defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>K8(e));S(JMe,{notes:["Partial update: omitted flags keep their current values.","--unsubscribes off stops routing unsubscribe links that point to other services through your tracking domain. Sequenzy's own unsubscribe links always use your tracking domain (or the shared one). Actual unsubscribes and their email attribution are recorded either way.","--store-content off keeps no copy of each sent email's content, stores the email's name instead of its subject, and stores no IP address, user agent or country for opens and clicks. View-in-browser links stop working.","Transactional API defaults can only narrow the account-wide open and click settings; per-send trackingSettings can opt out again.","Applies to emails sent afterwards; already-sent emails keep the links they were rendered with.","UTM templates support placeholders such as {{email.subject}} and {{link.text}}.","--double-opt-in on makes new contacts start pending until they confirm; it needs a sender profile and provisions the confirmation email automatically. Existing active contacts are unaffected.","--double-opt-in-redirect-url sends subscribers to your own page after they confirm; without it they stay on the branded confirmation page.","Reply tracking is set with `sequenzy companies update`; the company tracking domain is managed with `sequenzy tracking domain`."],examples:["sequenzy tracking update --opens off --clicks off","sequenzy tracking update --transactional-opens off --transactional-clicks off","sequenzy tracking update --attribution-window-hours 168","sequenzy tracking update --double-opt-in on","sequenzy tracking update --double-opt-in-redirect-url https://example.com/welcome",'sequenzy tracking update --auto-utm on --utm-source newsletter --utm-campaign "{{email.subject}}"',"sequenzy tracking update --reset-utm"]});var tT=Ve.command("shopify").description("Manage the connected Shopify store's automation settings").action(()=>tT.help());S(tT,{notes:["Requires a connected Shopify integration on the company.","Browse abandonment emails shoppers who viewed a product but didn't buy; cart abandonment fires ecommerce.cart_abandoned with the full cart after the cart sits inactive; price drop alerts email recent viewers when a product's price falls."],examples:["sequenzy shopify settings get","sequenzy shopify settings update --price-drop off","sequenzy shopify settings update --browse-delay-hours 4 --browse-cooldown-hours 48"]});var nT=tT.command("settings").description("Browse-abandonment, cart-abandonment, and price-drop automation settings").action(()=>nT.help()),KMe=nT.command("get").description("Show the effective automation settings").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>DR("get",e));S(KMe,{notes:["Shows the effective values - platform defaults apply until the store overrides them."],examples:["sequenzy shopify settings get --json"]});var VMe=nT.command("update").description("Update browse-abandonment, cart-abandonment, and/or price-drop settings").option("--browse-abandonment <on|off>","Enable or disable browse abandonment").option("--browse-delay-hours <hours>","Hours to wait after a product view before the abandonment check (default 2)").option("--browse-cooldown-hours <hours>","Minimum hours between browse-abandoned events per subscriber (default 24)").option("--reset-browse-abandonment","Reset browse abandonment to the platform defaults").option("--cart-abandonment <on|off>","Enable or disable cart abandonment (ecommerce.cart_abandoned)").option("--cart-delay-hours <hours>","Hours of cart inactivity before abandonment (positive, max 168; default 1)").option("--cart-cooldown-hours <hours>","Minimum hours between cart-abandoned events (positive, max 720; default 24)").option("--cart-expire-after-hours <hours>","Drop a cart untouched this long instead of emailing about it (positive, max 720; default 72)").option("--reset-cart-abandonment","Reset cart abandonment to the platform defaults").option("--price-drop <on|off>","Enable or disable price drop alerts").option("--price-drop-min-percent <percent>","Minimum price decrease percent to alert on (default 5)").option("--price-drop-lookback-days <days>","How many days back viewers qualify as the audience (default 30)").option("--price-drop-cooldown-days <days>","Minimum days between price-drop events per subscriber and product (default 7)").option("--reset-price-drop","Reset price drop alerts to the platform defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>DR("update",e));S(VMe,{notes:["Partial update: omitted flags keep their current values.","If no sequence handles ecommerce.price_drop, Sequenzy sends a default price-drop email to active subscribers."],examples:["sequenzy shopify settings update --browse-abandonment off","sequenzy shopify settings update --cart-delay-hours 2","sequenzy shopify settings update --price-drop-min-percent 10 --price-drop-lookback-days 14","sequenzy shopify settings update --reset-price-drop"]});var su=Ve.command("sms").description("Inspect the SMS add-on status for a company").action(()=>su.help());S(su,{notes:["SMS sequence steps only send when the add-on is enabled, the plan is eligible, and an active number exists.",'Add SMS steps to sequences with type: "sms" in sequences create --steps-* or update --insert-steps-*.','Generate SMS copy with `sequenzy generate sms "<prompt>"`.'],examples:["sequenzy sms settings","sequenzy sms settings --json"]});var WMe=su.command("settings").description("Show SMS add-on status, credits, and phone numbers").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Cd("settings",e));S(WMe,{notes:["readyToSend in the JSON output tells you whether SMS sequence steps will actually send."],examples:["sequenzy sms settings --json"]});var YMe=su.command("label <number-id> [label]").description("Set or clear the label shown for an SMS number").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Cd("label",{numberId:e,label:t,...n}));S(YMe,{notes:["Run without a label to clear the current label.","Use `sequenzy sms settings` to find each number ID."],examples:['sequenzy sms label num_abc123 "Marketing"',"sequenzy sms label num_abc123"]});var ZMe=su.command("update <number-id>").description("Update an SMS number's label, brand prefix override, and/or link shortening").option("--label <label>","Label tag; pass an empty string to clear").option("--brand-prefix <prefix>","Per-number brand prefix override; empty string clears back to the account-wide prefix").option("--link-shortening <on|off>","on (default) turns links into click-tracked short links; off sends links from this number exactly as written").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Cd("update",{numberId:e,...t}));S(ZMe,{notes:["Only the flags you pass are changed; omitted fields keep their value.",'Messages go out as "{prefix}: your message" - the number override wins over the account-wide prefix set in Settings > SMS.',"--link-shortening off keeps your own tracking links exactly as written; SMS clicks from that number are then not tracked and long links can add segments. Applies to messages prepared after the change.","Use `sequenzy sms settings` to find each number ID."],examples:['sequenzy sms update num_abc123 --label "Support" --brand-prefix "Acme Support"','sequenzy sms update num_abc123 --brand-prefix ""',"sequenzy sms update num_abc123 --link-shortening off"]});var XMe=su.command("send-test <phone>").description("Send a test SMS to a phone number").option("-t, --text <text>","Plain-text message body").option("--image-url <url...>","Publicly reachable MMS image URL (repeat for up to 2)").option("--from-number <number-id>","Active SMS number ID to send from (defaults to the oldest active number)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Cd("send-test",{phone:e,...t}));S(XMe,{notes:["Sends a real text and charges credits. Limited to 100 test sends per company per rolling 24 hours; bypasses quiet hours; excluded from step stats.","Requires the SMS add-on with a verified number - check `sequenzy sms settings` first.","Use --from-number with an active number ID from `sequenzy sms settings` to test a specific number."],examples:['sequenzy sms send-test +15550100123 --text "Test from Sequenzy"','sequenzy sms send-test +15550100123 --text "Test" --from-number num_abc123']});var eje=su.command("usage").description("Show per-number SMS usage (sends, credits, last sent)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Cd("usage",e));S(eje,{notes:["Totals exclude test sends; test sends are counted separately per number."],examples:["sequenzy sms usage","sequenzy sms usage --json"]});var tje=su.command("release <number-id>").description("Release an SMS number back to the carrier (irreversible)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Cd("release",{numberId:e,...t}));S(tje,{notes:["Releasing is irreversible: the number is handed back to the carrier and cannot be recovered.","Released numbers stop counting toward the workspace number limit, freeing a slot for a new purchase.","Use `sequenzy sms settings` to find each number ID."],examples:["sequenzy sms release num_abc123 --yes"]});var ms=Ve.command("push").description("Web and mobile push notifications: settings, devices, tests, campaigns and iOS Live Activities").action(()=>ms.help());S(ms,{notes:["Web push uses VAPID keys Sequenzy generates; iOS uses your APNs .p8 key; Android uses your Firebase service account.",'Add push steps to sequences with type: "push" in sequences create --steps-* or update --insert-steps-*.'],examples:["sequenzy push settings","sequenzy push web --enable",'sequenzy push send-test --email you@example.com --title "Hello" --body "It works"']});var nje=ms.command("settings").description("Show web push, APNs and Firebase status plus active device counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("settings",e));S(nje,{examples:["sequenzy push settings --json"]});var rje=ms.command("web").description("Enable or disable web push and set the default notification icon").option("--enable","Turn web push on (generates VAPID keys the first time)").option("--disable","Turn web push off (keys are kept)").option("--icon <url>","Default https icon URL; pass an empty string to clear").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("web",e));S(rje,{notes:['Your site must serve /sequenzy-sw.js containing importScripts("https://api.sequenzy.com/sequenzy-sw.js") and call sequenzy.subscribeToPush() from a click.'],examples:["sequenzy push web --enable","sequenzy push web --icon https://example.com/icon-192.png"]});var rT=ms.command("ios").description("Manage APNs credentials for iOS push").action(()=>rT.help()),ije=rT.command("set").description("Save an APNs auth key (.p8)").requiredOption("--key-file <path>","Path to the AuthKey_XXXXXXXXXX.p8 file").requiredOption("--key-id <id>","10-character APNs key ID").requiredOption("--team-id <id>","10-character Apple team ID").requiredOption("--bundle-id <id>","App bundle ID, e.g. com.example.app").option("--environment <env>","production (default) or sandbox").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("ios-set",e));S(ije,{examples:["sequenzy push ios set --key-file AuthKey_ABC123DEFG.p8 --key-id ABC123DEFG --team-id DEF123GHIJ --bundle-id com.example.app"]});rT.command("remove").description("Remove APNs credentials").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("ios-remove",e));var iT=ms.command("android").description("Manage Firebase credentials for Android push").action(()=>iT.help()),oje=iT.command("set").description("Save a Firebase service account key").requiredOption("--service-account-file <path>","Path to the service account JSON from Firebase project settings").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("android-set",e));S(oje,{notes:["The service account needs the Firebase Cloud Messaging API Admin role."],examples:["sequenzy push android set --service-account-file ./firebase-key.json"]});iT.command("remove").description("Remove Firebase credentials").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("android-remove",e));var gC=ms.command("devices").description("List, register and remove push devices").action(()=>gC.help());gC.command("list").description("List push devices, optionally for one contact").option("--email <email>","Only devices of this contact").option("--subscriber-id <id>","Only devices of this subscriber").option("--platform <platform>","web, ios or android").option("--status <status>","active, invalid or unsubscribed").option("--limit <n>","Page size (max 100)").option("--cursor <id>","Continue after this device ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("devices-list",e));var sje=gC.command("register").description("Register a device token (usually done by your app backend)").requiredOption("--platform <platform>","ios, android or web").requiredOption("--token <token>","APNs device token, FCM registration token, or web subscription endpoint").option("--p256dh <key>","Web only: keys.p256dh from PushSubscription").option("--auth <secret>","Web only: keys.auth from PushSubscription").option("--email <email>","Contact to link (created quietly if new)").option("--subscriber-id <id>","Existing subscriber to link").option("--device-name <name>","Device label shown in the dashboard").option("--app-version <version>","App version").option("--os-version <version>","OS version").option("--locale <locale>","Device locale, e.g. en-US").option("--timezone <tz>","IANA timezone").option("--permission <status>","iOS/Android notification permission: granted, provisional, ephemeral, denied or not_determined").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("devices-register",e));S(sje,{examples:["sequenzy push devices register --platform ios --token 8f2c...e1 --email jane@example.com"]});gC.command("remove <device-id>").description("Unsubscribe a device").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("devices-remove",{deviceId:e,...t}));var au=ms.command("imports").description("Move iOS and Android push devices from OneSignal, Braze, Customer.io or a CSV").action(()=>au.help());S(au,{notes:["Imported APNs/FCM tokens only work with the bundle ID, Apple team and Firebase project the app registered them with; add those credentials with `sequenzy push ios set` / `push android set` first.","Web push subscriptions are never imported: they are tied to the previous provider's VAPID keys.","Opted-out devices are kept as unsubscribed. New contacts are created for opted-in devices without sequences or list joins; a device with only an external ID gets a push-only contact (no email or phone)."],examples:["sequenzy push imports preflight --source onesignal","sequenzy push imports start --source onesignal --app-id 1b2c3d4e-... --api-key-file onesignal.key --wait","sequenzy push imports start --source braze --braze-endpoint rest.iad-01.braze.com --segment all-users-segment-id --api-key-file braze.key","sequenzy push imports start --source customer_io --region eu --segment 12 --api-key-file cio.key","sequenzy push imports start --source csv --file devices.csv --yes"]});au.command("preflight").description("Check push settings before importing (APNs/Firebase set up?)").requiredOption("--source <source>","onesignal, braze, customer_io or csv").option("--platforms <platform...>","ios and/or android (default both)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>id("preflight",e));au.command("start").description("Create a push import, show its warnings, then start it").requiredOption("--source <source>","onesignal, braze, customer_io or csv").option("--api-key <key>","Source API key (prefer --api-key-file)").option("--api-key-file <path>","File containing the source API key").option("--app-id <id>","OneSignal App ID").option("--braze-endpoint <url>","Braze REST endpoint, e.g. rest.iad-01.braze.com").option("--segment <id>","Braze segment API identifier or Customer.io segment ID").option("--region <region>","Customer.io account region: us or eu","us").option("--file <path>","CSV file (source csv)").option("--platforms <platform...>","ios and/or android (default both)").option("--app-ids <id...>","Only devices of these source apps").option("--no-attributes","Do not copy tags/attributes onto contacts").option("--wait","Wait until the import finishes; exits 1 if it fails or stalls").option("-y, --yes","Start without the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>id("start",e));au.command("list").description("Recent push imports with progress and counts").option("--limit <n>","How many (max 50)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>id("list",e));au.command("get <import-id>").description("Show one push import").option("--wait","Wait until the import finishes; exits 1 if it fails or stalls").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>id("get",{importId:e,...t}));au.command("resume <import-id>").description("Start a draft, or resume a failed or stalled import").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>id("resume",{importId:e,...t}));au.command("cancel <import-id>").description("Stop an import (already imported devices stay)").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>id("cancel",{importId:e,...t}));var aje=ms.command("send-test").description("Send a test push to one device or to a contact's devices").option("--device <id>","Device ID from `sequenzy push devices list`").option("--email <email>","Send to every active device of this contact").option("--subscriber-id <id>","Send to every active device of this subscriber").option("--title <title>","Notification title").option("--body <body>","Notification message").option("--url <url>","https link or app deep link opened on tap").option("--image-url <url>","https image").option("--icon-url <url>","https icon (web)").option("--platforms <platform...>","Limit to web, ios and/or android").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("send-test",{...e,deviceId:e.device}));S(aje,{notes:["Limited to 200 test pushes per company per rolling 24 hours. Tests are excluded from stats."],examples:['sequenzy push send-test --email you@example.com --title "Test" --body "Hello from Sequenzy"']});var jm=ms.command("live-activities").description("Start, update and end iOS Live Activities and Android Live Updates, and list their tokens").action(()=>jm.help());S(jm,{notes:["Your iOS app reports ActivityKit tokens through the Sequenzy SDK (Sequenzy.observeLiveActivities). Push-to-start needs iOS 17.2+.","Android apps report Live Update tokens with SequenzyLiveUpdates.observe and the same type name; one start, update or end reaches both platforms whose push credentials are set (APNs for iOS, FCM for Android). Android 16 shows them promoted (status bar chip, top of the shade); earlier versions show an ongoing notification updated in place.","contentState and attributes are your Swift ContentState and attributes as JSON. Date fields in contentState decode as seconds since 2001-01-01 unless your struct uses a custom decoder.","Start, update and end go to one contact (--email or --subscriber-id); start can instead go to a segment, list or tag (--segment, --list, --tag), and update and end then reach every device running it with --broadcast. They need a key with transactional:send, plus campaigns:send for an audience or a broadcast; list needs subscribers:read. End needs the final content state."],examples:["sequenzy push live-activities list --email jane@example.com",`sequenzy push live-activities start --email jane@example.com --activity-type DeliveryAttributes --activity-id order-1234 --attributes-json '{"orderNumber":"1234"}' --content-state-json '{"status":"preparing","minutesAway":30}' --alert-title "Order confirmed"`,`sequenzy push live-activities update --email jane@example.com --activity-id order-1234 --content-state-json '{"status":"out_for_delivery","minutesAway":8}' --priority low`,`sequenzy push live-activities end --email jane@example.com --activity-id order-1234 --content-state-json '{"status":"delivered","minutesAway":0}' --dismissal-date 2026-10-20T18:00:00Z`,`sequenzy push live-activities start --tag lakers-fan --activity-type GameAttributes --activity-id game-5521 --attributes-json '{"home":"Lakers","away":"Celtics"}' --content-state-json '{"home":0,"away":0}' --alert-title "Tip-off"`,`sequenzy push live-activities update --broadcast --activity-id game-5521 --content-state-json '{"home":24,"away":21}'`]});jm.command("list").description("Summary per activity type plus push-to-start and update tokens").option("--email <email>","Only tokens of this contact").option("--subscriber-id <id>","Only tokens of this subscriber").option("--platform <platform>","ios (Live Activities) or android (Live Updates)").option("--activity-type <type>","ActivityAttributes type name").option("--activity-id <id>","One activity's update tokens").option("--kind <kind>","push_to_start or update").option("--status <status>","active, ended or invalid").option("--limit <n>","Page size (max 100)").option("--cursor <id>","Continue after this token ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Gg("list",e));var oT=(e)=>e.option("--content-state-json <json>","ContentState as a JSON object").option("--content-state-file <path>","Read ContentState JSON from a file").option("--alert-title <title>","Alert title").option("--alert-body <body>","Alert message").option("--alert-sound <sound>",'Sound name, e.g. "default"').option("--stale-date <date>","Unix seconds or ISO date when it goes stale").option("--relevance-score <n>","Orders concurrent activities; higher shows first").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON");oT(jm.command("start").description("Start an activity remotely on a contact's devices, or for a segment, list or tag (iOS 17.2+ push-to-start, and Android apps observing the type)").requiredOption("--activity-type <type>","Swift ActivityAttributes type name (and the type your Android app observes), e.g. DeliveryAttributes").requiredOption("--activity-id <id>","Your id for this activity; update and end use it").option("--email <email>","Contact whose devices start it").option("--subscriber-id <id>","Subscriber whose devices start it").option("--segment <id>","Start it on the devices of every contact in this segment (needs campaigns:send)").option("--list <id>","Start it for every contact in this list (needs campaigns:send)").option("--tag <tag>","Start it for every contact with this tag (needs campaigns:send)").option("--attributes-json <json>","Static attributes as a JSON object, with every field of the app's attributes struct (iOS drops a start that does not decode)").option("--attributes-file <path>","Read attributes JSON from a file")).action((e)=>Gg("start",e));oT(jm.command("update").description("Update every running copy of a contact's activity, or with --broadcast every signed-in device's").requiredOption("--activity-id <id>","Activity to update").option("--email <email>","Contact whose activity it is").option("--subscriber-id <id>","Subscriber whose activity it is").option("--broadcast","Every signed-in device running this activity id, e.g. one started for a segment (needs campaigns:send)").option("--priority <priority>","high (default) or low; low is not counted against Apple's update budget. Updates with an alert always go at high priority")).action((e)=>Gg("update",e));oT(jm.command("end").description("End a contact's activity on every device running it, or with --broadcast on every signed-in device").requiredOption("--activity-id <id>","Activity to end").option("--email <email>","Contact whose activity it is").option("--subscriber-id <id>","Subscriber whose activity it is").option("--broadcast","Every signed-in device running this activity id (needs campaigns:send)").option("--priority <priority>","high (default) or low; ends with an alert always go at high priority").option("--dismissal-date <date>","Unix seconds or ISO date to remove it; a past date removes it now (default: iOS and Android keep it up to 4 hours)")).action((e)=>Gg("end",e));var cje=ms.command("translate").description("Translate a push title and message into your other languages with AI (nothing is saved)").option("--title <title>","Main-language title").option("--body <body>","Main-language message").option("--localizations-json <json>","Existing versions to keep and merge (JSON array)").option("--localizations-file <path>","Read existing versions from a file").option("--locales <codes...>","Only these languages").option("--overwrite","Retranslate versions a person wrote too").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("translate",e));S(cje,{notes:["Use the --json output's localizations on a sequence push step (sequences update with updateNodes changes.localizations) or a campaign (--localizations-json)."],examples:['sequenzy push translate --title "Your order shipped" --body "Track it in the app, {{FIRST_NAME|friend}}" --json']});var fs=ms.command("campaigns").description("Create, send and inspect push campaigns").action(()=>fs.help()),g5=(e)=>e.option("--name <name>","Campaign name").option("--title <title>","Notification title").option("--body <body>","Notification message").option("--url <url>","https link or app deep link; empty string clears").option("--image-url <url>","https image; empty string clears").option("--icon-url <url>","https icon; empty string clears").option("--platforms <platform...>","Limit to web, ios and/or android").option("--localizations-json <json>",`Versions in other languages as a JSON array, e.g. '[{"locale":"de","title":"...","body":"..."}]'; replaces every version ([] removes them)`).option("--localizations-file <path>","Read the localizations JSON from a file").option("--all-contacts","Target every contact with a device").option("--segment <id>","Target a segment").option("--lists <ids...>","Target one or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON");fs.command("list").description("List push campaigns").option("--status <status>","draft, scheduled, sending, sent or cancelled").option("--limit <n>","Page size (max 100)").option("--offset <n>","Skip this many campaigns").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("campaigns-list",e));var lje=g5(fs.command("create").description("Create a push campaign draft")).action((e)=>tr("campaigns-create",e));S(lje,{examples:['sequenzy push campaigns create --name "Flash sale" --title "24h sale" --body "30% off everything" --url https://example.com/sale --all-contacts']});var A5=(e)=>e.option("--in-recipient-timezone","Deliver the scheduled wall-clock time in each contact's own timezone (device timezone, else the contact's). Needs --scheduled-timezone and a schedule.").option("--no-in-recipient-timezone","Turn off local-time delivery and send at the scheduled instant").option("--scheduled-timezone <zone>","IANA zone the scheduled wall-clock time refers to, for example America/New_York").option("--send-time-optimization","Send at each contact's most engaged hour: push clicks, then email opens, then your usual push hour").option("--disable-send-time-optimization","Turn off send-time optimization").option("--send-time-window-hours <hours>","Hours after the start in which optimized sends may land (1-24, default 12)"),uje=A5(g5(fs.command("update <campaign-id>").description("Update a draft or scheduled push campaign"))).action((e,t)=>tr("campaigns-update",{campaignId:e,...t}));S(uje,{notes:["Timing flags save on drafts only; reschedule a scheduled campaign with push campaigns send to change its timing."],examples:["sequenzy push campaigns update cmp_123 --send-time-optimization --send-time-window-hours 8"]});fs.command("get <campaign-id>").description("Show a push campaign and its stats").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-get",{campaignId:e,...t}));var dje=A5(fs.command("send <campaign-id>").description("Send a push campaign now or schedule it")).option("--schedule <iso-time>","Future ISO 8601 time to schedule instead").option("-y, --yes","Skip the confirmation prompt for immediate sends").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-send",{campaignId:e,...t}));S(dje,{notes:["Only contacts with an active device on a set-up platform receive the push.","With --in-recipient-timezone, contacts get --schedule's wall-clock time in their own timezone; zones whose time has already passed get it right away, and contacts with no known timezone get it at --schedule itself. The campaign stays sending until the last zone is delivered (up to about 26 hours).","With --send-time-optimization, each contact gets the push at their most engaged hour within --send-time-window-hours of the start (or of --schedule)."],examples:["sequenzy push campaigns send cmp_123 --yes","sequenzy push campaigns send cmp_123 --schedule 2026-10-01T15:00:00Z",'sequenzy push campaigns send cmp_123 --schedule "2026-10-01T09:00:00-04:00" --in-recipient-timezone --scheduled-timezone America/New_York',"sequenzy push campaigns send cmp_123 --yes --send-time-optimization --send-time-window-hours 8"]});fs.command("unschedule <campaign-id>").description("Move a scheduled push campaign back to draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-unschedule",{campaignId:e,...t}));fs.command("cancel <campaign-id>").description("Stop a scheduled or sending push campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-cancel",{campaignId:e,...t}));fs.command("duplicate <campaign-id>").description("Copy a push campaign into a new draft").option("--name <name>","Name for the copy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-duplicate",{campaignId:e,...t}));var pje=fs.command("estimate").description("Count contacts in an audience who have an active push device").option("--all-contacts","Every contact with a device").option("--segment <id>","A segment").option("--lists <ids...>","One or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("--platforms <platform...>","Limit to web, ios and/or android").option("--timing-coverage","Also count contacts with a known timezone and with enough push taps for send-time optimization").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>tr("campaigns-estimate",e));S(pje,{examples:["sequenzy push campaigns estimate --segment seg_123 --platforms ios","sequenzy push campaigns estimate --all-contacts --timing-coverage"]});var mje=fs.command("translate <campaign-id>").description("Translate a draft or scheduled push campaign into your other languages with AI and save it").option("--locales <codes...>","Only these languages (default: every language in Settings > Localization except the main one)").option("--overwrite","Retranslate them all, replacing versions a person wrote").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-translate",{campaignId:e,...t}));S(mje,{notes:["Each contact gets the version for their language attribute, else their device language, else your fallback language.","By default only languages without a version and outdated AI versions are translated; versions a person wrote are kept."],examples:["sequenzy push campaigns translate cmp_123","sequenzy push campaigns translate cmp_123 --locales de fr --overwrite"]});fs.command("stats <campaign-id>").description("Show delivery and click stats for a push campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>tr("campaigns-stats",{campaignId:e,...t}));var Hs=Ve.command("in-app").description("In-app messages and content cards: campaigns, a contact's feed, engagement reports, step stats").action(()=>Hs.help());S(Hs,{notes:['Create items with in_app sequence steps: type: "in_app" in sequences create --steps-* or update --insert-steps-* (kind message|card|placement, format modal|banner|fullscreen|html).','Placements are slots in your app that show in-app content inline: define them with `in-app placements create`, then target one from a step with kind "placement", placement "<key>", an optional priority (high, medium or low) and an optional layout (card, banner or hero).',"Send one to an audience as a campaign with `in-app campaigns`: each contact in the audience gets it the next time their app fetches its feed while the campaign is live.","Custom HTML messages (surveys, Braze custom HTML): check the document with `in-app html validate`, then put it on an in-app step with `in-app html set`. Braze Liquid such as {{${email_address}}} is converted to merge tags.","Your app fetches the feed with GET /api/v1/in-app/messages (API key, from your backend) or POST /api/v1/in-app/feed (publishable key + identity token, from the browser), renders it, and reports displayed/clicked/dismissed/read."],examples:["sequenzy in-app list --email ava@example.com",'sequenzy in-app campaigns create --name "New dashboards" --title "New dashboards" --body "Take a look" --segment seg_123',"sequenzy in-app list --external-id user_42 --kind card --status all","sequenzy in-app event msg_123 --type dismissed","sequenzy in-app stats node_123","sequenzy in-app templates",'sequenzy in-app write --brief "Trial ends in 3 days; nudge them to upgrade"',"sequenzy in-app html validate --file survey.html","sequenzy in-app html set seq_123 node_123 --file survey.html --no-close-button",'sequenzy in-app placements create --key home_hero --name "Home hero" --width 360 --height 160',"sequenzy in-app placements content --email ava@example.com --placements home_hero,checkout_upsell"]});var gs=Hs.command("campaigns").description("Send an in-app message or card to an audience as a campaign").action(()=>gs.help());S(gs,{notes:["Launching writes nothing per contact: each contact in the audience gets the message the first time their app fetches its feed while the campaign is live, including people who join the audience later. Old app versions that can't draw the message (format or button action) don't use it up.","The message takes the same fields as an in-app sequence step. Flags cover the common ones; --message-json/--message-file take the full config (style, data, pinned, expiresAfterDays, ...). Updates merge over the stored message.","Priority (high, medium, low) orders waiting messages; --ends-at stops new deliveries and removes it from every feed that still has it at that time."]});var h5=(e)=>e.option("--name <name>","Campaign name").option("--kind <kind>","message (default) or card").option("--format <format>","modal, banner, fullscreen or html").option("--position <position>","Banners: top or bottom. Modals: bottom or center").option("--eyebrow <text>","Short line above the title").option("--title <title>","Title").option("--body <body>","Message").option("--image-url <url>","https image; empty string clears").option("--button-label <label>","One button (replaces the buttons)").option("--button-url <url>","Link the button opens; without it the button closes the message").option("--html-file <path>","Custom HTML document (sets format html)").option("--message-json <json>","Full in-app message config JSON").option("--message-file <path>","Full in-app message config JSON file").option("--priority <priority>","high, medium or low").option("--ends-at <iso-time>","When the campaign ends; empty string removes it").option("--all-contacts","Target every contact").option("--segment <id>","Target a segment").option("--lists <ids...>","Target one or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON");gs.command("list").description("List in-app campaigns").option("--status <status>","draft, scheduled, sent (live or ended) or cancelled (stopped)").option("--limit <n>","Page size (max 100)").option("--offset <n>","Skip this many campaigns").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Fs("list",e));var fje=h5(gs.command("create").description("Create an in-app campaign draft")).action((e)=>Fs("create",e));S(fje,{examples:['sequenzy in-app campaigns create --name "New dashboards" --title "Hi {{firstName}}" --body "Dashboards are here" --button-label "Take a look" --button-url myapp://dashboards --segment seg_123','sequenzy in-app campaigns create --name "Tip" --kind card --title "Try shortcuts" --lists list_1 --priority low --ends-at 2026-12-01T00:00:00Z']});h5(gs.command("update <campaign-id>").description("Update a draft or scheduled in-app campaign")).action((e,t)=>Fs("update",{campaignId:e,...t}));gs.command("get <campaign-id>").description("Show an in-app campaign and its stats").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("get",{campaignId:e,...t}));var gje=gs.command("send <campaign-id>").description("Launch an in-app campaign now or schedule it").option("--schedule <iso-time>","Future ISO 8601 time to go live instead").option("-y, --yes","Skip the confirmation prompt for immediate launches").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("send",{campaignId:e,...t}));S(gje,{examples:["sequenzy in-app campaigns send cmp_123 --yes","sequenzy in-app campaigns send cmp_123 --schedule 2026-12-01T09:00:00Z"]});gs.command("unschedule <campaign-id>").description("Move a scheduled in-app campaign back to draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("unschedule",{campaignId:e,...t}));gs.command("stop <campaign-id>").description("Stop a scheduled or live in-app campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("stop",{campaignId:e,...t}));gs.command("duplicate <campaign-id>").description("Copy an in-app campaign into a new draft").option("--name <name>","Name for the copy").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("duplicate",{campaignId:e,...t}));gs.command("estimate").description("Count contacts who match an audience now").option("--all-contacts","Every contact").option("--segment <id>","A segment").option("--lists <ids...>","One or more lists").option("--target-lists-json <json>","Raw targetLists JSON").option("--target-lists-file <path>","Raw targetLists JSON file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Fs("estimate",e));gs.command("stats <campaign-id>").description("Show reach, views, clicks, button results and dismissals").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fs("stats",{campaignId:e,...t}));Hs.command("list").description("List a contact's open in-app messages and cards (or history)").option("--email <email>","Contact email").option("--external-id <id>","Contact external ID").option("--subscriber-id <id>","Subscriber ID").option("--kind <kind>","message, card or placement").option("--status <status>","open (default: what the app should show now) or all (history)").option("--limit <n>","Maximum items (max 100)").option("--actions <actions>","Open items: comma-separated button actions your app handles beyond open_url and dismiss (request_push_permission)").option("--formats <list>","Comma-separated formats you render, e.g. modal,banner,fullscreen,html. Open feeds include custom HTML messages only when html is listed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ec("list",e));Hs.command("event").description("Record that an item was displayed, clicked, dismissed or read").argument("<messageId>","In-app message ID").requiredOption("--type <type>","displayed, clicked, dismissed or read").option("--push-permission <status>","clicked on a push primer: the permission your app read after asking (granted, provisional, ephemeral, denied or not_determined)").option("--button-id <id>","Clicks in custom HTML messages: which control was clicked").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ec("event",{messageId:e,...t}));Hs.command("delete").description("Delete an in-app message or card from the contact's feed").argument("<messageId>","In-app message ID").option("-y, --yes","Skip confirmation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ec("delete",{messageId:e,...t}));Hs.command("stats").description("Created, displayed, clicked and dismissed counts for a step").argument("<stepId>","In-app sequence step (node) ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Ec("stats",{stepId:e,...t}));Hs.command("templates").description("List starting points for in-app sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including each template's step config").action((e)=>Ec("templates",e));Hs.command("write").description("Write in-app copy (eyebrow, title, message, button text) from a brief with AI").requiredOption("--brief <text>","What the message should say (3-1000 characters)").option("--kind <kind>","message (default), card or placement").option("--format <format>","modal (default), banner or fullscreen").option("--image","The step shows an image").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ec("write",e));var sT=Hs.command("html").description("Custom HTML in-app messages: check a document and put it on an in-app step").action(()=>sT.help());sT.command("validate").description("Check an HTML document: size, Braze Liquid conversions, script hosts, warnings and errors (exits 1 when not valid)").requiredOption("--file <path>","HTML file").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>Ec("html-validate",e));sT.command("set").description("Make an in-app sequence step a custom HTML message showing this document").argument("<sequenceId>","Sequence ID").argument("<stepId>","In-app step (node) ID from sequences get").requiredOption("--file <path>","HTML file (up to 100 KB)").option("--title <text>","Accessible name of the message").option("--close-button","Draw a close button over the message").option("--no-close-button","Don't draw a close button (when the HTML closes itself); without either flag the step keeps its setting").option("--confirm-live-change","Required when the sequence is active: future recipients get the new HTML").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t,n)=>Ec("html-set",{sequenceId:e,stepId:t,...n}));var cu=Hs.command("placements").description("Placements: slots in your app that show in-app content inline (define, edit, stats, a contact's content)").action(()=>cu.help());S(cu,{notes:["Your app shows, for each placement key it asks for, the contact's highest-priority open placement item, or nothing (the slot collapses). The mobile SDKs and the web SDK have views for this.","Keys never change after creation: app code uses them. Deleting a placement collapses its slots; steps that target it skip contacts until it exists again."],examples:["sequenzy in-app placements list",'sequenzy in-app placements create --key home_hero --name "Home hero" --width 360 --height 160',"sequenzy in-app placements update home_hero --height none","sequenzy in-app placements content --external-id user_42 --placements home_hero","sequenzy in-app placements delete home_hero --yes"]});cu.command("list").description("List placements with live, shown and clicked counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>ed("list",e));cu.command("get").description("Show one placement and its counts").argument("<key>","Placement key").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ed("get",{key:e,...t}));cu.command("create").description("Create a placement").requiredOption("--key <key>","What your app passes to the SDK: lowercase letters, numbers, dots, dashes, underscores (never changes)").requiredOption("--name <name>","Name shown in the dashboard").option("--description <text>","Where it sits in your app").option("--width <points>","Width hint in points").option("--height <points>","Height hint in points").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>ed("create",e));cu.command("update").description("Rename a placement or change its description or size hints").argument("<key>","Placement key").option("--name <name>","New name").option("--description <text>","New description").option("--width <points>",'Width hint in points, or "none" to clear').option("--height <points>",'Height hint in points, or "none" to clear').option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ed("update",{key:e,...t}));cu.command("delete").description("Delete a placement; its slots collapse in your app").argument("<key>","Placement key").option("-y, --yes","Skip confirmation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ed("delete",{key:e,...t}));cu.command("content").description("What each placement shows one contact now").requiredOption("--placements <keys>","Comma-separated placement keys (up to 10)").option("--email <email>","Contact email").option("--external-id <id>","Contact external ID").option("--subscriber-id <id>","Subscriber ID").option("--actions <actions>","Comma-separated button actions your app handles beyond open_url and dismiss (request_push_permission)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>ed("content",e));h3(Ve);var AC=Ve.command("email-design-system").description("Manage the visual identity every AI-generated email renders inside").action(()=>AC.help());S(AC,{notes:["The design system fixes the company's visual grammar (kickers, alignment, buttons, dividers, density, openers) and the composition spine that anchors email structure.","It is stored as the company's design direction text (emailDesignPrompt): adjustments rewrite that text, and free prose in it is preserved. Tokens the text does not state derive from brand context."],examples:["sequenzy email-design-system get","sequenzy email-design-system update --button-shape pill --spine editorial","sequenzy email-design-system update --reset"]});var Aje=AC.command("get").description("Show the effective email design system").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>kx("get",e));S(Aje,{notes:["The JSON output includes isDefault: true while the identity is still derived from brand context."],examples:["sequenzy email-design-system get --json"]});var hje=AC.command("update").description("Adjust the email design system (partial update) or reset it").option("--kicker-style <style>","chip | letterspaced | none").option("--title-alignment <alignment>","left | center").option("--button-shape <shape>","rounded | pill").option("--divider-style <style>","line | space").option("--density <density>","airy | compact").option("--opener-treatments <treatments>","Comma-separated: hero-image,hero-color,header-hero,editorial-masthead,title-led").option("--spine <spine>","hero-led | editorial | product-spec").option("--reset","Clear the design direction text; return to derived defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>kx("update",e));S(hje,{notes:["Only the passed flags change; everything else keeps its current value.","Adjustments apply to every future AI email generation and sequence enrichment.","The change is written into the design direction text; custom prose in that text is preserved below the new identity. For free-prose edits use 'companies update --email-design-prompt'."],examples:["sequenzy email-design-system update --spine editorial --kicker-style letterspaced","sequenzy email-design-system update --opener-treatments editorial-masthead,title-led","sequenzy email-design-system update --reset"]});var hC=Ve.command("design-md").description("Read and edit design.md, the company's email design brief in Markdown").action(()=>hC.help());S(hC,{notes:["design.md holds YAML frontmatter with the exact values AI-generated emails use (logo, colors, fonts, buttons, corner radius, layout tokens), then ## Voice and ## Design direction prose. ## Reference email is read-only.","Only values you change are saved. Removing a key or section leaves it unchanged; an empty section clears it."],examples:["sequenzy design-md get > design.md","sequenzy design-md update design.md --dry-run","sequenzy design-md update design.md --expected-version <version>"]});var yje=hC.command("get").alias("pull").description("Print design.md (the version is printed to stderr)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON with markdown, version and designSystem").action((e)=>Dx("get",e));S(yje,{examples:["sequenzy design-md get > design.md","sequenzy design-md pull --json"]});var bje=hC.command("update").alias("push").description("Save an edited design.md from a file, or stdin with -").argument("[file]","Path to design.md, or - for stdin","-").option("--dry-run","Validate and list changes without saving").option("--expected-version <version>","Fail instead of overwriting if design.md changed since this version").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Dx("update",{file:e,...t}));S(bje,{notes:["Errors name the line to fix. Unknown keys and edits to the read-only Reference email section are reported as warnings.","A value left exactly as 'get' printed it is not saved; a changed value is pinned."],examples:["sequenzy design-md update design.md --dry-run","cat design.md | sequenzy design-md push -"]});var aT=Ve.command("images").description("Work with images in the company's media library").action(()=>aT.help());S(aT,{examples:["sequenzy images crop https://images.sequenzy.com/email-images/.../team.jpg --aspect 16:9"]});var vje=aT.command("crop").description("Crop a library image (or a Pexels/Unsplash photo) into a new hosted image").argument("<url>","Hosted URL of the original image").option("--aspect <ratio>","Largest centered crop of this shape, e.g. 16:9, 1:1, 4:5 or 1.91:1").option("--focus-x <fraction>","With --aspect: horizontal center, 0-1").option("--focus-y <fraction>","With --aspect: vertical center, 0-1").option("--x <fraction>","Left edge of the area to keep, 0-1").option("--y <fraction>","Top edge of the area to keep, 0-1").option("--width <fraction>","Width of the area to keep, 0-1").option("--height <fraction>","Height of the area to keep, 0-1").option("--alt <text>","Alt text stored with the cropped image").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON with asset, crop and source size").action((e,t)=>X3(e,t));S(vje,{notes:["The crop is saved as a new image, so every inbox, Gmail and Outlook included, shows exactly that area. The original stays in the library.","Fractions are of the upright image. Retrying the same crop returns the same image.","Put the printed src and crop on an image block. To change a crop, crop the original (crop.sourceSrc) again."],examples:["sequenzy images crop https://images.sequenzy.com/email-images/.../team.jpg --aspect 1:1 --focus-x 0.3","sequenzy images crop https://images.sequenzy.com/email-images/.../team.jpg --x 0 --y 0.2 --width 1 --height 0.5 --json"]});var yC=Ve.command("sync-rules").description("Manage automatic tag changes applied when events fire").action(()=>yC.help());S(yC,{notes:["Sync rules map events to tag changes, e.g. an order-placed event adding a customer tag.","Rules can carry conditions: required/excluded subscriber tags, and a product match for commerce events (tag buyers by product tag, collection, type, or vendor)."],examples:["sequenzy sync-rules get","sequenzy sync-rules update --rules-file ./sync-rules.json","sequenzy sync-rules update --reset"]});var Eje=yC.command("get").description("Show the effective sync rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>FR("get",e));S(Eje,{notes:["Shows the platform defaults until the company saves custom rules; the JSON output includes isDefault."],examples:["sequenzy sync-rules get --json"]});var Ije=yC.command("update").description("Replace the sync rules or reset them to the defaults").option("--rules-json <json>","Inline JSON array with the full rule set").option("--rules-file <file>","Path to a JSON file with the full rule set").option("--reset","Reset the company to the platform default rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>FR("update",e));S(Ije,{notes:["This replaces the FULL rule set - fetch with 'sync-rules get --json', edit, then update.",'Each rule: {"triggerEvent":"...","actions":{"addTags":[...],"removeTags":[...]},"conditions":{...}}.'],examples:["sequenzy sync-rules update --rules-file ./sync-rules.json",`sequenzy sync-rules update --rules-json '[{"triggerEvent":"ecommerce.order_placed","actions":{"addTags":["vinyl-collector"],"removeTags":[]},"conditions":{"purchasedProduct":{"tags":["Vinyl"]}}}]'`,"sequenzy sync-rules update --reset"]});var zm=Ve.command("generate").description("Generate email and SMS content with AI").action(()=>zm.help());S(zm,{notes:["Generated email and SMS content is returned as draft content. Review it before sending.","`generate sequence` is deprecated and persists a disabled draft. Use `sequences create <name> --trigger <trigger> --goal <goal>` instead.","Use --json when another tool or agent should parse the generated output."],examples:['sequenzy generate email "Welcome a new user to our analytics product"','sequenzy generate subjects "April product launch" --count 8','sequenzy generate sms "Cart reminder with a free-shipping hook" --count 3']});zm.command("email <prompt>").description("Generate email blocks from a prompt").option("-s, --style <style>","Prompt generation style. Pass designed or plain to force the designed or plain-text email style; other values are freeform guidance (defaults to the company's email style preference)").option("-t, --tone <tone>","Tone: professional, casual, friendly").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("email",{prompt:e,...t}));zm.command("sequence <goal>").description("[DEPRECATED] Persist a disabled AI sequence draft; use `sequences create`").option("--name <name>","Optional sequence name; defaults to the goal").option("--list-id <id>","Optional list ID for the contact_added trigger").option("-c, --count <number>","Number of emails (1-10)","5").option("-d, --days <number>","Duration in days","14").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("sequence",{goal:e,...t}));zm.command("subjects <topic>").description("Generate A/B subject line variants").option("-c, --count <number>","Number of variants","5").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("subjects",{topic:e,...t}));var Cje=zm.command("sms <prompt>").description("Generate SMS message variants from a prompt").option("-c, --count <number>","Number of variants (1-10)","3").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>Fg("sms",{prompt:e,...t}));S(Cje,{notes:["Messages are plain text with encoding and segment counts; use them as the text of an SMS sequence step.","Opt-out footers and the brand prefix are added automatically at send time - never include them in the message.","Check `sequenzy sms settings` to confirm the SMS add-on is ready before enabling SMS sequences."],examples:['sequenzy generate sms "Flash sale ends tonight" --count 5 --json']});var xd=Ve.command("web-tracking").description("Manage publishable keys for the browser tracking SDK and mobile SDKs").action(()=>xd.help());S(xd,{notes:["These keys are publishable: they ship in your site's page source, so they are readable by anyone. They authorize storefront events only, never the rest of the API.","Restrict every key with --origins for websites and --app-ids for iOS and Android apps. A key with neither lets any site or app send events with it.","Shopify stores do not need a key - connect the integration and enable the pixel instead (`sequenzy integrations enable-pixel`).","Anonymous visits are buffered and replayed after `sequenzy.identify(email, identityToken)`. Mint the short-lived token from your authenticated backend; never expose a secret API key in browser code."],examples:['sequenzy web-tracking create --name "Storefront" --origins https://example.com,https://*.example.com',"sequenzy web-tracking list","sequenzy web-tracking update wtk_123 --origins https://example.com",'sequenzy web-tracking create --name "Mobile app" --app-ids com.example.app',"sequenzy web-tracking update wtk_123 --deactivate"]});var wje=xd.command("list").description("List web tracking keys and where each one is allowed to run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>VZ(e));S(wje,{examples:["sequenzy web-tracking list","sequenzy web-tracking list --json"]});var Sje=xd.command("get <id>").description("Show one key with its install snippet").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>WZ(e,t));S(Sje,{examples:["sequenzy web-tracking get wtk_123"]});var Dje=xd.command("create").description("Create a publishable key and print the install snippet").requiredOption("--name <name>","Human-readable label, e.g. 'Storefront'").option("--origins <origins>","Comma-separated allowed origins, e.g. https://example.com,https://*.example.com").option("--app-ids <ids>","Comma-separated iOS bundle IDs and Android package names for the mobile SDKs").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e)=>YZ(e));S(Dje,{notes:["A bare domain is read as https. Use https://*.example.com to cover subdomains; it does not match the apex, so list that separately if you need it.","Include your local development origin (e.g. http://localhost:3000) while you are wiring the SDK up.","The snippet embeds both the key and the workspace id, so paste it as printed.","A key with --app-ids and no --origins works only from your apps, never from a website."],examples:['sequenzy web-tracking create --name "Storefront" --origins https://example.com','sequenzy web-tracking create --name "Dev" --origins http://localhost:3000','sequenzy web-tracking create --name "Mobile app" --app-ids com.example.app,com.example.android']});var _je=xd.command("update <id>").description("Rename a key, change its origins or app IDs, or revoke it").option("--name <name>","New label").option("--origins <origins>","Replace the allowed origins (pass an empty string to clear them)").option("--app-ids <ids>","Replace the allowed app IDs (pass an empty string to clear them)").option("--activate","Re-enable a revoked key").option("--deactivate","Revoke the key without deleting it").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>ZZ(e,t));S(_je,{notes:["--origins and --app-ids each replace the whole list rather than appending to it.","Adding --app-ids to a key with no origins makes it app-only: a website already using it stops sending events. Add the site's origins too, or create a separate key for the app.","Revoking keeps the key value, so you can still find the snippet to remove from your site. Events stop within a minute."],examples:["sequenzy web-tracking update wtk_123 --origins https://example.com,https://shop.example.com","sequenzy web-tracking update wtk_123 --deactivate"]});var xje=xd.command("delete <id>").description("Permanently delete a web tracking key").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((e,t)=>XZ(e,t));S(xje,{notes:["Remove the snippet from your site too, otherwise it keeps posting events that are rejected.","Prefer `update --deactivate` if you may want the key back."],examples:["sequenzy web-tracking delete wtk_123 --yes"]});await Rj(Ve);process.exit(process.exitCode??0);
|