Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/firecrawl-agent/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ firecrawl agent "get feature list" --urls "<url>" --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
2 changes: 1 addition & 1 deletion skills/firecrawl-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For detailed command reference, run `firecrawl <command> --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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion skills/firecrawl-scrape/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
78 changes: 3 additions & 75 deletions src/commands/experimental/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <url>" --profile <name>\` -- 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 <name>\` 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 <url>"\` -- Navigate (auto-launches session if needed)
- \`firecrawl browser "snapshot"\` -- Get page state (accessibility tree)
- \`firecrawl browser "click @<ref>"\` -- Click an element
- \`firecrawl browser "type @<ref> <text>"\` -- 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 <command> --help\` for whichever specific commands you need.

Expand All @@ -226,11 +158,7 @@ Quick reference:
- \`firecrawl scrape <url> --format html\` -- Scrape as HTML
- \`firecrawl map <url>\` -- Discover all URLs on a site
- \`firecrawl crawl <url>\` -- Crawl an entire site
- \`firecrawl download <url>\` -- Download a site into .firecrawl/
- \`firecrawl browser "open <url>"\` -- Cloud browser session
- \`firecrawl browser "snapshot"\` -- Get page state
- \`firecrawl browser "click @<ref>"\` -- Click an element
- \`firecrawl browser "type @<ref> <text>"\` -- Type into an input
- \`firecrawl interact "Click the login button"\` -- Interact with a scraped page
- \`firecrawl agent "<prompt>"\` -- AI agent for complex extraction

## Guidelines
Expand Down
8 changes: 3 additions & 5 deletions src/commands/experimental/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@ Quick reference:
- \`firecrawl scrape <url>\` -- Scrape a page as markdown
- \`firecrawl map <url>\` -- Discover all URLs on a site
- \`firecrawl crawl <url>\` -- Crawl an entire site
- \`firecrawl browser "open <url>"\` -- Cloud browser session
- \`firecrawl browser "snapshot"\` -- Get page state
- \`firecrawl browser "click @<ref>"\` -- Click an element
- \`firecrawl browser "type @<ref> <text>"\` -- Type into an input`;
- \`firecrawl interact "Click the login button"\` -- Interact with a scraped page
- \`firecrawl agent "<prompt>"\` -- 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

Expand Down
28 changes: 20 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down
Loading