salesprompter-cli 0.1.20 → 0.1.23

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 CHANGED
@@ -1,338 +1,64 @@
1
1
  # salesprompter-cli
2
2
 
3
- `salesprompter-cli` is a JSON-first command line interface for running a practical sales workflow:
3
+ Salesprompter CLI helps you go from company or product input to qualified leads with a guided terminal flow.
4
4
 
5
- - Authenticate via Salesprompter app backend
6
- - Crawl LinkedIn product categories
7
- - Derive intended-role job titles
8
- - Split broad Sales Navigator searches into exportable slices
9
- - Export those slices through Phantombuster
10
- - Store product and people data in Salesprompter
11
- - Enrich leads
12
- - Score leads
13
- - Sync leads into CRM and outreach systems
14
- - Analyze upstream lead-list and domain-enrichment bottlenecks
15
- - Replace opaque Pipedream logic with deterministic CLI workflows
16
-
17
- It is built for two users at the same time:
18
-
19
- - humans working in a terminal
20
- - coding agents such as Codex, Claude Code, and other LLM-driven shell workflows
21
-
22
- The app, CLI, and Chrome extension all write into one shared Salesprompter backend and database. Access is scoped to
23
- the active workspace you choose at login.
24
-
25
- ## Start Here
26
-
27
- If someone discovers Salesprompter from a vague prompt, give them the shortest working path for their context.
5
+ ## Install
28
6
 
29
7
  ```bash
30
- ## Human-friendly guided path
31
- npx -y salesprompter-cli@latest
32
-
33
- ## Explicit guided path
34
- npx -y salesprompter-cli@latest wizard
35
-
36
- ## Primary raw command for agents and scripts
37
- npx -y salesprompter-cli@latest salesnav:from-product-category --input deel.com --dry-run
8
+ npm i -g salesprompter-cli
38
9
  ```
39
10
 
40
- Or install it globally:
41
-
42
- ```bash
43
- npm install -g salesprompter-cli
44
- salesprompter
45
- salesprompter wizard
46
- salesprompter --help
47
- ```
48
-
49
- Bare `salesprompter` now opens a guided wizard in an interactive terminal. Keep using explicit subcommands for agents, CI, and copy-paste docs.
50
- If your Salesprompter user belongs to multiple workspaces, browser login asks which workspace the CLI session should use.
51
-
52
- ## Prompt To Command
53
-
54
- The primary live path is:
55
-
56
- 1. crawl a LinkedIn product category
57
- 2. derive the intended job titles
58
- 3. turn those into Sales Navigator queries
59
- 4. split broad searches into exportable chunks
60
- 5. export them through Phantombuster
61
- 6. store everything in Salesprompter
62
-
63
- ### "I sell for Deel and want the right people at similar companies"
64
-
65
- Start from the company, product, or category input:
66
-
67
- ```bash
68
- salesprompter salesnav:from-product-category --input deel.com
69
- ```
70
-
71
- The CLI now stays attached while durable title crawls are still running remotely, writes JSONL trace logs, and exits non-zero if any title crawl finishes with failures. Use `--allow-partial-success` only when you explicitly want a best-effort run.
72
-
73
- Preview the generated titles and first split queries before creating crawl jobs:
74
-
75
- ```bash
76
- salesprompter --json salesnav:from-product-category --input deel.com --dry-run
77
- ```
78
-
79
- ### "Find people at deel.com"
80
-
81
- That is still a direct target-company lookup:
82
-
83
- ```bash
84
- salesprompter account:resolve --domain deel.com --company-name Deel --out ./data/deel-account.json
85
- salesprompter leads:generate --icp ./data/icp.json --count 5 --domain deel.com --company-name Deel --out ./data/deel-leads.json
86
- ```
87
-
88
- ### Historical warehouse fallback
89
-
90
- `salesnav:ensure-count` remains a historical backfill path, not the primary workflow:
91
-
92
- ```bash
93
- salesprompter salesnav:ensure-count --target-count 200000 --org-id "$SALESPROMPTER_ORG_ID"
94
- ```
95
-
96
- ## Documentation
97
-
98
- This repository now includes the public Salesprompter docs site for the wider Salesprompter universe, including the app contract, CLI surface, Chrome extension contract, and the main warehouse-backed workflows.
99
-
100
- - Live docs: `https://salesprompter-cli.vercel.app`
101
-
102
- - Docs home: `./index.mdx`
103
- - Quickstart: `./quickstart.mdx`
104
- - Architecture: `./architecture.mdx`
105
- - App: `./platform/app.mdx`
106
- - CLI: `./platform/cli.mdx`
107
- - Chrome extension: `./platform/chrome-extension.mdx`
108
- - Domain finder: `./workflows/domain-finder.mdx`
109
- - Command reference: `./reference/cli.mdx`
110
- - Environment variables: `./reference/environment-variables.mdx`
111
- - Troubleshooting: `./operations/troubleshooting.mdx`
112
-
113
- Run the docs locally with:
11
+ or run directly:
114
12
 
