firecrawl-cli 1.9.4 → 1.9.5
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 +129 -0
- package/dist/commands/browser.d.ts.map +1 -1
- package/dist/commands/browser.js +3 -2
- package/dist/commands/browser.js.map +1 -1
- package/dist/commands/experimental/backends.d.ts +19 -0
- package/dist/commands/experimental/backends.d.ts.map +1 -0
- package/dist/commands/experimental/backends.js +74 -0
- package/dist/commands/experimental/backends.js.map +1 -0
- package/dist/commands/experimental/index.d.ts +13 -0
- package/dist/commands/experimental/index.d.ts.map +1 -0
- package/dist/commands/experimental/index.js +227 -0
- package/dist/commands/experimental/index.js.map +1 -0
- package/dist/commands/experimental/shared.d.ts +17 -0
- package/dist/commands/experimental/shared.d.ts.map +1 -0
- package/dist/commands/experimental/shared.js +154 -0
- package/dist/commands/experimental/shared.js.map +1 -0
- package/dist/commands/experimental/workflows/competitor-analysis.d.ts +10 -0
- package/dist/commands/experimental/workflows/competitor-analysis.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/competitor-analysis.js +196 -0
- package/dist/commands/experimental/workflows/competitor-analysis.js.map +1 -0
- package/dist/commands/experimental/workflows/deep-research.d.ts +11 -0
- package/dist/commands/experimental/workflows/deep-research.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/deep-research.js +159 -0
- package/dist/commands/experimental/workflows/deep-research.js.map +1 -0
- package/dist/commands/experimental/workflows/demo.d.ts +11 -0
- package/dist/commands/experimental/workflows/demo.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/demo.js +190 -0
- package/dist/commands/experimental/workflows/demo.js.map +1 -0
- package/dist/commands/experimental/workflows/knowledge-base.d.ts +11 -0
- package/dist/commands/experimental/workflows/knowledge-base.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/knowledge-base.js +319 -0
- package/dist/commands/experimental/workflows/knowledge-base.js.map +1 -0
- package/dist/commands/experimental/workflows/lead-research.d.ts +11 -0
- package/dist/commands/experimental/workflows/lead-research.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/lead-research.js +146 -0
- package/dist/commands/experimental/workflows/lead-research.js.map +1 -0
- package/dist/commands/experimental/workflows/qa.d.ts +11 -0
- package/dist/commands/experimental/workflows/qa.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/qa.js +184 -0
- package/dist/commands/experimental/workflows/qa.js.map +1 -0
- package/dist/commands/experimental/workflows/research-papers.d.ts +11 -0
- package/dist/commands/experimental/workflows/research-papers.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/research-papers.js +151 -0
- package/dist/commands/experimental/workflows/research-papers.js.map +1 -0
- package/dist/commands/experimental/workflows/seo-audit.d.ts +11 -0
- package/dist/commands/experimental/workflows/seo-audit.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/seo-audit.js +155 -0
- package/dist/commands/experimental/workflows/seo-audit.js.map +1 -0
- package/dist/commands/experimental/workflows/shop.d.ts +11 -0
- package/dist/commands/experimental/workflows/shop.d.ts.map +1 -0
- package/dist/commands/experimental/workflows/shop.js +158 -0
- package/dist/commands/experimental/workflows/shop.js.map +1 -0
- package/dist/commands/init.d.ts +11 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +474 -36
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +18 -0
- package/dist/commands/login.js.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Workflow: SEO Audit
|
|
4
|
+
*
|
|
5
|
+
* Maps the site, then spawns parallel agents for site structure, on-page SEO,
|
|
6
|
+
* and keyword/competitor analysis. Produces a prioritized audit with specific
|
|
7
|
+
* (not generic) recommendations.
|
|
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
|
+
const { input, select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
49
|
+
const rawUrl = prefill?.url ||
|
|
50
|
+
(await input({
|
|
51
|
+
message: 'What site do you want to audit?',
|
|
52
|
+
validate: shared_1.validateUrl,
|
|
53
|
+
}));
|
|
54
|
+
const keywords = await input({
|
|
55
|
+
message: 'Target keywords? (comma-separated, leave blank to auto-detect)',
|
|
56
|
+
default: '',
|
|
57
|
+
});
|
|
58
|
+
const output = await select({
|
|
59
|
+
message: 'How should the audit be delivered?',
|
|
60
|
+
choices: [
|
|
61
|
+
{ name: 'Print to terminal', value: 'terminal' },
|
|
62
|
+
{ name: 'Save as Markdown file', value: 'markdown' },
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
return { url: (0, shared_1.normalizeUrl)(rawUrl), keywords, output };
|
|
66
|
+
}
|
|
67
|
+
// ─── System prompt ──────────────────────────────────────────────────────────
|
|
68
|
+
function buildSystemPrompt(opts) {
|
|
69
|
+
const outputInstructions = opts.output === 'markdown'
|
|
70
|
+
? 'Save the audit to a file called `seo-audit.md` in the current directory. Tell the user the file path when done.'
|
|
71
|
+
: 'Print the full audit to the terminal in well-formatted markdown.';
|
|
72
|
+
return `You are an SEO audit team lead powered by Firecrawl. You orchestrate parallel agents to thoroughly audit a website's search engine optimization.
|
|
73
|
+
|
|
74
|
+
${shared_1.FIRECRAWL_TOOLS_BLOCK}
|
|
75
|
+
|
|
76
|
+
## Your Strategy
|
|
77
|
+
|
|
78
|
+
You are a **team lead**, not a solo auditor. Your job is to:
|
|
79
|
+
|
|
80
|
+
1. **Map the site first** -- Run \`firecrawl map\` yourself to discover all pages and understand the site structure.
|
|
81
|
+
2. **Spawn parallel subagents** -- Launch agents to audit different aspects simultaneously.
|
|
82
|
+
3. **Collect results** -- Each agent reports back findings.
|
|
83
|
+
4. **Synthesize** -- Build the prioritized audit with specific recommendations.
|
|
84
|
+
|
|
85
|
+
## Agent Assignments
|
|
86
|
+
|
|
87
|
+
Spawn these agents in parallel:
|
|
88
|
+
1. **Site Structure Agent** -- Analyze URL structure, check sitemap.xml, evaluate internal linking patterns. Use the sitemap from the map step. Check for orphan pages, redirect chains, broken internal links.
|
|
89
|
+
2. **On-Page SEO Agent** -- Scrape key pages (homepage, top product/service pages, blog, about). For each page: check title tag, meta description, heading hierarchy (H1/H2/H3), content length, image alt tags, schema markup.
|
|
90
|
+
3. **Keyword & Competitor Agent** -- Search for the site's target keywords. Find who's ranking above them. Scrape top competitors' pages and compare their on-page SEO tactics (titles, headings, content structure, meta).
|
|
91
|
+
|
|
92
|
+
${shared_1.SUBAGENT_INSTRUCTIONS}
|
|
93
|
+
|
|
94
|
+
## Output Format
|
|
95
|
+
|
|
96
|
+
${outputInstructions}
|
|
97
|
+
|
|
98
|
+
Structure the audit as:
|
|
99
|
+
|
|
100
|
+
### Site Structure
|
|
101
|
+
- Total pages found
|
|
102
|
+
- URL structure quality
|
|
103
|
+
- Sitemap health
|
|
104
|
+
|
|
105
|
+
### On-Page SEO
|
|
106
|
+
For each key page:
|
|
107
|
+
- Title tag, meta description
|
|
108
|
+
- Heading hierarchy (H1, H2, etc.)
|
|
109
|
+
- Content length and quality
|
|
110
|
+
- Internal linking
|
|
111
|
+
|
|
112
|
+
### Keyword Analysis
|
|
113
|
+
- Current keyword targeting
|
|
114
|
+
- Missing keyword opportunities
|
|
115
|
+
- Competitor keyword comparison
|
|
116
|
+
|
|
117
|
+
### Technical Issues
|
|
118
|
+
- Broken links, redirects
|
|
119
|
+
- Missing meta tags
|
|
120
|
+
- Duplicate content concerns
|
|
121
|
+
|
|
122
|
+
### Competitor Comparison
|
|
123
|
+
Who's outranking them and why.
|
|
124
|
+
|
|
125
|
+
### Recommendations
|
|
126
|
+
Prioritized list of fixes (high/medium/low impact).
|
|
127
|
+
|
|
128
|
+
### Sources
|
|
129
|
+
Every URL scraped.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
Be specific with recommendations. Don't just say "improve meta descriptions" -- say exactly what to change.
|
|
134
|
+
|
|
135
|
+
Start working immediately.`;
|
|
136
|
+
}
|
|
137
|
+
// ─── Command registration ───────────────────────────────────────────────────
|
|
138
|
+
function register(parentCmd, backend) {
|
|
139
|
+
const config = backends_1.BACKENDS[backend];
|
|
140
|
+
parentCmd
|
|
141
|
+
.command('seo-audit')
|
|
142
|
+
.description('Run an SEO audit on a website')
|
|
143
|
+
.argument('[url]', 'URL to audit')
|
|
144
|
+
.option('-y, --yes', 'Auto-approve all tool permissions')
|
|
145
|
+
.action(async (url, options) => {
|
|
146
|
+
const inputs = await gatherInputs(url ? { url } : undefined);
|
|
147
|
+
const skipPermissions = options.yes || (await (0, shared_1.askPermissionMode)(backend));
|
|
148
|
+
console.log(`\nLaunching ${config.displayName}...\n`);
|
|
149
|
+
(0, backends_1.launchAgent)(backend, buildSystemPrompt({ output: inputs.output }), (0, shared_1.buildMessage)([
|
|
150
|
+
`Audit ${inputs.url}`,
|
|
151
|
+
inputs.keywords && `Target keywords: ${inputs.keywords}`,
|
|
152
|
+
]), skipPermissions);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=seo-audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seo-audit.js","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/seo-audit.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HH,4BAwBC;AAlJD,0CAAkE;AAClE,sCAOmB;AAUnB,+EAA+E;AAE/E,KAAK,UAAU,YAAY,CAAC,OAA0B;IACpD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,wDAAa,mBAAmB,GAAC,CAAC;IAE5D,MAAM,MAAM,GACV,OAAO,EAAE,GAAG;QACZ,CAAC,MAAM,KAAK,CAAC;YACX,OAAO,EAAE,iCAAiC;YAC1C,QAAQ,EAAE,oBAAW;SACtB,CAAC,CAAC,CAAC;IAEN,MAAM,QAAQ,GAAG,MAAM,KAAK,CAA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AAO,CAAC,GAAG,IAAI,CAAC,MAAM,IAAA,0BAAiB,EAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,WAAW,OAAO,CAAC,CAAC;QAEtD,IAAA,sBAAW,EACT,OAAO,EACP,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,EAC5C,IAAA,qBAAY,EAAC;YACX,SAAS,MAAM,CAAC,GAAG,EAAE;YACrB,MAAM,CAAC,QAAQ,IAAI,oBAAoB,MAAM,CAAC,QAAQ,EAAE;SACzD,CAAC,EACF,eAAe,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow: Shop
|
|
3
|
+
*
|
|
4
|
+
* Researches a product across the web (reviews, Reddit, Wirecutter, etc.),
|
|
5
|
+
* finds the best option, then uses a saved Amazon browser profile to
|
|
6
|
+
* add it to cart. Demonstrates persistent browser profiles in action.
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
import { type Backend } from '../backends';
|
|
10
|
+
export declare function register(parentCmd: Command, backend: Backend): void;
|
|
11
|
+
//# sourceMappingURL=shop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shop.d.ts","sourceRoot":"","sources":["../../../../src/commands/experimental/workflows/shop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,OAAO,EAAyB,MAAM,aAAa,CAAC;AAkHlE,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CA4BnE"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Workflow: Shop
|
|
4
|
+
*
|
|
5
|
+
* Researches a product across the web (reviews, Reddit, Wirecutter, etc.),
|
|
6
|
+
* finds the best option, then uses a saved Amazon browser profile to
|
|
7
|
+
* add it to cart. Demonstrates persistent browser profiles in action.
|
|
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 query is prefilled, skip interactive prompts entirely
|
|
49
|
+
if (prefill?.query) {
|
|
50
|
+
return { query: prefill.query, budget: '', sites: '', context: '' };
|
|
51
|
+
}
|
|
52
|
+
const { input } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
53
|
+
const query = await input({
|
|
54
|
+
message: 'What are you looking to buy?',
|
|
55
|
+
validate: (0, shared_1.validateRequired)('Product'),
|
|
56
|
+
});
|
|
57
|
+
const budget = await input({
|
|
58
|
+
message: 'Budget? (leave blank for no limit)',
|
|
59
|
+
default: '',
|
|
60
|
+
});
|
|
61
|
+
const sites = await input({
|
|
62
|
+
message: 'Preferred site(s)? (e.g. amazon, bestbuy, newegg -- leave blank for any)',
|
|
63
|
+
default: '',
|
|
64
|
+
});
|
|
65
|
+
const context = await input({
|
|
66
|
+
message: 'Any other preferences? (brand, features, delivery location, etc.)',
|
|
67
|
+
default: '',
|
|
68
|
+
});
|
|
69
|
+
return { query, budget, sites, context };
|
|
70
|
+
}
|
|
71
|
+
// ─── System prompt ──────────────────────────────────────────────────────────
|
|
72
|
+
function buildSystemPrompt() {
|
|
73
|
+
return `You are a personal shopping assistant powered by Firecrawl. You research products across the web, find the best deal, and then use the user's saved Amazon browser profile to add it to their cart.
|
|
74
|
+
|
|
75
|
+
${shared_1.QA_TOOLS_BLOCK}
|
|
76
|
+
|
|
77
|
+
## Browser Profiles (IMPORTANT -- read carefully)
|
|
78
|
+
|
|
79
|
+
A browser profile is NOT a session. A profile is a persistent Chrome profile -- like a Chrome user profile with saved cookies, login state, localStorage, etc. It survives across sessions.
|
|
80
|
+
|
|
81
|
+
The user has a profile called "amazon". If it's not already logged in, log in with:
|
|
82
|
+
- Email: jonathan@sideguide.dev
|
|
83
|
+
- Password: FirecrawlDemo123!
|
|
84
|
+
|
|
85
|
+
To use the profile:
|
|
86
|
+
|
|
87
|
+
\`\`\`bash
|
|
88
|
+
# Connect to the amazon profile -- this creates a NEW session using the saved Chrome profile data
|
|
89
|
+
firecrawl browser "open https://www.amazon.com" --profile amazon
|
|
90
|
+
|
|
91
|
+
# Now you're logged in. Use normal browser commands (no --profile needed after the first open):
|
|
92
|
+
firecrawl browser "snapshot"
|
|
93
|
+
firecrawl browser "click @<ref>"
|
|
94
|
+
firecrawl browser "type @<ref> <text>"
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
DO NOT run \`firecrawl browser list\` to look for sessions. The profile exists independently of sessions. Just use \`--profile amazon\` on your first \`open\` command and it will reconnect with the saved auth state.
|
|
98
|
+
|
|
99
|
+
## Your Strategy
|
|
100
|
+
|
|
101
|
+
Do everything sequentially -- do NOT spawn parallel subagents. Work through each step yourself, one at a time.
|
|
102
|
+
|
|
103
|
+
### Phase 1: Research (use firecrawl scrape/search)
|
|
104
|
+
1. Search the web for the product -- reviews, comparisons, Reddit threads, Wirecutter, tech blogs
|
|
105
|
+
2. Scrape the top results to understand specs, pros/cons, and pricing
|
|
106
|
+
3. Pick the best option based on value, reviews, and the user's requirements
|
|
107
|
+
|
|
108
|
+
### Phase 2: Buy (use firecrawl browser)
|
|
109
|
+
1. Open Amazon with the saved profile: \`firecrawl browser "open https://www.amazon.com" --profile amazon\`
|
|
110
|
+
2. For each item:
|
|
111
|
+
a. Search for it on Amazon
|
|
112
|
+
b. Find the exact listing (match model, specs, seller)
|
|
113
|
+
c. Set the correct quantity if the user specified one
|
|
114
|
+
d. Add to cart
|
|
115
|
+
3. After all items are added, go to the cart and take a snapshot to confirm everything is there
|
|
116
|
+
|
|
117
|
+
If the user asks for multiple different products, handle them all. If they specify quantities (e.g., "5 mac minis"), set the quantity on Amazon before adding to cart.
|
|
118
|
+
|
|
119
|
+
## Output
|
|
120
|
+
|
|
121
|
+
Print a summary to the terminal:
|
|
122
|
+
|
|
123
|
+
### Research Summary
|
|
124
|
+
- What you searched for and top sources consulted
|
|
125
|
+
- For each product: top options compared, your pick, and why
|
|
126
|
+
|
|
127
|
+
### Amazon Cart
|
|
128
|
+
- Every item added (name, quantity, price, seller)
|
|
129
|
+
- Total estimated cost
|
|
130
|
+
- Cart confirmation
|
|
131
|
+
|
|
132
|
+
Be specific with product names, model numbers, and prices. Start immediately.`;
|
|
133
|
+
}
|
|
134
|
+
// ─── Command registration ───────────────────────────────────────────────────
|
|
135
|
+
function register(parentCmd, backend) {
|
|
136
|
+
const config = backends_1.BACKENDS[backend];
|
|
137
|
+
parentCmd
|
|
138
|
+
.command('shop')
|
|
139
|
+
.description('Research products across the web, then buy using your saved Amazon session')
|
|
140
|
+
.argument('[query...]', 'What to shop for')
|
|
141
|
+
.option('-y, --yes', 'Auto-approve all tool permissions')
|
|
142
|
+
.action(async (queryParts, options) => {
|
|
143
|
+
const prefillQuery = queryParts.length > 0 ? queryParts.join(' ') : undefined;
|
|
144
|
+
const inputs = await gatherInputs(prefillQuery ? { query: prefillQuery } : undefined);
|
|
145
|
+
const parts = [inputs.query];
|
|
146
|
+
if (inputs.budget)
|
|
147
|
+
parts.push(`Budget: ${inputs.budget}`);
|
|
148
|
+
if (inputs.sites)
|
|
149
|
+
parts.push(`Shop on: ${inputs.sites}`);
|
|
150
|
+
if (inputs.context)
|
|
151
|
+
parts.push(inputs.context);
|
|
152
|
+
const userMessage = parts.join('. ') + '.';
|
|
153
|
+
const skipPermissions = true;
|
|
154
|
+
console.log(`\nLaunching ${config.displayName}...\n`);
|
|
155
|
+
(0, backends_1.launchAgent)(backend, buildSystemPrompt(), userMessage, skipPermissions);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=shop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shop.js","sourceRoot":"","sources":["../../../../src/commands/exper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
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Init command —
|
|
2
|
+
* Init command — interactive step-by-step wizard to set up Firecrawl.
|
|
3
3
|
*
|
|
4
4
|
* Usage: npx -y firecrawl-cli init
|
|
5
5
|
*/
|
|
@@ -13,6 +13,16 @@ export interface InitOptions {
|
|
|
13
13
|
skipAuth?: boolean;
|
|
14
14
|
apiKey?: string;
|
|
15
15
|
browser?: boolean;
|
|
16
|
+
template?: string;
|
|
16
17
|
}
|
|
18
|
+
interface TemplateEntry {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
path: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const TEMPLATES: TemplateEntry[];
|
|
24
|
+
export declare function findTemplate(name: string): TemplateEntry | undefined;
|
|
25
|
+
export declare function scaffoldTemplate(templatePath: string): Promise<void>;
|
|
17
26
|
export declare function handleInitCommand(options?: InitOptions): Promise<void>;
|
|
27
|
+
export {};
|
|
18
28
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAsB,iBAAiB,CACrC,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":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