diff --git a/skills/firecrawl-agent/SKILL.md b/skills/firecrawl-agent/SKILL.md index e310dfcbf..18fd81bff 100644 --- a/skills/firecrawl-agent/SKILL.md +++ b/skills/firecrawl-agent/SKILL.md @@ -53,5 +53,5 @@ firecrawl agent "get feature list" --urls "" --wait -o .firecrawl/features. ## See also - [firecrawl-scrape](../firecrawl-scrape/SKILL.md) — simpler single-page extraction -- [firecrawl-instruct](../firecrawl-instruct/SKILL.md) — scrape + interact for manual page interaction (more control) +- [firecrawl-interact](../firecrawl-interact/SKILL.md) — scrape + interact for manual page interaction (more control) - [firecrawl-crawl](../firecrawl-crawl/SKILL.md) — bulk extraction without AI diff --git a/skills/firecrawl-cli/SKILL.md b/skills/firecrawl-cli/SKILL.md index 7f719eff7..ae8918f0e 100644 --- a/skills/firecrawl-cli/SKILL.md +++ b/skills/firecrawl-cli/SKILL.md @@ -83,7 +83,7 @@ For detailed command reference, run `firecrawl --help`. - **Finding URLs on a known site** -> [firecrawl-map](../firecrawl-map/SKILL.md) - **Bulk extraction from a docs section or site** -> [firecrawl-crawl](../firecrawl-crawl/SKILL.md) - **AI-powered structured extraction from complex sites** -> [firecrawl-agent](../firecrawl-agent/SKILL.md) -- **Clicks, forms, login, pagination, or post-scrape browser actions** -> [firecrawl-instruct](../firecrawl-instruct/SKILL.md) +- **Clicks, forms, login, pagination, or post-scrape browser actions** -> [firecrawl-interact](../firecrawl-interact/SKILL.md) - **Downloading a site to local files** -> [firecrawl-download](../firecrawl-download/SKILL.md) - **Install, auth, or setup problems** -> [rules/install.md](rules/install.md) - **Output handling and safe file-reading patterns** -> [rules/security.md](rules/security.md) diff --git a/skills/firecrawl-instruct/SKILL.md b/skills/firecrawl-interact/SKILL.md similarity index 76% rename from skills/firecrawl-instruct/SKILL.md rename to skills/firecrawl-interact/SKILL.md index c5fcb6fa5..7468dd208 100644 --- a/skills/firecrawl-instruct/SKILL.md +++ b/skills/firecrawl-interact/SKILL.md @@ -1,13 +1,13 @@ --- -name: firecrawl-instruct +name: firecrawl-interact description: | - Control and interact with a live browser session on any scraped page — click buttons, fill forms, navigate flows, and extract data using natural language prompts or code. Replaces the old firecrawl-browser command. Use when the user needs to interact with a webpage beyond simple scraping: logging into a site, submitting forms, clicking through pagination, handling infinite scroll, navigating multi-step checkout or wizard flows, or when a regular scrape failed because content is behind JavaScript interaction. Also useful for authenticated scraping via profiles. Triggers on "browser", "instruct", "click", "fill out the form", "log in to", "sign in", "submit", "paginated", "next page", "infinite scroll", "interact with the page", "navigate to", "open a session", or "scrape failed". + Control and interact with a live browser session on any scraped page — click buttons, fill forms, navigate flows, and extract data using natural language prompts or code. Use when the user needs to interact with a webpage beyond simple scraping: logging into a site, submitting forms, clicking through pagination, handling infinite scroll, navigating multi-step checkout or wizard flows, or when a regular scrape failed because content is behind JavaScript interaction. Also useful for authenticated scraping via profiles. Triggers on "interact", "click", "fill out the form", "log in to", "sign in", "submit", "paginated", "next page", "infinite scroll", "interact with the page", "navigate to", "open a session", or "scrape failed". allowed-tools: - Bash(firecrawl *) - Bash(npx firecrawl *) --- -# firecrawl instruct +# firecrawl interact Interact with scraped pages in a live browser session. Scrape a page first, then use natural language prompts or code to click, fill forms, navigate, and extract data. @@ -16,8 +16,8 @@ Interact with scraped pages in a live browser session. Scrape a page first, then - Content requires interaction: clicks, form fills, pagination, login - `scrape` failed because content is behind JavaScript interaction - You need to navigate a multi-step flow -- Last resort in the [workflow escalation pattern](firecrawl-cli): search → scrape → map → crawl → **instruct** -- **Never use instruct for web searches** — use `search` instead +- Last resort in the [workflow escalation pattern](firecrawl-cli): search → scrape → map → crawl → **interact** +- **Never use interact for web searches** — use `search` instead ## Quick start @@ -78,6 +78,6 @@ firecrawl scrape "https://app.example.com" --profile my-app --no-save-changes ## See also -- [firecrawl-scrape](../firecrawl-scrape/SKILL.md) — try scrape first, escalate to instruct only when needed -- [firecrawl-search](../firecrawl-search/SKILL.md) — for web searches (never use instruct for searching) +- [firecrawl-scrape](../firecrawl-scrape/SKILL.md) — try scrape first, escalate to interact only when needed +- [firecrawl-search](../firecrawl-search/SKILL.md) — for web searches (never use interact for searching) - [firecrawl-agent](../firecrawl-agent/SKILL.md) — AI-powered extraction (less manual control) diff --git a/skills/firecrawl-scrape/SKILL.md b/skills/firecrawl-scrape/SKILL.md index bf5008d05..86b8be1f9 100644 --- a/skills/firecrawl-scrape/SKILL.md +++ b/skills/firecrawl-scrape/SKILL.md @@ -64,5 +64,5 @@ firecrawl scrape "https://example.com/pricing" --query "What is the enterprise p ## See also - [firecrawl-search](../firecrawl-search/SKILL.md) — find pages when you don't have a URL -- [firecrawl-instruct](../firecrawl-instruct/SKILL.md) — when scrape can't get the content, use `interact` to click, fill forms, etc. +- [firecrawl-interact](../firecrawl-interact/SKILL.md) — when scrape can't get the content, use `interact` to click, fill forms, etc. - [firecrawl-download](../firecrawl-download/SKILL.md) — bulk download an entire site to local files diff --git a/src/commands/experimental/index.ts b/src/commands/experimental/index.ts index ac970aa08..0d4edceeb 100644 --- a/src/commands/experimental/index.ts +++ b/src/commands/experimental/index.ts @@ -139,80 +139,12 @@ Pass -y to auto-approve all tool permissions. // ─── Passthrough (natural language fallback) ───────────────────────────────── -const BROWSER_KEYWORDS = [ - 'browser', - 'session', - 'profile', - 'click', - 'snapshot', - 'navigate', - 'login', - 'signup', - 'sign up', - 'fill', - 'form', - 'interact', - 'automate', - 'playwright', - 'cdp', - 'cloud browser', - 'cart', - 'add to cart', - 'wishlist', - 'checkout', - 'purchase', - 'buy', - 'order', - 'book', - 'reserve', - 'amazon', - 'account', -]; - -function isBrowserRelated(text: string): boolean { - const lower = text.toLowerCase(); - return BROWSER_KEYWORDS.some((kw) => lower.includes(kw)); -} - -function buildPassthroughSystemPrompt(userInput: string): string { - const browserSpecific = isBrowserRelated(userInput); - - const browserBlock = browserSpecific - ? `\n\n**Since this task involves browser interactions**, first launch a browser session with live view so the user can watch: - -\`\`\`bash -firecrawl browser launch-session --json -\`\`\` - -Show the **Live View URL** to the user immediately so they can open it and watch you work in real-time. - -Then run \`firecrawl browser --help\` to understand sessions, profiles, execute commands, and all browser capabilities. - -### Profiles (persistent Chrome profiles -- NOT sessions) - -A profile is a persistent Chrome profile (cookies, login state, localStorage). It is NOT a session -- it exists independently and survives across sessions. - -- **Use a profile:** \`firecrawl browser "open " --profile \` -- creates a new session using the saved Chrome profile data (cookies, auth, etc.) -- **DO NOT** run \`firecrawl browser list\` to look for profiles. Just use \`--profile \` directly. -- After the first \`open\` with \`--profile\`, subsequent browser commands don't need the flag. - -If the user mentions "my amazon profile" or "amazon account", just run: -\`firecrawl browser "open https://www.amazon.com" --profile amazon\` - -### Browser commands -- \`firecrawl browser "open "\` -- Navigate (auto-launches session if needed) -- \`firecrawl browser "snapshot"\` -- Get page state (accessibility tree) -- \`firecrawl browser "click @"\` -- Click an element -- \`firecrawl browser "type @ "\` -- Type into an input -- \`firecrawl browser "scrape"\` -- Get full page content as markdown -- \`firecrawl browser "scroll down"\` / \`"scroll up"\` -- Scroll` - : ''; - +function buildPassthroughSystemPrompt(_userInput: string): string { return `You are a Firecrawl power user. You have the full Firecrawl CLI at your disposal to accomplish any web task the user describes. ## First Steps -**Run \`firecrawl --help\` to see all available commands and capabilities.** This is critical -- read the output carefully before proceeding.${browserBlock} +**Run \`firecrawl --help\` to see all available commands and capabilities.** This is critical -- read the output carefully before proceeding. Then run \`firecrawl --help\` for whichever specific commands you need. @@ -226,11 +158,7 @@ Quick reference: - \`firecrawl scrape --format html\` -- Scrape as HTML - \`firecrawl map \` -- Discover all URLs on a site - \`firecrawl crawl \` -- Crawl an entire site -- \`firecrawl download \` -- Download a site into .firecrawl/ -- \`firecrawl browser "open "\` -- Cloud browser session -- \`firecrawl browser "snapshot"\` -- Get page state -- \`firecrawl browser "click @"\` -- Click an element -- \`firecrawl browser "type @ "\` -- Type into an input +- \`firecrawl interact "Click the login button"\` -- Interact with a scraped page - \`firecrawl agent ""\` -- AI agent for complex extraction ## Guidelines diff --git a/src/commands/experimental/shared.ts b/src/commands/experimental/shared.ts index 0f7a9dd75..115211708 100644 --- a/src/commands/experimental/shared.ts +++ b/src/commands/experimental/shared.ts @@ -48,16 +48,14 @@ Quick reference: - \`firecrawl scrape \` -- Scrape a page as markdown - \`firecrawl map \` -- Discover all URLs on a site - \`firecrawl crawl \` -- Crawl an entire site -- \`firecrawl browser "open "\` -- Cloud browser session -- \`firecrawl browser "snapshot"\` -- Get page state -- \`firecrawl browser "click @"\` -- Click an element -- \`firecrawl browser "type @ "\` -- Type into an input`; +- \`firecrawl interact "Click the login button"\` -- Interact with a scraped page +- \`firecrawl agent ""\` -- AI agent for complex extraction`; export const QA_TOOLS_BLOCK = `## Your Tools -- READ THIS FIRST 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. -**First step: run \`firecrawl --help\` and \`firecrawl browser --help\` to see all commands.** Tell each subagent to do the same. +**First step: run \`firecrawl --help\` to see all available commands.** Tell each subagent to do the same. ## IMPORTANT: Launch Browser with Live View FIRST diff --git a/src/index.ts b/src/index.ts index 79fbf7abf..b0a040646 100644 --- a/src/index.ts +++ b/src/index.ts @@ -326,8 +326,7 @@ function createDownloadCommand(): Command { return downloadCmd; } -// Add download command to main program -program.addCommand(createDownloadCommand()); +// download command is registered under 'experimental' below /** * Create and configure the crawl command @@ -1182,18 +1181,31 @@ Examples: return interactCmd; } -// Add crawl, map, search, agent, browser, and interact commands to main program +// Add core commands to main program program.addCommand(createCrawlCommand()); program.addCommand(createMapCommand()); program.addCommand(createSearchCommand()); program.addCommand(createAgentCommand()); -program.addCommand(createBrowserCommand()); program.addCommand(createInteractCommand()); -// Experimental: AI workflow commands -program.addCommand(createClaudeCommand()); -program.addCommand(createCodexCommand()); -program.addCommand(createOpenCodeCommand()); +// Hidden: deprecated browser command (still works, just not in --help) +program.addCommand(createBrowserCommand(), { hidden: true }); + +// Experimental: download, AI workflow commands +const experimental = new Command('experimental') + .description('Experimental commands (download, AI workflows)') + .alias('x') + .addHelpText( + 'after', + ` +Shorthand: "firecrawl x" is an alias for "firecrawl experimental". +` + ); +experimental.addCommand(createDownloadCommand()); +experimental.addCommand(createClaudeCommand()); +experimental.addCommand(createCodexCommand()); +experimental.addCommand(createOpenCodeCommand()); +program.addCommand(experimental); program .command('config')