115
13
  ```bash
116
- npm run docs:dev
14
+ npx -y salesprompter-cli@latest
117
15
  ```
118
16
 
119
- Build the deployable static docs site with:
17
+ ## Quickstart
120
18
 
121
19
  ```bash
122
- npm run build:docs:site
123
- ```
124
-
125
- ## Integration Contract
126
-
127
- This CLI is not a standalone toy. It is a production integration surface for the Salesprompter app.
128
-
129
- - The Domain Finder flow in this repository is a real end-to-end test case for Salesprompter app integration.
130
- - CLI behavior should be treated as an app contract: auth, BigQuery execution, artifacts, and writeback semantics must remain stable.
131
- - Changes to domain selection, writeback, or audit logic should always be validated with:
132
- - CLI tests (`npm test`)
133
- - BigQuery-backed runs (`domainfinder:run:bq`, `domainfinder:audit-existing:bq`)
134
- - before/after delta checks (`domainfinder:audit-delta`)
135
-
136
- The current live path is product-first. It resolves a LinkedIn product category, derives intended-role Sales Navigator searches, and lets the app run durable exports through Phantombuster. Account-first lead generation still exists for direct target-company lookups.
137
-
138
- When the output `mode` is `fallback`, the leads are modeled contacts for workflow testing, not verified real contacts. A real provider path should return `mode: "real"` using the same JSON shape.
139
-
140
- All non-auth commands require a logged-in CLI session. This gives you one identity model across Salesprompter app, CLI, and Chrome extension.
141
-
142
- Global output flags:
143
-
144
- - `--json`: compact machine-readable JSON (optimized for agent/LLM parsers)
145
- - `--quiet`: suppress successful stdout payloads (errors still surface)
146
-
147
- ## Auth and Session
148
-
149
- The CLI stores a local session file at `~/.config/salesprompter/auth-session.json` (or `SALESPROMPTER_CONFIG_DIR`).
20
+ # Start the interactive wizard
21
+ salesprompter
150
22
 
151
- ```bash
152
- # Preferred path: browser/device login
23
+ # Login explicitly
153
24
  salesprompter auth:login
154
25
 
155
- # Fallback path: generate a short-lived CLI token in the Salesprompter app
156
- salesprompter auth:login --token "$SALESPROMPTER_TOKEN" --api-url "https://salesprompter.ai"
157
-
158
- # Verify active identity with backend
159
- salesprompter auth:whoami --verify
160
-
161
- # Clear local session
162
- salesprompter auth:logout
26
+ # Verify your session
27
+ salesprompter auth:whoami
163
28
  ```
164
29
 
165
- If your user belongs to multiple workspaces, the browser flow asks you to choose the workspace for that CLI session before returning to the terminal.
166
-
167
- Environment variables:
168
-
169
- - `SALESPROMPTER_API_BASE_URL`: override backend URL (default `https://salesprompter.ai`)
170
- - `SALESPROMPTER_CONFIG_DIR`: override local config dir
171
- - `SALESPROMPTER_ORG_ID`: optional org override for privileged Sales Navigator backfills
172
- - `SALESPROMPTER_SKIP_AUTH=1`: bypass auth guard (tests/dev only)
173
- - `INSTANTLY_API_KEY`: required for real `sync:outreach --target instantly`
174
- - `INSTANTLY_CAMPAIGN_ID`: default campaign id for Instantly sync
175
- - `SALESPROMPTER_INSTANTLY_BASE_URL`: override Instantly API base URL (tests/local proxies)
176
- - `NEXT_PUBLIC_SUPABASE_URL` or `SALESPROMPTER_SUPABASE_URL`: required for `salesnav:ensure-count` and for CLI-managed Sales Navigator exports
177
- - `SUPABASE_SERVICE_ROLE_KEY`: required for `salesnav:ensure-count` and for CLI-managed Sales Navigator exports
178
- - `LINKEDIN_SESSION_COOKIE_ENCRYPTION_KEY` or `EXTENSION_AUTH_SECRET` or `CLERK_SECRET_KEY`: required for Sales Navigator export and crawl commands that launch exports
179
- - `SALESPROMPTER_LINKEDIN_SESSION_EXCLUDED_EMAILS`: optional comma-separated emails to keep out of CLI-managed Sales Navigator rotation
180
- - `SALESPROMPTER_LINKEDIN_SESSION_EXCLUDED_HANDLES`: optional comma-separated LinkedIn handles to keep out of CLI-managed Sales Navigator rotation
181
- - `SALESPROMPTER_CLI_MANAGE_LINKEDIN_SESSIONS=0`: optional test or legacy fallback override; when omitted, the CLI claims, rotates, and preflights Sales Navigator session cookies before export launch
182
- - `GOOGLE_SERVICE_ACCOUNT_KEY`: required for `salesnav:ensure-count`
183
- - `BIGQUERY_PROJECT_ID`: optional when the Google service-account JSON already includes `project_id`
184
-
185
- App compatibility:
186
-
187
- - Salesprompter app should expose `/api/cli/auth/device/start`, `/api/cli/auth/device/poll`, and `/api/cli/auth/me`.
188
- - `salesprompter auth:login` uses browser/device login and prints the verification URL plus code before polling.
189
- - `POST /api/cli/auth/token` remains the fallback path when browser/device login is disabled or unavailable.
190
-
191
- Fallback command:
30
+ ## Common commands
192
31
 
