@seguelac/aca-cli 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +7 -0
- package/dist/commands/sequence.js +65 -0
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `aca-cli` are documented here. Format loosely follows [Keep a Changelog](https://keepachangelog.com/).
|
|
4
4
|
|
|
5
|
+
## [0.5.0] - 2026-08-07
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`aca sequence duplicate <id>`**: copy an email sequence — steps, settings, mailbox pool, tracking domain and enrollment filter — optionally with its audience. `--with-lists` attaches the same lead lists (and their auto-enroll setup); `--with-leads` re-enrols the leads currently in the source. `--name` overrides the default `"<source> (copy)"`.
|
|
9
|
+
- The copy is always created as a **draft**, so duplicating never starts sending.
|
|
10
|
+
- `--with-leads` runs the full enrollment path, so unsubscribed/bounced leads and leads already active in another sequence are skipped — the command reports each bucket. It pages the source (1000 leads per request) and prints progress; ~15s per page, so a 13k-lead sequence takes a few minutes. Every page is durable, so interrupting it leaves correct data behind.
|
|
11
|
+
- Backed by a new `duplicate-email-sequence` edge function and a `sourceSequenceId` mode on `enroll-leads`, both shared with the app UI and the `duplicate_email_sequence` MCP tool.
|
|
12
|
+
|
|
13
|
+
### Note
|
|
14
|
+
There is intentionally no `aca sequence ls` — listing goes through PostgREST, which only accepts JWTs, not the `aca_` API tokens this CLI recommends.
|
|
15
|
+
|
|
5
16
|
## [0.4.0] - 2026-07-18
|
|
6
17
|
|
|
7
18
|
### Added
|
package/README.md
CHANGED
|
@@ -83,6 +83,13 @@ aca campaign leads <campaignId> --stuck --json | jq '.[] | .contact_id'
|
|
|
83
83
|
| `aca campaign status <id>` | Aggregate progress counts (pending, replied, failed, etc.). |
|
|
84
84
|
| `aca campaign leads <id> --stuck` | List stuck leads (status: failed or sender_disconnected). |
|
|
85
85
|
|
|
86
|
+
### Email sequences
|
|
87
|
+
| Command | What it does |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `aca sequence duplicate <id>` | Copy a sequence (steps, settings, mailbox pool, tracking domain). Always lands as a **draft**. |
|
|
90
|
+
| `aca sequence duplicate <id> --with-lists` | ...and attach the same lead lists (auto-enroll + enrollment filter travel with them). |
|
|
91
|
+
| `aca sequence duplicate <id> --with-leads` | ...and re-enrol the leads currently in the source. Unsubscribed/bounced leads, and leads already active in another sequence, are skipped and reported. Pages through the source, so a large audience takes a few minutes. |
|
|
92
|
+
|
|
86
93
|
### Contacts
|
|
87
94
|
| Command | What it does |
|
|
88
95
|
|---|---|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { invokeFn } from '../api.js';
|
|
2
|
+
import { output } from '../output.js';
|
|
3
|
+
export function registerSequence(program) {
|
|
4
|
+
const sequence = program.command('sequence').description('Duplicate email sequences');
|
|
5
|
+
sequence
|
|
6
|
+
.command('duplicate')
|
|
7
|
+
.description('Copy a sequence — steps and settings, optionally its audience')
|
|
8
|
+
.argument('<sequenceId>')
|
|
9
|
+
.option('-n, --name <name>', 'Name for the copy (default: "<source> (copy)")')
|
|
10
|
+
.option('--with-lists', 'Attach the same lead lists (carries auto-enroll + enrollment filter)')
|
|
11
|
+
.option('--with-leads', 'Enroll the leads currently in the source sequence')
|
|
12
|
+
.option('--json', 'Emit JSON')
|
|
13
|
+
.action(async (sequenceId, opts) => {
|
|
14
|
+
const dup = await invokeFn('duplicate-email-sequence', {
|
|
15
|
+
sequenceId,
|
|
16
|
+
name: opts.name,
|
|
17
|
+
copyLeadLists: opts.withLists === true,
|
|
18
|
+
});
|
|
19
|
+
let totals = null;
|
|
20
|
+
if (opts.withLeads) {
|
|
21
|
+
const running = {
|
|
22
|
+
enrolled: 0,
|
|
23
|
+
suppressed: 0,
|
|
24
|
+
alreadyInAnotherSequence: 0,
|
|
25
|
+
noEmail: 0,
|
|
26
|
+
leadsWithoutContact: 0,
|
|
27
|
+
};
|
|
28
|
+
totals = running;
|
|
29
|
+
let offset = 0;
|
|
30
|
+
for (;;) {
|
|
31
|
+
const page = await invokeFn('enroll-leads', {
|
|
32
|
+
sequenceId: dup.sequence.id,
|
|
33
|
+
sourceSequenceId: sequenceId,
|
|
34
|
+
sourceOffset: offset,
|
|
35
|
+
});
|
|
36
|
+
running.enrolled += page.enrolled ?? 0;
|
|
37
|
+
running.suppressed += page.suppressed ?? 0;
|
|
38
|
+
running.alreadyInAnotherSequence += page.alreadyInAnotherSequence ?? 0;
|
|
39
|
+
running.noEmail += page.noEmail ?? 0;
|
|
40
|
+
running.leadsWithoutContact += page.leadsWithoutContact ?? 0;
|
|
41
|
+
if (!page.sourceCursor || page.sourceCursor.done)
|
|
42
|
+
break;
|
|
43
|
+
offset = page.sourceCursor.offset;
|
|
44
|
+
if (!opts.json) {
|
|
45
|
+
process.stderr.write(` …${offset} leads scanned, ${running.enrolled} enrolled\n`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const result = {
|
|
50
|
+
id: dup.sequence.id,
|
|
51
|
+
name: dup.sequence.name,
|
|
52
|
+
status: dup.sequence.status,
|
|
53
|
+
...(totals
|
|
54
|
+
? {
|
|
55
|
+
enrolled: totals.enrolled,
|
|
56
|
+
skipped_suppressed: totals.suppressed,
|
|
57
|
+
skipped_active_elsewhere: totals.alreadyInAnotherSequence,
|
|
58
|
+
skipped_no_email: totals.noEmail,
|
|
59
|
+
skipped_no_crm_contact: totals.leadsWithoutContact,
|
|
60
|
+
}
|
|
61
|
+
: {}),
|
|
62
|
+
};
|
|
63
|
+
output(result, { json: opts.json });
|
|
64
|
+
});
|
|
65
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -8,13 +8,14 @@ import { registerLeads } from './commands/leads.js';
|
|
|
8
8
|
import { registerInbox } from './commands/inbox.js';
|
|
9
9
|
import { registerReply } from './commands/reply.js';
|
|
10
10
|
import { registerCampaign } from './commands/campaign.js';
|
|
11
|
+
import { registerSequence } from './commands/sequence.js';
|
|
11
12
|
import { registerContact } from './commands/contact.js';
|
|
12
13
|
import { registerSignals } from './commands/signals.js';
|
|
13
14
|
import { registerAutopilot } from './commands/autopilot.js';
|
|
14
15
|
import { registerConfig } from './commands/config.js';
|
|
15
16
|
import { registerCompletion } from './commands/completion.js';
|
|
16
17
|
import { maybeCheckForUpdate } from './update-check.js';
|
|
17
|
-
const VERSION = '0.
|
|
18
|
+
const VERSION = '0.5.0';
|
|
18
19
|
const program = new Command();
|
|
19
20
|
program
|
|
20
21
|
.name('aca')
|
|
@@ -28,6 +29,7 @@ registerLeads(program);
|
|
|
28
29
|
registerInbox(program);
|
|
29
30
|
registerReply(program);
|
|
30
31
|
registerCampaign(program);
|
|
32
|
+
registerSequence(program);
|
|
31
33
|
registerContact(program);
|
|
32
34
|
registerSignals(program);
|
|
33
35
|
registerAutopilot(program);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seguelac/aca-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Command-line interface for ACA (Automated Client Acquisition) — push leads to campaigns, triage replies, manage contacts, all from your terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|