intelwatch 1.3.2 → 1.6.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 CHANGED
@@ -1,174 +1,130 @@
1
1
  # intelwatch
2
2
 
3
- > Competitive intelligence from the terminal. Track competitors, keywords, and brand mentions — no expensive SaaS required.
3
+ > **Zero friction. Full context.**
4
+ > Competitive intelligence, M&A due diligence, and OSINT directly from your terminal.
4
5
 
5
- ## Install
6
+ ![Intelwatch Mockup](https://recognity.odoo.com/web/image/website/1/logo?unique=1)
7
+
8
+ **Intelwatch** bridges the gap between hacker OSINT and B2B Sales/M&A data. It executes complex financial data aggregation, technology stack detection, and AI-powered due diligence in seconds. No dashboards, no bloated UI. Just pure data.
9
+
10
+ ## Installation
6
11
 
7
12
  ```bash
8
13
  npm install -g intelwatch
9
- # or from source:
10
- npm link
14
+ intelwatch setup
15
+
16
+ # or run directly without installing:
17
+ npx intelwatch profile kpmg.fr --ai
11
18
  ```
12
19
 
13
20
  **Requirements:** Node.js >=18
14
21
 
15
- ## Quick Start
22
+ ## 🚀 The Flagship Feature: Due Diligence
16
23
 
17
- ```bash
18
- # Add trackers
19
- intelwatch track competitor https://competitor.com --name "Acme Corp"
20
- intelwatch track keyword "audit SEO"
21
- intelwatch track brand "Recognity"
24
+ Generate a comprehensive M&A/PE due diligence report in seconds. Intelwatch uses Smart Routing to fetch the best data based on the company's location (Pappers for France, Apollo/Clearbit/OpenCorporates for International).
22
25
 
23
- # Run checks
24
- intelwatch check
26
+ ```bash
27
+ # Generate a deep profile with AI Due Diligence
28
+ intelwatch profile doctolib.fr --ai
25
29
 
26
- # See what changed
27
- intelwatch digest
30
+ # Export directly to a premium PDF report (Pro feature)
31
+ intelwatch profile kpmg.fr --ai --export pdf
28
32
 
29
- # Full report
30
- intelwatch report --format html
33
+ # Export data to Excel or CSV
34
+ intelwatch profile "Acme Corp" --export xls
31
35
  ```
32
36
 
33
- ## Commands
37
+ **What it extracts:**
38
+ - **Financials:** Revenue, net result, consolidated data, and growth analysis.
39
+ - **Group Structure:** Shareholders, PE sponsors, and subsidiaries tree.
40
+ - **Governance & M&A:** Board members, BODACC legal publications, and historical M&A timeline.
41
+ - **OSINT & Reputation:** Recent press mentions, Reddit/Hacker News discussions, and sentiment scoring.
42
+ - **Tech Stack:** Detection of 50+ technologies (CMS, Frameworks, Analytics, CDNs).
43
+ - **AI Analysis:** Executive summary, Strengths & Weaknesses, Competitor identification, and Risk flags.
34
44
 
35
- ### Tracker Management
45
+ ---
36
46
 
37
- #### `intelwatch track competitor <url> [--name <alias>]`
38
- Tracks a competitor website. Captures:
39
- - Pages found (via link extraction)
40
- - Pricing page content and price changes
41
- - Technology stack (35+ technologies detected)
42
- - Open job positions (/careers, /jobs)
43
- - Social links
44
- - Meta title/description changes on key pages
47
+ ## 🛠️ Core Commands
48
+
49
+ ### 1. Market & Competitor Discovery
50
+ Discover actual competitors for any website using web search and AI scoring.
45
51
 
46
52
  ```bash
47
- intelwatch track competitor https://acme.com --name "Acme"
48
- intelwatch track competitor https://rival.io
53
+ intelwatch discover https://mycompany.com --export csv
49
54
  ```
50
55
 
51
- #### `intelwatch track keyword <keyword> [--engine google]`
52
- Tracks Google SERP rankings for a keyword. Records top 20 results, detects position changes, new entrants/exits, and featured snippet holders.
56
+ ### 2. Track Competitors & Keywords
57
+ Set up local trackers to monitor competitor websites, technology changes, and Google SERP rankings over time.
53
58
 
54
59
  ```bash
55
- intelwatch track keyword "project management software"
60
+ intelwatch track competitor https://acme.com --name "Acme Corp"
56
61
  intelwatch track keyword "audit SEO" --engine google
62
+ intelwatch track brand "Recognity"
57
63
  ```
58
64
 
59
- #### `intelwatch track brand <name>`
60
- Tracks brand mentions across Google News and recent web results. Detects sentiment (positive/negative) and categorizes mentions (press, blog, forum, social, review).
65
+ ### 3. Check & Digest
66
+ Run your trackers and see what changed since the last snapshot.
61
67
 
62
68
  ```bash
63
- intelwatch track brand "Recognity"
64
- intelwatch track brand "My Company Name"
69
+ intelwatch check
70
+ intelwatch digest
71
+ intelwatch diff acme-com --days 7
65
72
  ```
66
73
 
67
- ### Listing & Removing
74
+ ### 4. AI Briefs & Sales Pitches
75
+ Generate AI-powered competitive briefs and sales pitches against your tracked competitors.
68
76
 
69
77
  ```bash
70
- intelwatch list # List all trackers
71
- intelwatch remove <tracker-id> # Remove a tracker
78
+ intelwatch ai-summary
79
+ intelwatch pitch acme-com
72
80
  ```
73
81
 
74
- ### Checking & Diffs
82
+ ---
75
83
 
76
- ```bash
77
- intelwatch check # Check all trackers
78
- intelwatch check --tracker acme-com # Check one tracker
84
+ ## 💎 Pro License ($49/mo)
79
85
 
80
- intelwatch diff acme-com # Compare last 2 snapshots
81
- intelwatch diff acme-com --days 7 # Compare with 7 days ago
82
- ```
86
+ Intelwatch operates on a freemium model. The **Free Tier** allows standard OSINT, basic company profiles, and CSV exports.
83
87
 
84
- ### Reports
88
+ The **Pro Tier** unlocks:
89
+ - 📄 **Premium PDF & Excel (XLS) exports**
90
+ - 🤖 **AI Due Diligence Reports** (Health score, Risks, M&A timelines)
91
+ - 🌍 **International Routing** (Apollo & Clearbit integrations)
92
+ - 🕵️ **Deep OSINT** (Reddit & Hacker News tracking)
85
93
 
94
+ **Activate your license:**
86
95
  ```bash
87
- intelwatch digest # Quick summary table
88
- intelwatch report # Markdown report (stdout)
89
- intelwatch report --format html # HTML report (saved to ~/.intelwatch/reports/)
90
- intelwatch report --format json # JSON report (stdout)
91
- intelwatch report --format md --output ./weekly.md # Custom output file
96
+ intelwatch auth YOUR_LICENSE_KEY
92
97
  ```
98
+ *(Get your key at [recognity.fr/tools/intelwatch](https://recognity.fr/tools/intelwatch))*
93
99
 
94
- ### History & Comparison
100
+ ---
95
101
 
96
- ```bash
97
- intelwatch history acme-com # Show snapshot history
98
- intelwatch history acme-com --limit 10 # Last 10 snapshots
102
+ ## ⚙️ Configuration & API Keys
99
103
 
100
- intelwatch compare acme-com rival-com # Side-by-side comparison
101
- ```
102
-
103
- ### Notifications
104
+ Intelwatch brings your own keys (BYOK) for maximum privacy and limit-less scaling. Set these in your environment variables (`~/.bashrc` or `~/.zshrc`):
104
105
 
105
106
  ```bash
106
- intelwatch notify --setup # Interactive setup (Slack, Discord webhook)
107
- ```
108
-
109
- Notifications config is stored at `~/.intelwatch/config.yml`:
110
-
111
- ```yaml
112
- notifications:
113
- webhook: https://hooks.slack.com/services/xxx/yyy/zzz
114
- events:
115
- - competitor.new_page
116
- - competitor.price_change
117
- - keyword.position_change
118
- - brand.new_mention
119
- - brand.negative_mention
120
- ```
107
+ # Required for AI Features (Choose one)
108
+ export ANTHROPIC_API_KEY="sk-ant-..."
109
+ export OPENAI_API_KEY="sk-proj-..."
121
110
 
122
- ## Data Storage
111
+ # Required for Web Search & Discovery
112
+ export BRAVE_SEARCH_API_KEY="BSAeG..."
123
113
 
124
- All data is stored locally in `~/.intelwatch/`:
114
+ # Required for deep French corporate data
115
+ export PAPPERS_API_KEY="86c0dcc..."
125
116
 
117
+ # Required for deep International corporate data (Pro)
118
+ export APOLLO_API_KEY="..."
126
119
  ```
127
- ~/.intelwatch/
128
- ├── config.yml # Notification settings
129
- ├── trackers.json # Active trackers
130
- ├── snapshots/ # Historical snapshots (JSON)
131
- └── reports/ # Generated HTML reports
132
- ```
133
-
134
- ## Technology Detection
135
-
136
- Detects 35+ technologies via headers, meta tags, scripts, HTML patterns:
137
120
 
138
- | Category | Technologies |
139
- |----------|-------------|
140
- | CMS | WordPress, Drupal, Joomla |
141
- | E-commerce | Shopify, Magento |
142
- | Website Builder | Wix, Squarespace, Webflow |
143
- | JS Framework | React, Vue.js, Angular, Next.js, Nuxt.js, Gatsby, Svelte |
144
- | JS Library | jQuery |
145
- | CSS Framework | Bootstrap, Tailwind CSS |
146
- | Analytics | Google Analytics, Google Tag Manager, Facebook Pixel, Hotjar |
147
- | CRM/Marketing | HubSpot, Mailchimp, Intercom |
148
- | CDN/Security | Cloudflare |
149
- | Web Server | nginx, Apache |
150
- | Hosting | Vercel, Netlify |
151
- | Backend | PHP, Django, Ruby on Rails, Node.js/Express |
152
- | Payment | Stripe |
121
+ *(You can also use a `.env` file in your working directory).*
153
122
 
154
- ## Sentiment Analysis
155
-
156
- English and French word lists for positive/negative detection in brand mentions. Categorizes mentions as: press, blog, forum, social, or review.
157
-
158
- ## Design Principles
159
-
160
- - **No external APIs** — everything via respectful web scraping
161
- - **Respectful scraping** — 1-2s delays, user-agent rotation, retry backoff
162
- - **Graceful degradation** — saves what it can if a check partially fails
163
- - **Local-first** — all data stays on your machine
164
-
165
- ## Tests
166
-
167
- ```bash
168
- npm test
169
- ```
123
+ ## 🔒 Privacy & Architecture
170
124
 
171
- 40 tests covering storage logic, technology detection, and sentiment analysis.
125
+ - **Local-first**: All tracker data, snapshots, and configurations are stored locally in `~/.intelwatch/`.
126
+ - **No intermediary servers**: The CLI talks directly to the data providers (Pappers, Apollo, Brave, Anthropic/OpenAI). We do not see your API keys or your searches.
127
+ - **Smart Routing**: `registry.js` automatically detects French companies (via SIREN/SIRET or country code) and routes them to Pappers, while international companies gracefully fallback to Apollo and OpenCorporates.
172
128
 
173
129
  ## License
174
130
 
@@ -1,6 +1,6 @@
1
1
  # Intelwatch Deep Profile — Roadmap Premium
2
2
 
3
- ## Current (v1.1.x — Shipped)
3
+ ## Current (v1.3.x — Shipped)
4
4
  - [x] Identity + finances 5 ans + consolidé groupe
5
5
  - [x] Filiales via recherche-dirigeants + CA/résultat
6
6
  - [x] Représentants / actionnariat
@@ -22,25 +22,25 @@
22
22
  - [x] **Article scraping for M&A depth** — top 5 articles (2000 chars), content injected into AI
23
23
  - [x] **Key date extraction from articles** — regex code-side, authoritative dates
24
24
  - [x] **FLI code-built revenue target** — scans all articles, picks highest announced target, overrides AI
25
- - [x] **Stale year warning** — red ⚠️ badge on subsidiaries with data > 2 years old
25
+ - [x] **Stale year warning** — red ⚠️ badge on subsidiaries avec data > 2 ans
26
+ - [x] Export JSON/CSV/XLS structuré
27
+ - [x] `--lang fr` option (PDF + AI prompts in French)
28
+ - [x] **OpenCorporates** — filiales internationales
29
+ - [x] **Smart Routing & International Pivot** — Apollo.io + Clearbit + OpenCorporates
30
+ - [x] OSINT scraping (Reddit, HackerNews)
31
+ - [x] Freemium gate (Free vs Pro) + license key check
32
+ - [x] Fix forces/faiblesses vides en terminal (parsing JSON)
33
+ - [x] Commit + npm publish as `intelwatch@1.3.x`
26
34
 
27
- ## v1.2 — Next Release
28
- - [ ] Fix forces/faiblesses vides en terminal (parsing JSON)
29
- - [ ] Export JSON/CSV structuré
30
- - [ ] `--lang fr` option (PDF + AI prompts in French)
31
- - [ ] Comparable transactions section (competitors' M&A/fundraising with article links)
32
- - [ ] Geographic implantations scraping from company website
33
- - [ ] Cross-reference press/journalists across sections
34
- - [ ] Commit + npm publish as `intelwatch@1.2.0`
35
-
36
- ## V2 — Pro ($49/mo)
35
+ ## V2Pro ($49/mo) — Next Releases
37
36
  - [ ] `intelwatch compare SIREN1 SIREN2` — côte à côte
38
37
  - [ ] **INPI integration** — brevets & marques du groupe (gratuit, data.inpi.fr)
39
- - [ ] **OpenCorporates** — filiales internationales (gratuit)
40
38
  - [ ] **Annuaire Entreprises / data.gouv** — données complémentaires
41
- - [ ] Freemium gate (3 profiles/jour) + license key
42
39
  - [ ] `--preview` mode limité (identity + dernier exercice)
43
40
  - [ ] **BODACC détaillé enrichi** — timeline types d'actes, augmentations capital
41
+ - [ ] Comparable transactions section (competitors' M&A/fundraising with article links)
42
+ - [ ] Geographic implantations scraping from company website
43
+ - [ ] Cross-reference press/journalists across sections
44
44
 
45
45
  ## V3 — Deep Profile ($299/mo)
46
46
  - [ ] **Graphe de liens** — visualisation SVG/HTML du réseau (Pappers graph-style)
@@ -64,7 +64,7 @@
64
64
  | Pappers | ✅ (BYOK) | ✅ API | v1.0 ✅ |
65
65
  | Brave Search | ✅ (BYOK) | ✅ API | v1.0 ✅ |
66
66
  | INPI (brevets/marques) | ✅ | ✅ data.inpi.fr | V2 |
67
- | OpenCorporates | ✅ | ✅ | V2 |
67
+ | OpenCorporates | ✅ | ✅ | v1.3 |
68
68
  | Annuaire Entreprises | ✅ | ✅ data.gouv | V2 |
69
69
  | BODACC détaillé | ✅ | ✅ bodacc.fr | V2 |
70
70
  | Infogreffe | ❌ 3.80€/doc | API payante | V4 |
@@ -77,8 +77,8 @@
77
77
  ## Pricing
78
78
  | Tier | Prix | Limites | Features |
79
79
  |------|------|---------|----------|
80
- | Free | 0€ | 3 profiles/jour, `--preview` | Identity + last year only |
81
- | Pro | 49€/mo | Illimité | Full profile + AI + PDF + export + INPI + compare |
80
+ | Free | 0€ | Bypass limites CSV | Identity + last year only |
81
+ | Pro | 49€/mo | Illimité | Full profile + AI + PDF + export XLS + INPI + Reddit/HN |
82
82
  | Deep Profile | 299€/mo | Illimité | Tout Pro + graphe + alertes + batch + scoring |
83
83
  | Enterprise | Custom | Custom | Tout Deep + Infogreffe + SEMrush + API REST |
84
84
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelwatch",
3
- "version": "1.3.2",
3
+ "version": "1.6.0",
4
4
  "description": "Competitive intelligence CLI — track competitors, keywords, and brand mentions from the terminal",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "intelwatch": "./bin/intelwatch.js"
9
9
  },
10
10
  "scripts": {
11
- "test": "node --test test/storage.test.js test/sentiment.test.js test/tech-detect.test.js test/export.test.js test/i18n.test.js test/error-handler.test.js test/reddit-hn.test.js test/license.test.js test/providers.test.js",
11
+ "test": "node --test test/storage.test.js test/sentiment.test.js test/tech-detect.test.js test/export.test.js test/i18n.test.js test/error-handler.test.js test/reddit-hn.test.js test/license.test.js test/providers.test.js test/searxng-search.test.js test/compare.test.js",
12
12
  "start": "node bin/intelwatch.js"
13
13
  },
14
14
  "dependencies": {
@@ -0,0 +1,30 @@
1
+ import fs from 'fs';
2
+
3
+ const file = 'README.md';
4
+ let content = fs.readFileSync(file, 'utf8');
5
+
6
+ const regexInstallation = /(## Installation[^#]+)/s;
7
+ const newInstallationBlock = \`## Installation
8
+
9
+ \`\`\`bash
10
+ npm install -g intelwatch
11
+
12
+ # 1. Run the interactive setup wizard to configure your APIs (OpenAI/Gemini, SearxNG, Pappers...)
13
+ intelwatch setup
14
+
15
+ # 2. Or run directly without installing (prompts will appear if needed):
16
+ npx intelwatch profile kpmg.fr --ai
17
+ \`\`\`
18
+
19
+ **Requirements:** Node.js >=18
20
+
21
+ ### ⚡ Auto-Fallback & Zero-Cost Capabilities (v1.5+)
22
+ Intelwatch is designed to be usable **for free** without any API keys:
23
+ - **Web Search**: Uses a local \`SearxNG\` or local \`Camofox\` instance natively if no API key is provided.
24
+ - **Company Identity (Due Diligence)**: Automatically falls back to the French Open Data **Annuaire Entreprises** (\`data.gouv.fr\`) if no Pappers API key is present.
25
+ - **Bot Bypass**: Fully integrated with the \`Camofox\` bypass engine (over port 9377) to scrape strict sites (Cloudflare/Datadome) safely.
26
+
27
+ \`;
28
+
29
+ content = content.replace(regexInstallation, newInstallationBlock);
30
+ fs.writeFileSync(file, content);
package/src/ai/client.js CHANGED
@@ -48,16 +48,24 @@ export function hasAIKey() {
48
48
  * Throws on API errors.
49
49
  */
50
50
  export async function callAI(systemPrompt, userPrompt, options = {}) {
51
+ const maxTokens = options.maxTokens || 1000;
52
+
53
+ if (options.uncensored) {
54
+ const host = process.env.OLLAMA_HOST || 'http://localhost:11434';
55
+ // We default to llama3 for uncensored local OSINT if the user hasn't specified one
56
+ const model = process.env.OLLAMA_MODEL || 'llama3';
57
+ return callOllama(host, model, systemPrompt, userPrompt, maxTokens);
58
+ }
59
+
51
60
  const aiConfig = getAIConfig();
52
61
  if (!aiConfig) {
53
62
  throw new Error(
54
63
  'No AI API key configured. Set GEMINI_API_KEY, OPENAI_API_KEY or ANTHROPIC_API_KEY, ' +
55
- 'or add ai.api_key to ~/.intelwatch/config.yml'
64
+ 'or add ai.api_key to ~/.intelwatch/config.yml. Use --uncensored for local Ollama.'
56
65
  );
57
66
  }
58
67
 
59
68
  const { provider, apiKey, model } = aiConfig;
60
- const maxTokens = options.maxTokens || 1000;
61
69
 
62
70
  if (provider === 'google') {
63
71
  return callGoogle(apiKey, model, systemPrompt, userPrompt, maxTokens);
@@ -166,3 +174,36 @@ async function callGoogle(apiKey, model, systemPrompt, userPrompt, maxTokens) {
166
174
  }
167
175
  return data.candidates[0].content.parts[0].text.trim();
168
176
  }
177
+
178
+ async function callOllama(host, model, systemPrompt, userPrompt, maxTokens) {
179
+ const url = `${host.replace(/\/$/, '')}/api/chat`;
180
+ const res = await fetch(url, {
181
+ method: 'POST',
182
+ headers: {
183
+ 'Content-Type': 'application/json',
184
+ },
185
+ body: JSON.stringify({
186
+ model: model,
187
+ messages: [
188
+ { role: 'system', content: systemPrompt },
189
+ { role: 'user', content: userPrompt }
190
+ ],
191
+ stream: false,
192
+ options: {
193
+ num_ctx: 16384,
194
+ num_predict: maxTokens
195
+ }
196
+ }),
197
+ });
198
+
199
+ if (!res.ok) {
200
+ const body = await res.text();
201
+ throw new Error(`Ollama API ${res.status}: ${body.slice(0, 200)}`);
202
+ }
203
+
204
+ const data = await res.json();
205
+ if (!data.message || !data.message.content) {
206
+ throw new Error('Invalid Ollama API response');
207
+ }
208
+ return data.message.content.trim();
209
+ }