193
32
  ```bash
194
- salesprompter auth:login --token "<token-from-app>" --api-url "https://salesprompter.ai"
195
- ```
196
-
197
- ## Why this shape works for humans and LLMs
33
+ # Product/category to leads workflow
34
+ salesprompter salesnav:from-product-category --input "https://www.linkedin.com/company/example/"
198
35
 
199
- - Every command reads and writes plain JSON.
200
- - Output is machine-readable and composable (`--json` for compact transport).
201
- - The top-level use cases map ambiguous prompts like "determine the ICP of deel.com" into explicit command paths.
202
- - Domain contracts are explicit and validated with `zod`.
203
- - External integrations are behind narrow provider interfaces.
204
- - Lead generation reports which provider and mode produced the result.
205
- - Workflow bottlenecks become inspectable artifacts instead of hidden Pipedream state.
206
- - Real prospect lookup can be normalized straight into the CLI lead schema with `--lead-out`.
36
+ # Build Instantly-ready Deel outreach batches with German vs English splits
37
+ salesprompter leadlists:deel-outreach:bq --market global --out-dir ./data/deel-outreach
207
38
 
208
- ## Commands
39
+ # Export the Supabase Sales Navigator Deel corpus into German vs English backlog files
40
+ salesprompter salesnav:deel-locale-export --org-id "<org-id>" --out-dir ./data/deel-salesnav
209
41
 
