firecrawl-cli 1.16.2 → 1.17.1
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 +15 -37
- package/dist/__tests__/commands/init.test.js +4 -2
- package/dist/__tests__/commands/init.test.js.map +1 -1
- package/dist/__tests__/commands/search.test.js +134 -179
- package/dist/__tests__/commands/search.test.js.map +1 -1
- package/dist/__tests__/commands/setup.test.js +6 -2
- package/dist/__tests__/commands/setup.test.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +27 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/search-feedback.d.ts +44 -0
- package/dist/commands/search-feedback.d.ts.map +1 -0
- package/dist/commands/search-feedback.js +357 -0
- package/dist/commands/search-feedback.js.map +1 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +19 -28
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +9 -5
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skills-install.d.ts +9 -1
- package/dist/commands/skills-install.d.ts.map +1 -1
- package/dist/commands/skills-install.js +13 -2
- package/dist/commands/skills-install.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +4 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/index.js +68 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/experimental/backends.d.ts +0 -19
- package/dist/commands/experimental/backends.d.ts.map +0 -1
- package/dist/commands/experimental/backends.js +0 -74
- package/dist/commands/experimental/backends.js.map +0 -1
- package/dist/commands/experimental/index.d.ts +0 -13
- package/dist/commands/experimental/index.d.ts.map +0 -1
- package/dist/commands/experimental/index.js +0 -200
- package/dist/commands/experimental/index.js.map +0 -1
- package/dist/commands/experimental/shared.d.ts +0 -17
- package/dist/commands/experimental/shared.d.ts.map +0 -1
- package/dist/commands/experimental/shared.js +0 -152
- package/dist/commands/experimental/shared.js.map +0 -1
- package/dist/commands/experimental/workflows/company-directories.d.ts +0 -11
- package/dist/commands/experimental/workflows/company-directories.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/company-directories.js +0 -245
- package/dist/commands/experimental/workflows/company-directories.js.map +0 -1
- package/dist/commands/experimental/workflows/competitive-intel.d.ts +0 -11
- package/dist/commands/experimental/workflows/competitive-intel.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/competitive-intel.js +0 -226
- package/dist/commands/experimental/workflows/competitive-intel.js.map +0 -1
- package/dist/commands/experimental/workflows/competitor-analysis.d.ts +0 -10
- package/dist/commands/experimental/workflows/competitor-analysis.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/competitor-analysis.js +0 -196
- package/dist/commands/experimental/workflows/competitor-analysis.js.map +0 -1
- package/dist/commands/experimental/workflows/dashboard-reporting.d.ts +0 -11
- package/dist/commands/experimental/workflows/dashboard-reporting.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/dashboard-reporting.js +0 -254
- package/dist/commands/experimental/workflows/dashboard-reporting.js.map +0 -1
- package/dist/commands/experimental/workflows/deep-research.d.ts +0 -11
- package/dist/commands/experimental/workflows/deep-research.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/deep-research.js +0 -159
- package/dist/commands/experimental/workflows/deep-research.js.map +0 -1
- package/dist/commands/experimental/workflows/demo.d.ts +0 -11
- package/dist/commands/experimental/workflows/demo.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/demo.js +0 -190
- package/dist/commands/experimental/workflows/demo.js.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-base.d.ts +0 -11
- package/dist/commands/experimental/workflows/knowledge-base.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-base.js +0 -319
- package/dist/commands/experimental/workflows/knowledge-base.js.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-ingest.d.ts +0 -12
- package/dist/commands/experimental/workflows/knowledge-ingest.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/knowledge-ingest.js +0 -251
- package/dist/commands/experimental/workflows/knowledge-ingest.js.map +0 -1
- package/dist/commands/experimental/workflows/lead-gen.d.ts +0 -11
- package/dist/commands/experimental/workflows/lead-gen.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/lead-gen.js +0 -257
- package/dist/commands/experimental/workflows/lead-gen.js.map +0 -1
- package/dist/commands/experimental/workflows/lead-research.d.ts +0 -11
- package/dist/commands/experimental/workflows/lead-research.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/lead-research.js +0 -146
- package/dist/commands/experimental/workflows/lead-research.js.map +0 -1
- package/dist/commands/experimental/workflows/market-research.d.ts +0 -11
- package/dist/commands/experimental/workflows/market-research.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/market-research.js +0 -260
- package/dist/commands/experimental/workflows/market-research.js.map +0 -1
- package/dist/commands/experimental/workflows/qa.d.ts +0 -11
- package/dist/commands/experimental/workflows/qa.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/qa.js +0 -184
- package/dist/commands/experimental/workflows/qa.js.map +0 -1
- package/dist/commands/experimental/workflows/research-papers.d.ts +0 -11
- package/dist/commands/experimental/workflows/research-papers.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/research-papers.js +0 -151
- package/dist/commands/experimental/workflows/research-papers.js.map +0 -1
- package/dist/commands/experimental/workflows/seo-audit.d.ts +0 -11
- package/dist/commands/experimental/workflows/seo-audit.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/seo-audit.js +0 -155
- package/dist/commands/experimental/workflows/seo-audit.js.map +0 -1
- package/dist/commands/experimental/workflows/shop.d.ts +0 -11
- package/dist/commands/experimental/workflows/shop.d.ts.map +0 -1
- package/dist/commands/experimental/workflows/shop.js +0 -155
- package/dist/commands/experimental/workflows/shop.js.map +0 -1
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Experimental: AI Workflow commands
|
|
4
|
-
*
|
|
5
|
-
* Launches interactive coding agent sessions with pre-built system prompts.
|
|
6
|
-
* Similar to `ollama run <model>` -- one command spins up a specialized agent.
|
|
7
|
-
*
|
|
8
|
-
* Supports multiple backends: Claude Code, Codex (OpenAI), OpenCode.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.createClaudeCommand = createClaudeCommand;
|
|
12
|
-
exports.createCodexCommand = createCodexCommand;
|
|
13
|
-
exports.createOpenCodeCommand = createOpenCodeCommand;
|
|
14
|
-
const commander_1 = require("commander");
|
|
15
|
-
const backends_1 = require("./backends");
|
|
16
|
-
const competitor_analysis_1 = require("./workflows/competitor-analysis");
|
|
17
|
-
const competitive_intel_1 = require("./workflows/competitive-intel");
|
|
18
|
-
const company_directories_1 = require("./workflows/company-directories");
|
|
19
|
-
const dashboard_reporting_1 = require("./workflows/dashboard-reporting");
|
|
20
|
-
const deep_research_1 = require("./workflows/deep-research");
|
|
21
|
-
const knowledge_base_1 = require("./workflows/knowledge-base");
|
|
22
|
-
const knowledge_ingest_1 = require("./workflows/knowledge-ingest");
|
|
23
|
-
const lead_gen_1 = require("./workflows/lead-gen");
|
|
24
|
-
const lead_research_1 = require("./workflows/lead-research");
|
|
25
|
-
const market_research_1 = require("./workflows/market-research");
|
|
26
|
-
const seo_audit_1 = require("./workflows/seo-audit");
|
|
27
|
-
const qa_1 = require("./workflows/qa");
|
|
28
|
-
const research_papers_1 = require("./workflows/research-papers");
|
|
29
|
-
const demo_1 = require("./workflows/demo");
|
|
30
|
-
const shop_1 = require("./workflows/shop");
|
|
31
|
-
// ─── Workflow Registration (shared across backends) ──────────────────────────
|
|
32
|
-
function registerWorkflows(parentCmd, backend) {
|
|
33
|
-
(0, competitor_analysis_1.register)(parentCmd, backend);
|
|
34
|
-
(0, competitive_intel_1.register)(parentCmd, backend);
|
|
35
|
-
(0, company_directories_1.register)(parentCmd, backend);
|
|
36
|
-
(0, dashboard_reporting_1.register)(parentCmd, backend);
|
|
37
|
-
(0, deep_research_1.register)(parentCmd, backend);
|
|
38
|
-
(0, knowledge_base_1.register)(parentCmd, backend);
|
|
39
|
-
(0, knowledge_ingest_1.register)(parentCmd, backend);
|
|
40
|
-
(0, lead_gen_1.register)(parentCmd, backend);
|
|
41
|
-
(0, lead_research_1.register)(parentCmd, backend);
|
|
42
|
-
(0, market_research_1.register)(parentCmd, backend);
|
|
43
|
-
(0, seo_audit_1.register)(parentCmd, backend);
|
|
44
|
-
(0, qa_1.register)(parentCmd, backend);
|
|
45
|
-
(0, research_papers_1.register)(parentCmd, backend);
|
|
46
|
-
(0, demo_1.register)(parentCmd, backend);
|
|
47
|
-
(0, shop_1.register)(parentCmd, backend);
|
|
48
|
-
}
|
|
49
|
-
// ─── Help text (shared) ─────────────────────────────────────────────────────
|
|
50
|
-
function buildHelpText(cmdName) {
|
|
51
|
-
return `
|
|
52
|
-
Workflows:
|
|
53
|
-
competitor-analysis Scrape a site + competitors, compare features, pricing, positioning
|
|
54
|
-
competitive-intel Monitor competitor dashboards, pricing tiers, and feature changes
|
|
55
|
-
company-directories Scrape startup directories (YC, Crunchbase, etc.) into structured lists
|
|
56
|
-
dashboard-reporting Pull metrics from analytics dashboards and internal tools via browser
|
|
57
|
-
deep-research Multi-source research with configurable depth (5-25+ sources)
|
|
58
|
-
knowledge-base Build a knowledge base from web content (docs, RAG, fine-tuning)
|
|
59
|
-
knowledge-ingest Extract auth-gated docs portals into structured JSON or markdown
|
|
60
|
-
lead-gen Extract prospect contact details from databases at scale via browser
|
|
61
|
-
lead-research Pre-meeting intelligence brief on a company or person
|
|
62
|
-
market-research Extract financial data, earnings, and market metrics via browser
|
|
63
|
-
seo-audit Map a site, check meta/headings, compare to competitors
|
|
64
|
-
qa Spawn parallel browser agents to QA test a live site
|
|
65
|
-
research-papers Find and synthesize research papers, whitepapers, and PDFs
|
|
66
|
-
demo Walk through a product's key flows using cloud browser
|
|
67
|
-
shop Research products across the web, then buy using your saved Amazon session
|
|
68
|
-
|
|
69
|
-
Examples:
|
|
70
|
-
|
|
71
|
-
Prep for a sales call -- research the company, key people, and talking points:
|
|
72
|
-
$ firecrawl ${cmdName} lead-research "Vercel"
|
|
73
|
-
$ firecrawl ${cmdName} lead-research "Stripe"
|
|
74
|
-
|
|
75
|
-
Scope out the competition before a pitch:
|
|
76
|
-
$ firecrawl ${cmdName} competitor-analysis https://firecrawl.dev
|
|
77
|
-
$ firecrawl ${cmdName} competitor-analysis https://crawlee.dev
|
|
78
|
-
|
|
79
|
-
Research a market, integration opportunity, or partnership angle:
|
|
80
|
-
$ firecrawl ${cmdName} deep-research "RAG pipeline data ingestion tools landscape"
|
|
81
|
-
$ firecrawl ${cmdName} deep-research "Cursor AI editor architecture and extensions"
|
|
82
|
-
|
|
83
|
-
Scrape docs so you actually understand a product before the call:
|
|
84
|
-
$ firecrawl ${cmdName} knowledge-base https://docs.langchain.com
|
|
85
|
-
$ firecrawl ${cmdName} knowledge-base https://sdk.vercel.ai/docs
|
|
86
|
-
|
|
87
|
-
Build a fine-tuning dataset or RAG corpus from web content:
|
|
88
|
-
$ firecrawl ${cmdName} knowledge-base "Neon serverless postgres"
|
|
89
|
-
|
|
90
|
-
Walk through a product's UX -- signup, pricing, docs, dashboard:
|
|
91
|
-
$ firecrawl ${cmdName} demo https://resend.com
|
|
92
|
-
$ firecrawl ${cmdName} demo https://neon.tech
|
|
93
|
-
|
|
94
|
-
QA test a site before a demo or client handoff:
|
|
95
|
-
$ firecrawl ${cmdName} qa https://myapp.com
|
|
96
|
-
|
|
97
|
-
Audit a site's SEO and get specific fix recommendations:
|
|
98
|
-
$ firecrawl ${cmdName} seo-audit https://example.com
|
|
99
|
-
|
|
100
|
-
Find and synthesize research papers on a topic:
|
|
101
|
-
$ firecrawl ${cmdName} research-papers "web scraping compliance healthcare HIPAA"
|
|
102
|
-
|
|
103
|
-
Research and shop -- find the best deal, then add to your Amazon cart:
|
|
104
|
-
$ firecrawl ${cmdName} shop "mac mini for SF office delivery"
|
|
105
|
-
$ firecrawl ${cmdName} shop "best mechanical keyboard for developers"
|
|
106
|
-
|
|
107
|
-
Monitor competitor pricing and feature changes weekly:
|
|
108
|
-
$ firecrawl ${cmdName} competitive-intel "Linear, Asana, Monday.com"
|
|
109
|
-
$ firecrawl ${cmdName} competitive-intel https://openai.com https://anthropic.com
|
|
110
|
-
|
|
111
|
-
Build targeted company lists from startup directories:
|
|
112
|
-
$ firecrawl ${cmdName} company-directories "YC Series A B2B SaaS"
|
|
113
|
-
$ firecrawl ${cmdName} company-directories
|
|
114
|
-
|
|
115
|
-
Ingest auth-gated docs portals into structured data:
|
|
116
|
-
$ firecrawl ${cmdName} knowledge-ingest https://docs.internal.company.com
|
|
117
|
-
$ firecrawl ${cmdName} knowledge-ingest https://notion.so/team-wiki
|
|
118
|
-
|
|
119
|
-
Extract financial data and market metrics:
|
|
120
|
-
$ firecrawl ${cmdName} market-research "cloud infrastructure market"
|
|
121
|
-
$ firecrawl ${cmdName} market-research "AI SaaS companies"
|
|
122
|
-
|
|
123
|
-
Generate leads from prospect databases at scale:
|
|
124
|
-
$ firecrawl ${cmdName} lead-gen "CTOs at Series B fintech startups"
|
|
125
|
-
$ firecrawl ${cmdName} lead-gen "VP Engineering at healthcare companies"
|
|
126
|
-
|
|
127
|
-
Pull metrics from analytics dashboards behind login walls:
|
|
128
|
-
$ firecrawl ${cmdName} dashboard-reporting "analytics.google.com, app.mixpanel.com"
|
|
129
|
-
$ firecrawl ${cmdName} dashboard-reporting https://app.stripe.com/dashboard
|
|
130
|
-
|
|
131
|
-
Run any workflow fully interactive (no args, prompts guide you):
|
|
132
|
-
$ firecrawl ${cmdName} competitor-analysis
|
|
133
|
-
$ firecrawl ${cmdName} deep-research
|
|
134
|
-
|
|
135
|
-
Pass -y to auto-approve all tool permissions.
|
|
136
|
-
`;
|
|
137
|
-
}
|
|
138
|
-
// ─── Passthrough (natural language fallback) ─────────────────────────────────
|
|
139
|
-
function buildPassthroughSystemPrompt(_userInput) {
|
|
140
|
-
return `You are a Firecrawl power user. You have the full Firecrawl CLI at your disposal to accomplish any web task the user describes.
|
|
141
|
-
|
|
142
|
-
## First Steps
|
|
143
|
-
|
|
144
|
-
**Run \`firecrawl --help\` to see all available commands and capabilities.** This is critical -- read the output carefully before proceeding.
|
|
145
|
-
|
|
146
|
-
Then run \`firecrawl <command> --help\` for whichever specific commands you need.
|
|
147
|
-
|
|
148
|
-
## Available Tools
|
|
149
|
-
|
|
150
|
-
Use ONLY \`firecrawl\` for ALL web operations. It is already installed and authenticated. Run firecrawl commands via Bash. Do not use any other tools, skills, plugins, or built-in web features for web access -- only \`firecrawl\`. If the CLI has issues, you may fall back to Firecrawl MCP tools if available.
|
|
151
|
-
|
|
152
|
-
Quick reference:
|
|
153
|
-
- \`firecrawl search "<query>"\` -- Search the web
|
|
154
|
-
- \`firecrawl scrape <url>\` -- Scrape a page as markdown
|
|
155
|
-
- \`firecrawl scrape <url> --format html\` -- Scrape as HTML
|
|
156
|
-
- \`firecrawl map <url>\` -- Discover all URLs on a site
|
|
157
|
-
- \`firecrawl crawl <url>\` -- Crawl an entire site
|
|
158
|
-
- \`firecrawl interact "Click the login button"\` -- Interact with a scraped page
|
|
159
|
-
- \`firecrawl agent "<prompt>"\` -- AI agent for complex extraction
|
|
160
|
-
|
|
161
|
-
## Guidelines
|
|
162
|
-
|
|
163
|
-
- Figure out the right firecrawl commands for the task by reading --help output
|
|
164
|
-
- Be resourceful -- combine multiple commands if needed
|
|
165
|
-
- Show your work and explain what you're doing
|
|
166
|
-
- Start working immediately`;
|
|
167
|
-
}
|
|
168
|
-
function createBackendCommand(name, description, backend) {
|
|
169
|
-
const cmd = new commander_1.Command(name)
|
|
170
|
-
.description(description)
|
|
171
|
-
.argument('[input...]', 'Natural language task or workflow name')
|
|
172
|
-
.option('-y, --yes', 'Auto-approve all tool permissions')
|
|
173
|
-
.allowUnknownOption()
|
|
174
|
-
.addHelpText('after', buildHelpText(name));
|
|
175
|
-
registerWorkflows(cmd, backend);
|
|
176
|
-
// Catch-all: if no subcommand matched, treat args as natural language
|
|
177
|
-
cmd.action(async (input, options) => {
|
|
178
|
-
const userInput = input.join(' ').trim();
|
|
179
|
-
if (!userInput) {
|
|
180
|
-
cmd.outputHelp();
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
const config = backends_1.BACKENDS[backend];
|
|
184
|
-
const skipPermissions = true;
|
|
185
|
-
console.log(`\nLaunching ${config.displayName}...\n`);
|
|
186
|
-
(0, backends_1.launchAgent)(backend, buildPassthroughSystemPrompt(userInput), userInput, skipPermissions);
|
|
187
|
-
});
|
|
188
|
-
return cmd;
|
|
189
|
-
}
|
|
190
|
-
// ─── Command Exports ─────────────────────────────────────────────────────────
|
|
191
|
-
function createClaudeCommand() {
|
|
192
|
-
return createBackendCommand('claude', 'AI workflows powered by Claude Code', 'claude');
|
|
193
|
-
}
|
|
194
|
-
function createCodexCommand() {
|
|
195
|
-
return createBackendCommand('codex', 'AI workflows powered by Codex (coming soon)', 'codex');
|
|
196
|
-
}
|
|
197
|
-
function createOpenCodeCommand() {
|
|
198
|
-
return createBackendCommand('opencode', 'AI workflows powered by OpenCode (coming soon)', 'opencode');
|
|
199
|
-
}
|
|
200
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/experimental/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AA2MH,kDAMC;AAED,gDAMC;AAED,sDAMC;AA/ND,yCAAoC;AACpC,yCAAiE;AAEjE,yEAAyF;AACzF,qEAAqF;AACrF,yEAAyF;AACzF,yEAAyF;AACzF,6DAA6E;AAC7E,+DAA+E;AAC/E,mEAAmF;AACnF,mDAAmE;AACnE,6DAA6E;AAC7E,iEAAiF;AACjF,qDAAqE;AACrE,uCAAwD;AACxD,iEAAiF;AACjF,2CAA4D;AAC5D,2CAA4D;AAE5D,gFAAgF;AAEhF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,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC;AAED,gFAAgF;AAEhF,SAAgB,mBAAmB;IACjC,OAAO,oBAAoB,CACzB,QAAQ,EACR,qCAAqC,EACrC,QAAQ,CACT,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB;IAChC,OAAO,oBAAoB,CACzB,OAAO,EACP,6CAA6C,EAC7C,OAAO,CACR,CAAC;AACJ,CAAC;AAED,SAAgB,qBAAqB;IACnC,OAAO,oBAAoB,CACzB,UAAU,EACV,gDAAgD,EAChD,UAAU,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared constants and helpers for AI workflows.
|
|
3
|
-
*/
|
|
4
|
-
import { type Backend } from './backends';
|
|
5
|
-
export declare const validateUrl: (value: string) => true | string;
|
|
6
|
-
export declare const validateRequired: (label: string) => (value: string) => true | string;
|
|
7
|
-
/** Ensure a URL has a protocol prefix. */
|
|
8
|
-
export declare function normalizeUrl(url: string): string;
|
|
9
|
-
/** Normalize a source that might be a URL or a plain topic string. */
|
|
10
|
-
export declare function normalizeSource(source: string): string;
|
|
11
|
-
export declare const FIRECRAWL_TOOLS_BLOCK = "## Your Tools -- READ THIS FIRST\n\nUse ONLY `firecrawl` for ALL web operations. It is already installed and authenticated. Run firecrawl commands via Bash. Do not use any other tools, skills, plugins, or built-in web features for web access -- only `firecrawl`. If the CLI has issues, you may fall back to Firecrawl MCP tools if available.\n\n**First step: run `firecrawl --help` to see all available commands.** Then run `firecrawl <command> --help` for any command you plan to use heavily.\n\nQuick reference:\n- `firecrawl search \"<query>\"` -- Search the web\n- `firecrawl scrape <url>` -- Scrape a page as markdown\n- `firecrawl map <url>` -- Discover all URLs on a site\n- `firecrawl crawl <url>` -- Crawl an entire site\n- `firecrawl interact \"Click the login button\"` -- Interact with a scraped page\n- `firecrawl agent \"<prompt>\"` -- AI agent for complex extraction";
|
|
12
|
-
export declare const QA_TOOLS_BLOCK = "## Your Tools -- READ THIS FIRST\n\nUse ONLY `firecrawl` for ALL web operations. It is already installed and authenticated. Run firecrawl commands via Bash. Do not use any other tools, skills, plugins, or built-in web features for web access -- only `firecrawl`. If the CLI has issues, you may fall back to Firecrawl MCP tools if available.\n\n**First step: run `firecrawl --help` to see all available commands.** Tell each subagent to do the same.\n\n## IMPORTANT: Launch Browser with Live View FIRST\n\nBefore doing anything else, launch a browser session with streaming enabled so the user can watch in real-time:\n\n```bash\nfirecrawl browser launch-session --json\n```\n\nThis prints a **Live View URL**. Try to open it automatically for the user:\n\n```bash\nopen \"<liveViewUrl>\" # macOS\nxdg-open \"<liveViewUrl>\" # Linux\n```\n\nIf the `open` command fails or errors, just print the URL clearly so the user can copy-paste it into their browser. Either way, make sure the user sees the live view URL before you start working.\n\nQuick reference:\n- `firecrawl browser \"open <url>\"` -- Navigate to a URL in a cloud browser\n- `firecrawl browser \"snapshot\"` -- Get the current page state (accessibility tree)\n- `firecrawl browser \"click @<ref>\"` -- Click an element by its reference ID\n- `firecrawl browser \"type @<ref> <text>\"` -- Type text into an input\n- `firecrawl browser \"scrape\"` -- Get the full page content as markdown\n- `firecrawl browser \"scroll down\"` / `\"scroll up\"` -- Scroll the page\n- `firecrawl scrape <url>` -- Quick scrape without browser session\n- `firecrawl map <url>` -- Discover all URLs on the site";
|
|
13
|
-
export declare const SUBAGENT_INSTRUCTIONS = "**IMPORTANT:** When spawning agents with the Agent tool:\n- Use `subagent_type: \"general-purpose\"` for each agent\n- Give each agent a clear, specific mandate in the prompt\n- Tell each agent: \"Use ONLY firecrawl for all web access via Bash. Do not use any other tools, skills, or plugins for web access. If the CLI has issues, fall back to Firecrawl MCP tools. Run `firecrawl --help` first.\"\n- Launch ALL agents in a SINGLE message (parallel, not sequential)\n- Each agent should return structured findings with source URLs";
|
|
14
|
-
/** Join non-empty parts into a message string. */
|
|
15
|
-
export declare function buildMessage(parts: string[]): string;
|
|
16
|
-
export declare function askPermissionMode(backend: Backend): Promise<boolean>;
|
|
17
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/experimental/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,YAAY,CAAC;AAIpD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,IAAI,GAAG,MAQlD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC1B,OAAO,MAAM,MACb,OAAO,MAAM,KAAG,IAAI,GAAG,MACsB,CAAC;AAIjD,0CAA0C;AAC1C,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAItD;AAID,eAAO,MAAM,qBAAqB,q3BAYkC,CAAC;AAErE,eAAO,MAAM,cAAc,ooDA+BgC,CAAC;AAE5D,eAAO,MAAM,qBAAqB,shBAK8B,CAAC;AAIjE,kDAAkD;AAClD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEpD;AAID,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAwB1E"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Shared constants and helpers for AI workflows.
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.SUBAGENT_INSTRUCTIONS = exports.QA_TOOLS_BLOCK = exports.FIRECRAWL_TOOLS_BLOCK = exports.validateRequired = exports.validateUrl = void 0;
|
|
40
|
-
exports.normalizeUrl = normalizeUrl;
|
|
41
|
-
exports.normalizeSource = normalizeSource;
|
|
42
|
-
exports.buildMessage = buildMessage;
|
|
43
|
-
exports.askPermissionMode = askPermissionMode;
|
|
44
|
-
const backends_1 = require("./backends");
|
|
45
|
-
// ─── Validators ─────────────────────────────────────────────────────────────
|
|
46
|
-
const validateUrl = (value) => {
|
|
47
|
-
if (!value.trim())
|
|
48
|
-
return 'URL is required';
|
|
49
|
-
try {
|
|
50
|
-
new URL(value.startsWith('http') ? value : `https://${value}`);
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
return 'Please enter a valid URL';
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
exports.validateUrl = validateUrl;
|
|
58
|
-
const validateRequired = (label) => (value) => value.trim() ? true : `${label} is required`;
|
|
59
|
-
exports.validateRequired = validateRequired;
|
|
60
|
-
// ─── URL helpers ────────────────────────────────────────────────────────────
|
|
61
|
-
/** Ensure a URL has a protocol prefix. */
|
|
62
|
-
function normalizeUrl(url) {
|
|
63
|
-
return url.startsWith('http') ? url : `https://${url}`;
|
|
64
|
-
}
|
|
65
|
-
/** Normalize a source that might be a URL or a plain topic string. */
|
|
66
|
-
function normalizeSource(source) {
|
|
67
|
-
if (source.startsWith('http'))
|
|
68
|
-
return source;
|
|
69
|
-
if (/\.\w{2,}/.test(source))
|
|
70
|
-
return `https://${source}`;
|
|
71
|
-
return source;
|
|
72
|
-
}
|
|
73
|
-
// ─── Prompt blocks ──────────────────────────────────────────────────────────
|
|
74
|
-
exports.FIRECRAWL_TOOLS_BLOCK = `## Your Tools -- READ THIS FIRST
|
|
75
|
-
|
|
76
|
-
Use ONLY \`firecrawl\` for ALL web operations. It is already installed and authenticated. Run firecrawl commands via Bash. Do not use any other tools, skills, plugins, or built-in web features for web access -- only \`firecrawl\`. If the CLI has issues, you may fall back to Firecrawl MCP tools if available.
|
|
77
|
-
|
|
78
|
-
**First step: run \`firecrawl --help\` to see all available commands.** Then run \`firecrawl <command> --help\` for any command you plan to use heavily.
|
|
79
|
-
|
|
80
|
-
Quick reference:
|
|
81
|
-
- \`firecrawl search "<query>"\` -- Search the web
|
|
82
|
-
- \`firecrawl scrape <url>\` -- Scrape a page as markdown
|
|
83
|
-
- \`firecrawl map <url>\` -- Discover all URLs on a site
|
|
84
|
-
- \`firecrawl crawl <url>\` -- Crawl an entire site
|
|
85
|
-
- \`firecrawl interact "Click the login button"\` -- Interact with a scraped page
|
|
86
|
-
- \`firecrawl agent "<prompt>"\` -- AI agent for complex extraction`;
|
|
87
|
-
exports.QA_TOOLS_BLOCK = `## Your Tools -- READ THIS FIRST
|
|
88
|
-
|
|
89
|
-
Use ONLY \`firecrawl\` for ALL web operations. It is already installed and authenticated. Run firecrawl commands via Bash. Do not use any other tools, skills, plugins, or built-in web features for web access -- only \`firecrawl\`. If the CLI has issues, you may fall back to Firecrawl MCP tools if available.
|
|
90
|
-
|
|
91
|
-
**First step: run \`firecrawl --help\` to see all available commands.** Tell each subagent to do the same.
|
|
92
|
-
|
|
93
|
-
## IMPORTANT: Launch Browser with Live View FIRST
|
|
94
|
-
|
|
95
|
-
Before doing anything else, launch a browser session with streaming enabled so the user can watch in real-time:
|
|
96
|
-
|
|
97
|
-
\`\`\`bash
|
|
98
|
-
firecrawl browser launch-session --json
|
|
99
|
-
\`\`\`
|
|
100
|
-
|
|
101
|
-
This prints a **Live View URL**. Try to open it automatically for the user:
|
|
102
|
-
|
|
103
|
-
\`\`\`bash
|
|
104
|
-
open "<liveViewUrl>" # macOS
|
|
105
|
-
xdg-open "<liveViewUrl>" # Linux
|
|
106
|
-
\`\`\`
|
|
107
|
-
|
|
108
|
-
If the \`open\` command fails or errors, just print the URL clearly so the user can copy-paste it into their browser. Either way, make sure the user sees the live view URL before you start working.
|
|
109
|
-
|
|
110
|
-
Quick reference:
|
|
111
|
-
- \`firecrawl browser "open <url>"\` -- Navigate to a URL in a cloud browser
|
|
112
|
-
- \`firecrawl browser "snapshot"\` -- Get the current page state (accessibility tree)
|
|
113
|
-
- \`firecrawl browser "click @<ref>"\` -- Click an element by its reference ID
|
|
114
|
-
- \`firecrawl browser "type @<ref> <text>"\` -- Type text into an input
|
|
115
|
-
- \`firecrawl browser "scrape"\` -- Get the full page content as markdown
|
|
116
|
-
- \`firecrawl browser "scroll down"\` / \`"scroll up"\` -- Scroll the page
|
|
117
|
-
- \`firecrawl scrape <url>\` -- Quick scrape without browser session
|
|
118
|
-
- \`firecrawl map <url>\` -- Discover all URLs on the site`;
|
|
119
|
-
exports.SUBAGENT_INSTRUCTIONS = `**IMPORTANT:** When spawning agents with the Agent tool:
|
|
120
|
-
- Use \`subagent_type: "general-purpose"\` for each agent
|
|
121
|
-
- Give each agent a clear, specific mandate in the prompt
|
|
122
|
-
- Tell each agent: "Use ONLY firecrawl for all web access via Bash. Do not use any other tools, skills, or plugins for web access. If the CLI has issues, fall back to Firecrawl MCP tools. Run \`firecrawl --help\` first."
|
|
123
|
-
- Launch ALL agents in a SINGLE message (parallel, not sequential)
|
|
124
|
-
- Each agent should return structured findings with source URLs`;
|
|
125
|
-
// ─── Message builder ────────────────────────────────────────────────────────
|
|
126
|
-
/** Join non-empty parts into a message string. */
|
|
127
|
-
function buildMessage(parts) {
|
|
128
|
-
return parts.filter(Boolean).join('. ') + '.';
|
|
129
|
-
}
|
|
130
|
-
// ─── Permission helper ──────────────────────────────────────────────────────
|
|
131
|
-
async function askPermissionMode(backend) {
|
|
132
|
-
const { select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
133
|
-
const config = backends_1.BACKENDS[backend];
|
|
134
|
-
const skipLabel = backend === 'codex' ? '--full-auto' : '--dangerously-skip-permissions';
|
|
135
|
-
const mode = await select({
|
|
136
|
-
message: 'How should the agent handle tool permissions?',
|
|
137
|
-
choices: [
|
|
138
|
-
{
|
|
139
|
-
name: 'Auto-approve all (recommended)',
|
|
140
|
-
value: 'skip',
|
|
141
|
-
description: `Runs fully autonomous, no manual approvals. Uses ${skipLabel}.`,
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
name: 'Ask me each time',
|
|
145
|
-
value: 'ask',
|
|
146
|
-
description: `${config.displayName} will prompt before running each tool (slower but more control).`,
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
});
|
|
150
|
-
return mode === 'skip';
|
|
151
|
-
}
|
|
152
|
-
//# sourceMappingURL=shared.js.map
|
|
@@ -1 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AE,CAAC;IACxD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,+EAA+E;AAElE,QAAA,qBAAqB,GAAG;;;;;;;;;;;;oEAY+B,CAAC;AAExD,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2DA+B6B,CAAC;AAE/C,QAAA,qBAAqB,GAAG;;;;;gEAK2B,CAAC;AAEjE,+EAA+E;AAE/E,kDAAkD;AAClD,SAAgB,YAAY,CAAC,KAAe;IAC1C,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AAChD,CAAC;AAED,+EAA+E;AAExE,KAAK,UAAU,iBAAiB,CAAC,OAAgB;IACtD,MAAM,EAAE,MAAM,EAAE,GAAG,wDAAa,mBAAmB,GAAC,CAAC;IACrD,MAAM,MAAM,GAAG,mBAAQ,CAAC,OAAO,CAAC,CAAC;IAEjC,MAAM,SAAS,GACb,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gCAAgC,CAAC;IAEzE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC;QACxB,OAAO,EAAE,+CAA+C;QACxD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,gCAAgC;gBACtC,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE,oDAAoD,SAAS,GAAG;aAC9E;YACD;gBACE,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,GAAG,MAAM,CAAC,WAAW,kEAAkE;aACrG;SACF;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,KAAK,MAAM,CAAC;AACzB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow: Company Directories
|
|
3
|
-
*
|
|
4
|
-
* Browses startup directories (YC, Crunchbase, Product Hunt, etc.), applies
|
|
5
|
-
* filters, paginates through results, and builds targeted company lists
|
|
6
|
-
* with structured data for outreach, research, or CRM import.
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from 'commander';
|
|
9
|
-
import { type Backend } from '../backends';
|
|
10
|
-
export declare function register(parentCmd: Command, backend: Backend): void;
|
|
11
|
-
//# sourceMappingURL=company-directories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"company-directories.d.ts","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/company-directories.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,aAAa,CAAC;AAgNlE,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAsCnE"}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Workflow: Company Directories
|
|
4
|
-
*
|
|
5
|
-
* Browses startup directories (YC, Crunchbase, Product Hunt, etc.), applies
|
|
6
|
-
* filters, paginates through results, and builds targeted company lists
|
|
7
|
-
* with structured data for outreach, research, or CRM import.
|
|
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?.directory) {
|
|
49
|
-
return {
|
|
50
|
-
directory: prefill.directory,
|
|
51
|
-
filters: '',
|
|
52
|
-
maxResults: '50',
|
|
53
|
-
output: 'json',
|
|
54
|
-
context: '',
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const { input, select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
58
|
-
const directory = await select({
|
|
59
|
-
message: 'Which directory do you want to scrape?',
|
|
60
|
-
choices: [
|
|
61
|
-
{ name: 'Y Combinator (ycombinator.com/companies)', value: 'yc' },
|
|
62
|
-
{ name: 'Crunchbase', value: 'crunchbase' },
|
|
63
|
-
{ name: 'Product Hunt', value: 'producthunt' },
|
|
64
|
-
{ name: 'G2', value: 'g2' },
|
|
65
|
-
{ name: 'Custom URL', value: 'custom' },
|
|
66
|
-
],
|
|
67
|
-
});
|
|
68
|
-
let directoryValue = directory;
|
|
69
|
-
if (directory === 'custom') {
|
|
70
|
-
directoryValue = await input({
|
|
71
|
-
message: 'Enter the directory URL:',
|
|
72
|
-
validate: (0, shared_1.validateRequired)('URL'),
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const filters = await input({
|
|
76
|
-
message: 'What filters should the agent apply? (e.g., "Series A, B2B SaaS, founded 2023+")',
|
|
77
|
-
default: '',
|
|
78
|
-
});
|
|
79
|
-
const maxResults = await input({
|
|
80
|
-
message: 'How many companies to extract?',
|
|
81
|
-
default: '50',
|
|
82
|
-
});
|
|
83
|
-
const output = await select({
|
|
84
|
-
message: 'Output format?',
|
|
85
|
-
choices: [
|
|
86
|
-
{ name: 'JSON (structured, CRM-ready)', value: 'json' },
|
|
87
|
-
{ name: 'CSV (spreadsheet-ready)', value: 'csv' },
|
|
88
|
-
{ name: 'Print to terminal', value: 'terminal' },
|
|
89
|
-
],
|
|
90
|
-
});
|
|
91
|
-
const context = await input({
|
|
92
|
-
message: 'Any other criteria? (e.g., "only companies with pricing pages", "must have API")',
|
|
93
|
-
default: '',
|
|
94
|
-
});
|
|
95
|
-
return {
|
|
96
|
-
directory: directoryValue,
|
|
97
|
-
filters,
|
|
98
|
-
maxResults,
|
|
99
|
-
output,
|
|
100
|
-
context,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
// ─── System prompt ──────────────────────────────────────────────────────────
|
|
104
|
-
function buildSystemPrompt(opts) {
|
|
105
|
-
const directoryUrls = {
|
|
106
|
-
yc: 'https://www.ycombinator.com/companies',
|
|
107
|
-
crunchbase: 'https://www.crunchbase.com/discover/organization.companies',
|
|
108
|
-
producthunt: 'https://www.producthunt.com',
|
|
109
|
-
g2: 'https://www.g2.com/categories',
|
|
110
|
-
};
|
|
111
|
-
const startUrl = directoryUrls[opts.directory] || opts.directory;
|
|
112
|
-
const outputInstructions = {
|
|
113
|
-
terminal: 'Print the full company list to the terminal as a formatted markdown table.',
|
|
114
|
-
json: `Save the results to \`company-list.json\` in the current directory. Tell the user the file path when done.
|
|
115
|
-
|
|
116
|
-
Use this schema:
|
|
117
|
-
\`\`\`json
|
|
118
|
-
{
|
|
119
|
-
"source": "string (directory name)",
|
|
120
|
-
"filters": "string (filters applied)",
|
|
121
|
-
"extractedAt": "ISO-8601",
|
|
122
|
-
"totalResults": 0,
|
|
123
|
-
"companies": [
|
|
124
|
-
{
|
|
125
|
-
"name": "string",
|
|
126
|
-
"url": "string",
|
|
127
|
-
"description": "string",
|
|
128
|
-
"industry": "string",
|
|
129
|
-
"stage": "string (e.g. Seed, Series A)",
|
|
130
|
-
"founded": "string",
|
|
131
|
-
"location": "string",
|
|
132
|
-
"teamSize": "string",
|
|
133
|
-
"funding": "string",
|
|
134
|
-
"tags": ["string"],
|
|
135
|
-
"profileUrl": "string (directory listing URL)",
|
|
136
|
-
"websiteUrl": "string (company website)"
|
|
137
|
-
}
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
\`\`\``,
|
|
141
|
-
csv: `Save the results to \`company-list.csv\` in the current directory with columns: name, url, description, industry, stage, founded, location, teamSize, funding, tags, profileUrl, websiteUrl. Tell the user the file path when done.`,
|
|
142
|
-
};
|
|
143
|
-
return `You are a company directory scraping agent powered by Firecrawl. You use a real cloud browser to navigate startup directories, apply filters, paginate through results, and extract structured company data.
|
|
144
|
-
|
|
145
|
-
## STEP 1: Launch Browser and Open Live View
|
|
146
|
-
|
|
147
|
-
Before anything else, launch a browser session so the user can watch:
|
|
148
|
-
|
|
149
|
-
\`\`\`bash
|
|
150
|
-
firecrawl browser launch-session --json
|
|
151
|
-
\`\`\`
|
|
152
|
-
|
|
153
|
-
Extract the \`interactiveLiveViewUrl\` from the JSON output and open it (NOT the regular \`liveViewUrl\` -- the interactive one lets the user click and interact):
|
|
154
|
-
|
|
155
|
-
\`\`\`bash
|
|
156
|
-
open "<interactiveLiveViewUrl>" # macOS
|
|
157
|
-
xdg-open "<interactiveLiveViewUrl>" # Linux
|
|
158
|
-
\`\`\`
|
|
159
|
-
|
|
160
|
-
If the \`open\` command fails, print the URL clearly.
|
|
161
|
-
|
|
162
|
-
## STEP 2: Navigate to Directory
|
|
163
|
-
|
|
164
|
-
Open the directory:
|
|
165
|
-
\`\`\`bash
|
|
166
|
-
firecrawl browser "open ${startUrl}"
|
|
167
|
-
\`\`\`
|
|
168
|
-
|
|
169
|
-
## STEP 3: Apply Filters
|
|
170
|
-
|
|
171
|
-
Take a snapshot to see the page layout:
|
|
172
|
-
\`\`\`bash
|
|
173
|
-
firecrawl browser "snapshot"
|
|
174
|
-
\`\`\`
|
|
175
|
-
|
|
176
|
-
Look for filter controls (dropdowns, checkboxes, search fields, sidebar filters) and apply the user's requested filters by clicking and typing.
|
|
177
|
-
|
|
178
|
-
### Browser commands:
|
|
179
|
-
\`\`\`bash
|
|
180
|
-
firecrawl browser "click @<ref>"
|
|
181
|
-
firecrawl browser "type @<ref> <text>"
|
|
182
|
-
firecrawl browser "scroll down"
|
|
183
|
-
firecrawl browser "snapshot"
|
|
184
|
-
firecrawl browser "scrape"
|
|
185
|
-
\`\`\`
|
|
186
|
-
|
|
187
|
-
## STEP 4: Paginate and Extract
|
|
188
|
-
|
|
189
|
-
After applying filters:
|
|
190
|
-
|
|
191
|
-
1. **Snapshot** the results page to see company listings
|
|
192
|
-
2. **Extract** data from each visible company (name, description, tags, etc.)
|
|
193
|
-
3. **Click into** individual company profiles if the listing doesn't have enough detail
|
|
194
|
-
4. **Navigate back** and continue to the next listing
|
|
195
|
-
5. **Paginate** -- find and click "Next", "Load More", or scroll to trigger infinite scroll
|
|
196
|
-
6. Repeat until you've collected ~${opts.maxResults} companies or exhausted results
|
|
197
|
-
|
|
198
|
-
### Pagination tips:
|
|
199
|
-
- Look for "Next" / ">" buttons, page number links, or "Load More"
|
|
200
|
-
- Some directories use infinite scroll -- keep scrolling down and snapshotting
|
|
201
|
-
- Track how many companies you've extracted to know when to stop
|
|
202
|
-
- If a page loads slowly, wait a moment and snapshot again
|
|
203
|
-
|
|
204
|
-
## Output Format
|
|
205
|
-
|
|
206
|
-
${outputInstructions[opts.output]}
|
|
207
|
-
|
|
208
|
-
## Quality Guidelines
|
|
209
|
-
|
|
210
|
-
- Extract real data from the page, don't infer or guess
|
|
211
|
-
- If a field isn't visible, leave it empty rather than fabricating
|
|
212
|
-
- Deduplicate companies (same company might appear in multiple pages)
|
|
213
|
-
- For each company, try to get at minimum: name, description, and URL
|
|
214
|
-
|
|
215
|
-
Do everything sequentially. Start immediately.`;
|
|
216
|
-
}
|
|
217
|
-
// ─── Command registration ───────────────────────────────────────────────────
|
|
218
|
-
function register(parentCmd, backend) {
|
|
219
|
-
const config = backends_1.BACKENDS[backend];
|
|
220
|
-
parentCmd
|
|
221
|
-
.command('company-directories')
|
|
222
|
-
.description('Scrape startup directories (YC, Crunchbase, etc.) into structured lists')
|
|
223
|
-
.argument('[query...]', 'Directory name or filters to apply')
|
|
224
|
-
.option('-y, --yes', 'Auto-approve all tool permissions')
|
|
225
|
-
.action(async (queryParts, options) => {
|
|
226
|
-
const prefillDir = queryParts.length > 0 ? queryParts.join(' ') : undefined;
|
|
227
|
-
const inputs = await gatherInputs(prefillDir ? { directory: prefillDir } : undefined);
|
|
228
|
-
const parts = [`Scrape directory: ${inputs.directory}`];
|
|
229
|
-
if (inputs.filters)
|
|
230
|
-
parts.push(`Filters: ${inputs.filters}`);
|
|
231
|
-
if (inputs.maxResults)
|
|
232
|
-
parts.push(`Extract up to ${inputs.maxResults} companies`);
|
|
233
|
-
if (inputs.context)
|
|
234
|
-
parts.push(inputs.context);
|
|
235
|
-
const userMessage = parts.join('. ') + '.';
|
|
236
|
-
const skipPermissions = true;
|
|
237
|
-
console.log(`\nLaunching ${config.displayName}...\n`);
|
|
238
|
-
(0, backends_1.launchAgent)(backend, buildSystemPrompt({
|
|
239
|
-
directory: inputs.directory,
|
|
240
|
-
output: inputs.output,
|
|
241
|
-
maxResults: inputs.maxResults,
|
|
242
|
-
}), userMessage, skipPermissions);
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
//# sourceMappingURL=company-directories.js.map
|