firecrawl-cli 1.9.7 → 1.9.8

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.
Files changed (31) hide show
  1. package/dist/commands/browser.d.ts.map +1 -1
  2. package/dist/commands/browser.js +5 -3
  3. package/dist/commands/browser.js.map +1 -1
  4. package/dist/commands/experimental/index.d.ts.map +1 -1
  5. package/dist/commands/experimental/index.js +45 -4
  6. package/dist/commands/experimental/index.js.map +1 -1
  7. package/dist/commands/experimental/workflows/company-directories.d.ts +11 -0
  8. package/dist/commands/experimental/workflows/company-directories.d.ts.map +1 -0
  9. package/dist/commands/experimental/workflows/company-directories.js +245 -0
  10. package/dist/commands/experimental/workflows/company-directories.js.map +1 -0
  11. package/dist/commands/experimental/workflows/competitive-intel.d.ts +11 -0
  12. package/dist/commands/experimental/workflows/competitive-intel.d.ts.map +1 -0
  13. package/dist/commands/experimental/workflows/competitive-intel.js +226 -0
  14. package/dist/commands/experimental/workflows/competitive-intel.js.map +1 -0
  15. package/dist/commands/experimental/workflows/dashboard-reporting.d.ts +11 -0
  16. package/dist/commands/experimental/workflows/dashboard-reporting.d.ts.map +1 -0
  17. package/dist/commands/experimental/workflows/dashboard-reporting.js +254 -0
  18. package/dist/commands/experimental/workflows/dashboard-reporting.js.map +1 -0
  19. package/dist/commands/experimental/workflows/knowledge-ingest.d.ts +12 -0
  20. package/dist/commands/experimental/workflows/knowledge-ingest.d.ts.map +1 -0
  21. package/dist/commands/experimental/workflows/knowledge-ingest.js +251 -0
  22. package/dist/commands/experimental/workflows/knowledge-ingest.js.map +1 -0
  23. package/dist/commands/experimental/workflows/lead-gen.d.ts +11 -0
  24. package/dist/commands/experimental/workflows/lead-gen.d.ts.map +1 -0
  25. package/dist/commands/experimental/workflows/lead-gen.js +257 -0
  26. package/dist/commands/experimental/workflows/lead-gen.js.map +1 -0
  27. package/dist/commands/experimental/workflows/market-research.d.ts +11 -0
  28. package/dist/commands/experimental/workflows/market-research.d.ts.map +1 -0
  29. package/dist/commands/experimental/workflows/market-research.js +254 -0
  30. package/dist/commands/experimental/workflows/market-research.js.map +1 -0
  31. package/package.json +2 -2