210
- ```bash
211
- salesprompter icp:define --name "EU SaaS RevOps" \
212
- --description "RevOps and sales leaders in European growth-stage software companies" \
213
- --industries "Software,Financial Services" \
214
- --company-sizes "50-199,200-499" \
215
- --regions "Europe" \
216
- --countries "DE,NL,GB" \
217
- --titles "Head of Revenue Operations,VP Sales" \
218
- --required-signals "recent funding,growing outbound team" \
219
- --keywords "revenue operations,outbound,sales tooling" \
220
- --out ./data/icp.json
221
-
222
- salesprompter auth:login
223
- salesprompter auth:whoami --verify
224
- salesprompter --json salesnav:from-product-category --input deel.com --dry-run
225
- salesprompter salesnav:from-product-category --input deel.com
226
- # Historical fallback only. Resumes from prior CLI historical backfill runs unless you pass --start-offset.
227
- salesprompter salesnav:ensure-count --target-count 200000 --org-id "$SALESPROMPTER_ORG_ID"
42
+ # Run a Sales Navigator crawl from a query URL
228
43
  salesprompter salesnav:crawl --query-url "https://www.linkedin.com/sales/search/people?query=..."
229
- salesprompter icp:vendor --vendor deel --market dach --out ./data/deel-icp.json
230
- salesprompter leads:lookup:bq --icp ./data/deel-icp.json --limit 100 --execute --out ./data/deel-leads-raw.json --lead-out ./data/deel-leads.json
231
- salesprompter leads:enrich --in ./data/deel-leads.json --out ./data/deel-enriched.json
232
- salesprompter leads:score --icp ./data/deel-icp.json --in ./data/deel-enriched.json --out ./data/deel-scored.json
233
- salesprompter sync:outreach --target instantly --in ./data/deel-scored.json --campaign-id "$INSTANTLY_CAMPAIGN_ID"
234
- salesprompter sync:outreach --target instantly --in ./data/deel-scored.json --campaign-id "$INSTANTLY_CAMPAIGN_ID" --apply
235
- salesprompter icp:from-historical-queries:bq --vendor deel --market dach --out ./data/deel-icp-historical.json --report-out ./data/deel-historical-report.json
236
- salesprompter leadlists:funnel:bq --vendor deel --market dach --out ./data/deel-leadlists-funnel.json
237
- salesprompter leadlists:direct-export:bq --vendor deel --market dach --limit 20000 --out-dir ./data/direct-path --sql-out ./data/direct-path/deel-direct-dach.sql
238
- salesprompter domainfinder:backlog:bq --market dach --out ./data/deel-domainfinder-backlog.json
239
- salesprompter domainfinder:candidates:bq --market dach --limit 500 --out ./data/domain-candidates.json --sql-out ./data/domain-candidates.sql
240
- salesprompter domainfinder:input-sql --market dach --out ./data/domainFinder_input_v2.sql
241
- salesprompter domainfinder:select --in ./data/domain-candidates.json --out ./data/domain-decisions.json
242
- salesprompter domainfinder:audit --in ./data/domain-decisions.json --out ./data/domain-audit.json
243
- salesprompter domainfinder:compare-pipedream --in ./data/domain-candidates.json --out ./data/domain-comparison.json
244
- salesprompter domainfinder:audit-existing:bq --market dach --out ./data/domain-existing-audit.json
245
- salesprompter domainfinder:audit-delta --before ./data/domain-existing-audit-before.json --after ./data/domain-existing-audit-after.json --out ./data/domain-existing-audit-delta.json
246
- salesprompter domainfinder:repair-existing:bq --market dach --mode conservative --limit 5000 --out ./data/domain-repair.sql --trace-id salesprompter-cli-repair-dach
247
- salesprompter domainfinder:writeback-sql --in ./data/domain-decisions.json --out ./data/domain-writeback.sql --trace-id salesprompter-cli-dach-20260308
248
- salesprompter domainfinder:writeback:bq --in ./data/domain-decisions.json --out ./data/domain-writeback.sql --trace-id salesprompter-cli-dach-20260308
249
- salesprompter domainfinder:run:bq --market dach --limit 500 --out-dir ./data/domainfinder-run --trace-id salesprompter-cli-dach-20260308
250
- salesprompter account:resolve --domain deel.com --company-name Deel --out ./data/deel-account.json
251
- salesprompter leads:generate --icp ./data/icp.json --count 5 --out ./data/leads.json
252
- salesprompter leads:generate --icp ./data/icp.json --count 5 --domain deel.com --company-name Deel --out ./data/deel-leads.json
253
- salesprompter leads:enrich --in ./data/leads.json --out ./data/enriched.json
254
- salesprompter leads:score --icp ./data/icp.json --in ./data/enriched.json --out ./data/scored.json
255
- salesprompter leads:lookup:bq --icp ./data/deel-icp.json --limit 100
256
- salesprompter queries:analyze:bq --search-kind sales-people --include-function "Human Resources" --out ./data/hr-query-report.json
257
- salesprompter sync:crm --target hubspot --in ./data/scored.json
258
- salesprompter sync:outreach --target instantly --in ./data/scored.json
259
- ```
260
-
261
- ## Domain Finder Migration
262
-
263
- The original Pipedream `domainFinder` workflow was doing three things:
264
-
265
- 1. fetch a small input set from BigQuery
266
- 2. ask OpenAI / Hunter for candidate domains
267
- 3. pick a domain and write it back
268
-
269
- The CLI now models that logic directly and improves it:
270
44
 
