@arcsend/cli 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/index.js +6 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,9 +15,7 @@ npx @arcsend/cli --help
|
|
|
15
15
|
Get an API key from your ArcSend workspace (Settings → API Keys), then:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
arcsend auth setup --key arc_xxxxxxxx
|
|
19
|
-
# dedicated instance? point at your domain:
|
|
20
|
-
arcsend auth setup --key arc_xxxxxxxx --url https://send.yourdomain.com
|
|
18
|
+
arcsend auth setup --key arc_xxxxxxxx --url https://app.arcsend.io # your instance URL — the /cli page has it pre-filled
|
|
21
19
|
```
|
|
22
20
|
|
|
23
21
|
Or use env vars: `ARCSEND_API_KEY`, `ARCSEND_URL`.
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,6 @@ import chalk2 from "chalk";
|
|
|
10
10
|
import { homedir } from "os";
|
|
11
11
|
import { join } from "path";
|
|
12
12
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync } from "fs";
|
|
13
|
-
var DEFAULT_URL = "https://send.highsend.io";
|
|
14
13
|
var CONFIG_DIR = join(homedir(), ".arcsend");
|
|
15
14
|
var CONFIG_PATH = join(CONFIG_DIR, "config.txt");
|
|
16
15
|
function loadConfig(keyOverride, urlOverride) {
|
|
@@ -26,7 +25,7 @@ function loadConfig(keyOverride, urlOverride) {
|
|
|
26
25
|
if (!baseUrl && (key === "instance_url" || key === "url")) baseUrl = val;
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
|
-
baseUrl =
|
|
28
|
+
baseUrl = baseUrl.replace(/\/+$/, "");
|
|
30
29
|
return { apiKey, baseUrl };
|
|
31
30
|
}
|
|
32
31
|
function saveConfig(apiKey, url) {
|
|
@@ -282,7 +281,10 @@ var Api = class {
|
|
|
282
281
|
if (this.ready) return;
|
|
283
282
|
const { apiKey, baseUrl } = loadConfig(this.keyOverride, this.urlOverride);
|
|
284
283
|
if (!apiKey) {
|
|
285
|
-
fail("No API key. Use --api-key, set ARCSEND_API_KEY, or run `arcsend auth setup --key <key>`.");
|
|
284
|
+
fail("No API key. Use --api-key, set ARCSEND_API_KEY, or run `arcsend auth setup --key <key> --url <url>`.");
|
|
285
|
+
}
|
|
286
|
+
if (!baseUrl) {
|
|
287
|
+
fail("No instance URL. Use --url, set ARCSEND_URL, or run `arcsend auth setup --key <key> --url https://your-instance` (e.g. https://app.arcsend.io \u2014 your /cli page has it pre-filled).");
|
|
286
288
|
}
|
|
287
289
|
this.apiKey = apiKey;
|
|
288
290
|
this.baseUrl = `${baseUrl}/api/external`;
|
|
@@ -2209,7 +2211,7 @@ var groups = [
|
|
|
2209
2211
|
// src/commands/auth.ts
|
|
2210
2212
|
function registerAuth(program2) {
|
|
2211
2213
|
const auth = program2.command("auth").description("API key setup + identity");
|
|
2212
|
-
auth.command("setup").description("Save your API key + instance URL to ~/.arcsend/config.txt (chmod 600)").requiredOption("--key <key>", "Your arc_ API key").
|
|
2214
|
+
auth.command("setup").description("Save your API key + instance URL to ~/.arcsend/config.txt (chmod 600)").requiredOption("--key <key>", "Your arc_ API key").requiredOption("--url <url>", "Your instance URL, e.g. https://app.arcsend.io (the /cli page has it pre-filled)").action((opts) => {
|
|
2213
2215
|
saveConfig(opts.key, opts.url);
|
|
2214
2216
|
ok(`Saved credentials to ${CONFIG_PATH}`);
|
|
2215
2217
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcsend/cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "ArcSend
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "ArcSend \u2014 cold email automation from your terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"arcsend": "./dist/index.js"
|
|
@@ -41,4 +41,4 @@
|
|
|
41
41
|
"tsx": "^4.16.0",
|
|
42
42
|
"typescript": "^5.5.0"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
}
|