@@ -0,0 +1,254 @@
1
+ "use strict";
2
+ /**
3
+ * Workflow: Market Research
4
+ *
5
+ * Browses financial portals, earnings pages, and market data sites using a
6
+ * cloud browser. Interacts with charts, filters, and dropdowns to extract
7
+ * earnings data, market metrics, and financial comparisons across companies.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.register = register;
44
+ const backends_1 = require("../backends");
45
+ const shared_1 = require("../shared");
46
+ // ─── Input gathering ────────────────────────────────────────────────────────
47
+ async function gatherInputs(prefill) {
48
+ if (prefill?.query) {
49
+ return {
50
+ query: prefill.query,
51
+ companies: '',
52
+ dataPoints: 'all',
53
+ output: 'json',
54
+ context: '',
55
+ };
56
+ }
57
+ const { input, select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
58
+ const query = await input({
59
+ message: 'What market or industry to research? (e.g., "cloud infrastructure", "AI SaaS")',
60
+ validate: (0, shared_1.validateRequired)('Market or industry'),
61
+ });
62
+ const companies = await input({
63
+ message: 'Specific companies to include? (comma-separated, leave blank to discover)',
64
+ default: '',
65
+ });
66
+ const dataPoints = await select({
67
+ message: 'What data are you looking for?',
68
+ choices: [
69
+ { name: 'Everything (revenue, earnings, metrics, news)', value: 'all' },
70
+ { name: 'Financial data (revenue, earnings, margins)', value: 'financial' },
71
+ { name: 'Market metrics (market cap, P/E, growth rates)', value: 'metrics' },
72
+ { name: 'Industry trends and news', value: 'trends' },
73
+ ],
74
+ });
75
+ const output = await select({
76
+ message: 'Output format?',
77
+ choices: [
78
+ { name: 'JSON (structured data)', value: 'json' },
79
+ { name: 'Markdown report', value: 'markdown' },
80
+ { name: 'Print to terminal', value: 'terminal' },
81
+ ],
82
+ });
83
+ const context = await input({
84
+ message: 'Any specific angle? (e.g., "focus on Q4 2024 earnings", "compare gross margins")',
85
+ default: '',
86
+ });
87
+ return { query, companies, dataPoints, output, context };
88
+ }
89
+ // ─── System prompt ──────────────────────────────────────────────────────────
90
+ function buildSystemPrompt(opts) {
91
+ const focusInstructions = {
92
+ all: 'Extract comprehensive data: revenue, earnings, margins, market cap, P/E ratio, growth rates, recent news, and analyst estimates.',
93
+ financial: 'Focus on financial statements: quarterly/annual revenue, net income, gross margin, operating margin, EPS, and YoY growth.',
94
+ metrics: 'Focus on market metrics: market cap, P/E ratio, P/S ratio, EV/EBITDA, 52-week range, average volume, and beta.',
95
+ trends: 'Focus on industry trends: market size estimates, growth forecasts, major deals/acquisitions, regulatory changes, and emerging players.',
96
+ };
97
+ const outputInstructions = {
98
+ terminal: 'Print the full market research report to the terminal in well-formatted markdown with data tables.',
99
+ json: `Save the report to \`market-research.json\` in the current directory. Tell the user the file path when done.
100
+
101
+ Use this schema:
102
+ \`\`\`json
103
+ {
104
+ "market": "string",
105
+ "researchedAt": "ISO-8601",
106
+ "companies": [
107
+ {
108
+ "name": "string",
109
+ "ticker": "string",
110
+ "sector": "string",
111
+ "financials": {
112
+ "revenue": { "value": "string", "period": "string", "yoyGrowth": "string" },
113
+ "netIncome": { "value": "string", "period": "string" },
114
+ "grossMargin": "string",
115
+ "operatingMargin": "string",
116
+ "eps": "string"
117
+ },
118
+ "marketMetrics": {
119
+ "marketCap": "string",
120
+ "peRatio": "string",
121
+ "psRatio": "string",
122
+ "52weekHigh": "string",
123
+ "52weekLow": "string"
124
+ },
125
+ "recentNews": [{ "date": "string", "headline": "string", "source": "string", "url": "string" }],
126
+ "sources": ["url"]
127
+ }
128
+ ],
129
+ "industryTrends": [{ "trend": "string", "details": "string", "source": "url" }],
130
+ "sources": [{ "url": "string", "type": "string", "dataExtracted": "string" }]
131
+ }
132
+ \`\`\``,
133
+ markdown: 'Save the report to `market-research.md` in the current directory. Tell the user the file path when done.',
134
+ };
135
+ return `You are a market research agent powered by Firecrawl. You use a real cloud browser to navigate financial portals, interact with data visualizations, and extract structured market data.
136
+
137
+ ## STEP 1: Launch Browser and Open Live View
138
+
139
+ Before anything else, launch a browser session so the user can watch:
140
+
141
+ \`\`\`bash
142
+ firecrawl browser launch-session --json
143
+ \`\`\`
144
+
145
+ Extract the \`interactiveLiveViewUrl\` from the JSON output and open it (NOT the regular \`liveViewUrl\` -- the interactive one lets the user click and interact):
146
+
147
+ \`\`\`bash
148
+ open "<interactiveLiveViewUrl>" # macOS
149
+ xdg-open "<interactiveLiveViewUrl>" # Linux
150
+ \`\`\`
151
+
152
+ If the \`open\` command fails, print the URL clearly.
153
+
154
+ ## STEP 2: Identify Target Companies
155
+
156
+ If the user didn't specify companies, search for key players in the market:
157
+
158
+ \`\`\`bash
159
+ firecrawl search "<market> top public companies"
160
+ firecrawl search "<market> industry leaders revenue"
161
+ \`\`\`
162
+
163
+ ## STEP 3: Extract Data from Financial Portals
164
+
165
+ For each company, visit financial data sources and interact with their UIs:
166
+
167
+ ### Primary sources to visit:
168
+ - **Yahoo Finance** (finance.yahoo.com) -- Company profile, financials, statistics
169
+ - **Macrotrends** (macrotrends.net) -- Historical financials, charts
170
+ - **SEC filings** (sec.gov/cgi-bin/browse-edgar) -- For US public companies
171
+ - **Company investor relations pages** -- Direct earnings reports
172
+
173
+ ### How to extract data:
174
+ 1. Navigate to the company's financial page
175
+ 2. Snapshot to see available data sections
176
+ 3. Click tabs like "Financials", "Statistics", "Historical Data"
177
+ 4. Interact with period selectors (quarterly/annual toggles)
178
+ 5. Scroll through data tables and extract values
179
+ 6. Click into earnings reports or press releases for details
180
+
181
+ ### Browser commands:
182
+ \`\`\`bash
183
+ firecrawl browser "open <url>"
184
+ firecrawl browser "snapshot"
185
+ firecrawl browser "click @<ref>"
186
+ firecrawl browser "type @<ref> <text>"
187
+ firecrawl browser "scroll down"
188
+ firecrawl browser "scrape"
189
+ \`\`\`
190
+
191
+ Also use \`firecrawl scrape <url>\` for quick page grabs when browser interaction isn't needed.
192
+
193
+ ## Data Focus
194
+
195
+ ${focusInstructions[opts.dataPoints]}
196
+
197
+ ## Output Format
198
+
199
+ ${outputInstructions[opts.output]}
200
+
201
+ Structure your report with:
202
+
203
+ ### Market Overview
204
+ - Industry description, size, and growth trajectory
205
+ - Key players and market share (if available)
206
+
207
+ ### Company Profiles
208
+ For each company:
209
+ - Financial summary (revenue, margins, growth)
210
+ - Market metrics (cap, ratios)
211
+ - Recent developments
212
+
213
+ ### Comparison Tables
214
+ - Revenue comparison across companies
215
+ - Margin comparison
216
+ - Valuation multiples side-by-side
217
+
218
+ ### Trends & Outlook
219
+ - Industry trends and forecasts
220
+ - Analyst consensus if available
221
+
222
+ ### Sources
223
+ - Every URL visited with what data was extracted
224
+
225
+ ---
226
+
227
+ Do everything sequentially. Cross-reference data across sources when possible. Note any conflicting numbers. Start immediately.`;
228
+ }
229
+ // ─── Command registration ───────────────────────────────────────────────────
230
+ function register(parentCmd, backend) {
231
+ const config = backends_1.BACKENDS[backend];
232
+ parentCmd
233
+ .command('market-research')
234
+ .description('Extract financial data, earnings, and market metrics via browser')
235
+ .argument('[query...]', 'Market, industry, or company to research')
236
+ .option('-y, --yes', 'Auto-approve all tool permissions')
237
+ .action(async (queryParts, options) => {
238
+ const prefillQuery = queryParts.length > 0 ? queryParts.join(' ') : undefined;
239
+ const inputs = await gatherInputs(prefillQuery ? { query: prefillQuery } : undefined);
240
+ const parts = [`Research market: ${inputs.query}`];
241
+ if (inputs.companies)
242
+ parts.push(`Include these companies: ${inputs.companies}`);
243
+ if (inputs.context)
244
+ parts.push(inputs.context);
245
+ const userMessage = parts.join('. ') + '.';
246
+ const skipPermissions = true;
247
+ console.log(`\nLaunching ${config.displayName}...\n`);
248
+ (0, backends_1.launchAgent)(backend, buildSystemPrompt({
249
+ dataPoints: inputs.dataPoints,
250
+ output: inputs.output,
251
+ }), userMessage, skipPermissions);
252
+ });
253
+ }
254
+ //# sourceMappingURL=market-research.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"market-research.js","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/market-research.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiOH,4BAoCC;AAlQD,0CAAkE;AAClE,sCAA6C;AAY7C,+EAA+E;AAE/E,KAAK,UAAU,YAAY,CAAC,OAA4B;IACtD,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACnB,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE;SACZ,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,KA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D,IAAI,MAAM,CAAC,SAAS;YAClB,KAAK,CAAC,IAAI,CAAC,4BAA4B,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QAE3C,MAAM,eAAe,GAAG,IAAI,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,WAAW,OAAO,CAAC,CAAC;QAEtD,IAAA,sBAAW,EACT,OAAO,EACP,iBAAiB,CAAC;YAChB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,EACF,WAAW,EACX,eAAe,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl-cli",
3
- "version": "1.9.7",
3
+ "version": "1.9.8",
4
4
  "description": "Command-line interface for Firecrawl. Scrape, crawl, and extract data from any website directly from your terminal.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@inquirer/prompts": "^8.2.1",
71
- "@mendable/firecrawl-js": "4.15.3",
71
+ "@mendable/firecrawl-js": "4.15.4",
72
72
  "commander": "^14.0.2"
73
73
  }
74
74
  }