emailr-cli 1.7.3 → 1.7.5
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 +13 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -252,6 +252,8 @@ OPTIONS
|
|
|
252
252
|
--offset <count> Number of contacts to skip for pagination (default: 0)
|
|
253
253
|
--subscribed Only show subscribed contacts
|
|
254
254
|
--unsubscribed Only show unsubscribed contacts
|
|
255
|
+
--search <query> Search by email, first name, or last name
|
|
256
|
+
--tags <tags> Filter by tags (comma-separated)
|
|
255
257
|
--format <format> Output format: json | table (default: table)
|
|
256
258
|
|
|
257
259
|
OUTPUT FORMATS
|
|
@@ -328,6 +330,7 @@ OPTIONS
|
|
|
328
330
|
--last-name <name> Last name
|
|
329
331
|
--subscribed Mark as subscribed (default: true)
|
|
330
332
|
--metadata <json> Custom metadata as JSON object
|
|
333
|
+
--tags <tags> Comma-separated tags
|
|
331
334
|
--format <format> Output format: json | table (default: table)
|
|
332
335
|
|
|
333
336
|
METADATA FORMAT
|
|
@@ -373,6 +376,7 @@ OPTIONS
|
|
|
373
376
|
--subscribed Mark as subscribed
|
|
374
377
|
--unsubscribed Mark as unsubscribed
|
|
375
378
|
--metadata <json> New metadata as JSON object (replaces existing)
|
|
379
|
+
--tags <tags> Comma-separated tags (replaces existing)
|
|
376
380
|
--format <format> Output format: json | table (default: table)
|
|
377
381
|
|
|
378
382
|
METADATA FORMAT
|
|
@@ -649,6 +653,7 @@ DESCRIPTION
|
|
|
649
653
|
OPTIONS
|
|
650
654
|
--limit <count> Number of templates to return (default: 20)
|
|
651
655
|
--page <page_number> Page number for pagination (default: 1)
|
|
656
|
+
--tags <tags> Filter by tags (comma-separated)
|
|
652
657
|
--format <format> Output format: json | table (default: table)
|
|
653
658
|
|
|
654
659
|
OUTPUT FORMATS
|
|
@@ -795,6 +800,7 @@ OPTIONS
|
|
|
795
800
|
--from <email_address> Default from email address
|
|
796
801
|
--reply-to <email_address> Default reply-to email address
|
|
797
802
|
--preview-text <text> Preview text shown in email clients
|
|
803
|
+
--tags <tags> Comma-separated tags
|
|
798
804
|
--format <format> Output format: json | table (default: table)
|
|
799
805
|
|
|
800
806
|
OUTPUT FORMATS
|
|
@@ -844,6 +850,7 @@ OPTIONS
|
|
|
844
850
|
--from <email_address> New default from email address
|
|
845
851
|
--reply-to <email_address> New default reply-to email address
|
|
846
852
|
--preview-text <text> New preview text
|
|
853
|
+
--tags <tags> Comma-separated tags (replaces existing)
|
|
847
854
|
--format <format> Output format: json | table (default: table)
|
|
848
855
|
|
|
849
856
|
OUTPUT FORMATS
|
|
@@ -1811,6 +1818,7 @@ DESCRIPTION
|
|
|
1811
1818
|
OPTIONS
|
|
1812
1819
|
--status <status> Filter by status: draft | scheduled | sending | sent
|
|
1813
1820
|
--limit <count> Number of broadcasts to return (default: 20)
|
|
1821
|
+
--tags <tags> Filter by tags (comma-separated)
|
|
1814
1822
|
--format <format> Output format: json | table (default: table)
|
|
1815
1823
|
|
|
1816
1824
|
STATUS VALUES
|
|
@@ -1896,6 +1904,7 @@ OPTIONS
|
|
|
1896
1904
|
--html <html_content> Inline HTML content (alternative to --template)
|
|
1897
1905
|
--text <text_content> Plain text content
|
|
1898
1906
|
--schedule <datetime> Schedule time in ISO 8601 format
|
|
1907
|
+
--tags <tags> Comma-separated tags
|
|
1899
1908
|
--format <format> Output format: json | table (default: table)
|
|
1900
1909
|
|
|
1901
1910
|
CONTENT OPTIONS
|
|
@@ -2648,6 +2657,7 @@ DESCRIPTION
|
|
|
2648
2657
|
|
|
2649
2658
|
OPTIONS
|
|
2650
2659
|
--format <format> Output format: json | table (default: table)
|
|
2660
|
+
--tags <tags> Filter by tags (comma-separated)
|
|
2651
2661
|
|
|
2652
2662
|
OUTPUT FORMATS
|
|
2653
2663
|
--format json Machine-readable JSON array of segment objects
|
|
@@ -2701,6 +2711,7 @@ OPTIONS
|
|
|
2701
2711
|
--name <segment_name> Segment name (required)
|
|
2702
2712
|
--conditions <json> Segment conditions as JSON array (required)
|
|
2703
2713
|
--description <text> Segment description
|
|
2714
|
+
--tags <tags> Comma-separated tags
|
|
2704
2715
|
--format <format> Output format: json | table (default: table)
|
|
2705
2716
|
|
|
2706
2717
|
CONDITIONS FORMAT
|
|
@@ -2753,6 +2764,7 @@ OPTIONS
|
|
|
2753
2764
|
--name <segment_name> New segment name
|
|
2754
2765
|
--description <text> New description
|
|
2755
2766
|
--conditions <json> New conditions as JSON array (replaces existing)
|
|
2767
|
+
--tags <tags> Comma-separated tags (replaces existing)
|
|
2756
2768
|
--format <format> Output format: json | table (default: table)
|
|
2757
2769
|
|
|
2758
2770
|
CONDITIONS FORMAT
|
|
@@ -2939,7 +2951,7 @@ TIP
|
|
|
2939
2951
|
<p style="margin-top: 1rem;">Please close this window and try again.</p>
|
|
2940
2952
|
</div>
|
|
2941
2953
|
</body>
|
|
2942
|
-
</html>`}function
|
|
2954
|
+
</html>`}function Ce(){let i=null,t=0,e=null,o=null,r=null;return {async start(){return new Promise((a,n)=>{i=Je.createServer((s,p)=>{if(s.method!=="GET"||!s.url?.startsWith("/callback")){p.writeHead(404,{"Content-Type":"text/plain"}),p.end("Not Found");return}let b=st(s.url);if(r&&b.state!==r){p.writeHead(400,{"Content-Type":"text/html"}),p.end(ee("Security verification failed. State parameter mismatch.")),e&&e({success:false,error:"State parameter mismatch"});return}if(b.error){let h=b.message||b.error;p.writeHead(200,{"Content-Type":"text/html"}),p.end(ee(h)),e&&e({success:false,error:h});return}let T=b.key||b.code;if(T){p.writeHead(200,{"Content-Type":"text/html"}),p.end(lt()),e&&e({success:true,apiKey:T});return}p.writeHead(400,{"Content-Type":"text/html"}),p.end(ee("Invalid callback: missing required parameters.")),e&&e({success:false,error:"Invalid callback: missing required parameters"});}),i.listen(0,"127.0.0.1",()=>{let s=i.address();s&&typeof s=="object"?(t=s.port,a({port:t,url:`http://127.0.0.1:${t}/callback`})):n(new Error("Failed to get server address"));}),i.on("error",s=>{n(new Error(`Failed to start callback server: ${s.message}`));});})},async waitForCallback(a,n){return r=a,new Promise(s=>{e=s,o=setTimeout(()=>{e&&e({success:false,error:"Login timed out. Please try again."});},n);})},async stop(){if(o&&(clearTimeout(o),o=null),i)return new Promise(a=>{i.close(()=>{i=null,a();});})}}}function ke(){return ct.randomBytes(32).toString("hex")}function Ue(i){return new Promise(t=>{let e=process.platform,o;switch(e){case "darwin":o=`open "${i}"`;break;case "win32":o=`start "" "${i}"`;break;default:o=`xdg-open "${i}"`;break}exec(o,r=>{t(!r);});})}var $=120,pt=process.env.EMAILR_WEB_URL||"https://app.emailr.dev";function ut(i,t){let e=`http://127.0.0.1:${t}/callback`,o=new URLSearchParams({state:i,callback_url:e});return `${pt}/consent/authorize?${o.toString()}`}function Pe(){return new Command("login").description("Log in to Emailr via browser authentication").option("-t, --timeout <seconds>","Timeout in seconds",String($)).option("--no-browser","Don't automatically open the browser").action(async t=>{await ft({timeout:parseInt(t.timeout,10)||$,noBrowser:t.browser===false});})}async function ft(i){let t=Ce(),e=(i.timeout||$)*1e3;try{u("Starting authentication server...");let{port:o,url:r}=await t.start(),a=ke(),n=ut(a,o);console.log(""),u("Authorization URL:"),console.log(` ${n}`),console.log(""),i.noBrowser?u("Please open the URL above in your browser to continue."):await Ue(n)?u("Browser opened. Please complete authentication in your browser."):(I("Could not open browser automatically."),u("Please open the URL above in your browser to continue.")),console.log(""),u(`Waiting for authentication (timeout: ${i.timeout||$}s)...`);let s=await t.waitForCallback(a,e);s.success&&s.apiKey?(G({apiKey:s.apiKey}),console.log(""),d("Login successful!"),u(`API key saved to: ${j()}`),u("You can now use the Emailr CLI.")):(console.log(""),l(s.error||"Authentication failed."),u("Please try again or use manual configuration:"),console.log(" emailr config set api-key <your-api-key>"),process.exit(1));}catch(o){console.log(""),l(o instanceof Error?o.message:"An unexpected error occurred."),u("Please try again or use manual configuration:"),console.log(" emailr config set api-key <your-api-key>"),process.exit(1);}finally{await t.stop();}}var ae=_.join(B.homedir(),".config","opencode","skills","emailr-cli"),wt=`---
|
|
2943
2955
|
name: emailr-cli
|
|
2944
2956
|
description: Operate the Emailr CLI to send emails, manage contacts, templates, domains, broadcasts, webhooks, and segments. Includes LIVE PREVIEW editing for templates with hot-reload.
|
|
2945
2957
|
---
|