271
- - `domainfinder:backlog:bq` measures whether the backlog is being starved before enrichment
272
- - `domainfinder:candidates:bq` fetches real candidate rows from BigQuery for backlog companies
273
- - `domainfinder:input-sql` generates a replacement input view driven by `linkedin_companies`, not `leadPool_new`
274
- - `domainfinder:select` applies deterministic domain selection rules
275
- - `domainfinder:audit` turns decisions into a review queue and writeback summary
276
- - `domainfinder:compare-pipedream` quantifies how often the old selector would disagree with the improved selector
277
- - `domainfinder:audit-existing:bq` measures current warehouse-visible mismatches and bad chosen domains
278
- - `domainfinder:audit-delta` compares two audit snapshots and reports metric deltas
279
- - `domainfinder:repair-existing:bq` generates (and optionally executes) targeted repair writes with selectable mode:
280
- - `conservative`: only missing/blacklisted chosen domains
281
- - `aggressive`: missing/blacklisted plus all mismatches
282
- - `mismatch-only`: only mismatched chosen domains
283
- - `domainfinder:writeback-sql` emits conservative SQL for `domainFinder_output`
284
- - `domainfinder:writeback:bq` can execute that writeback in BigQuery when explicitly asked
285
- - `domainfinder:run:bq` runs the full candidate -> decision -> audit -> writeback pipeline and stores all artifacts
286
-
287
- Improved selection policy:
288
-
289
- 1. prefer `domain_linkedin` when present and not blacklisted
290
- 2. otherwise prefer `website_linkedin` root domain when present and not blacklisted
291
- 3. otherwise choose the non-blacklisted candidate with the highest Hunter email count
292
- 4. otherwise fall back to the first non-null candidate
293
-
294
- This removes the earlier failure mode where OpenAI or Hunter could override a good LinkedIn domain purely because of a higher Hunter count.
295
-
296
- Writeback policy:
297
-
298
- - write to `SalesPrompter.domainFinder_output`, which is the source feeding `linkedin_companies.domain`
299
- - exclude `no-domain` decisions
300
- - exclude blacklisted domains from generated writeback SQL
301
- - preserve batch provenance through `trace_id`
302
-
303
- ## Development
304
-
305
- ```bash
306
- npm install
307
- npm run build
308
- node ./dist/cli.js --help
309
- npm test
45
+ # Check crawl status
46
+ salesprompter salesnav:crawl:status --job-id "<job-id>"
310
47
  ```
311
48
 
312
- BigQuery project selection:
313
-
314
- - The CLI runs `bq query` with `--project_id` from `BQ_PROJECT_ID`.
315
- - Fallback order: `BQ_PROJECT_ID` -> `GOOGLE_CLOUD_PROJECT` -> `GCLOUD_PROJECT` -> `icpidentifier`.
316
-
317
- ## Real Deel Flow
49
+ ## Output modes
318
50
 
319
- For Deel as the vendor you sell for, do not use `--domain deel.com`. That path targets contacts at Deel itself.
51
+ - `--json` for machine-readable output
52
+ - `--quiet` to suppress successful payload output
320
53
 
321
- Use this path instead:
54
+ ## Notes
322
55
 
323
- 1. `salesprompter icp:vendor --vendor deel --market dach --out ./data/deel-icp.json`
324
- 2. `salesprompter leads:lookup:bq --icp ./data/deel-icp.json --limit 100 --execute --out ./data/deel-leads-raw.json --lead-out ./data/deel-leads.json`
325
- 3. `salesprompter leads:enrich --in ./data/deel-leads.json --out ./data/deel-enriched.json`
326
- 4. `salesprompter leads:score --icp ./data/deel-icp.json --in ./data/deel-enriched.json --out ./data/deel-scored.json`
327
- 5. `salesprompter sync:outreach --target instantly --in ./data/deel-scored.json --campaign-id "$INSTANTLY_CAMPAIGN_ID"`
328
- 6. Add `--apply` only when the dry-run output looks correct.
56
+ - Use your own authorized LinkedIn / Sales Navigator access.
57
+ - Respect LinkedIn and provider terms.
58
+ - The CLI is designed for interactive users and agent-assisted workflows.
329
59
 
330
- ## Next integrations
60
+ ## Links
331
61
 
332
- - Replace `HeuristicCompanyProvider` with a real account lookup provider.
333
- - Replace `HeuristicPeopleSearchProvider` with Apollo, Clay, LinkedIn, or custom people-data providers.
334
- - Replace `HeuristicEnrichmentProvider` with enrichment APIs such as Clearbit, FullEnrich, or custom LLM workflows.
335
- - Replace `DryRunSyncProvider` with real HubSpot, Salesforce, Pipedrive, Instantly, Apollo, or Outreach clients.
336
- - Add provider selection and credentials for a first real `--domain deel.com` workflow.
337
- - Replace configurable `bq` field mapping with a typed adapter per warehouse schema.
338
- - Add a real candidate-fetch command that reads domain candidates from BigQuery and feeds them into `domainfinder:select`.
62
+ - Docs: https://salesprompter-cli.vercel.app
63
+ - App: https://salesprompter.ai
64
+ - Repository: https://github.com/danielsinewe/salesprompter-cli