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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"dependencies": {
"@inquirer/prompts": "^8.2.1",
"@mendable/firecrawl-js": "4.13.0",
"@mendable/firecrawl-js": "4.15.0",
"commander": "^14.0.2"
}
}
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions skills/firecrawl-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Run `firecrawl --help` or `firecrawl <command> --help` for full option details.
Must be installed and authenticated. Check with `firecrawl --status`.

```
🔥 firecrawl cli v1.4.0
🔥 firecrawl cli v1.8.0

● Authenticated via FIRECRAWL_API_KEY
Concurrency: 0/100 jobs (parallel scrape limit)
Expand Down Expand Up @@ -95,7 +95,7 @@ browser "scrape" -o .firecrawl/products-p2.md → extract page 2 content
**Example: login then scrape authenticated content**

```
browser launch-session --profile my-app → create a named persistent session
browser launch-session --profile my-app → create a named profile
browser "open https://app.example.com/login" → navigate to login
browser "snapshot -i" → find form fields
browser "fill @e3 'user@example.com'" → fill email
Expand Down Expand Up @@ -271,9 +271,9 @@ Shorthand auto-launches a session if none exists - no setup required.

Session management: `launch-session --ttl 600`, `list`, `close`

Options: `--ttl <seconds>`, `--ttl-inactivity <seconds>`, `--session <id>`, `--profile <name>`, `--write-mode <readonly|readwrite>`, `-o`
Options: `--ttl <seconds>`, `--ttl-inactivity <seconds>`, `--session <id>`, `--profile <name>`, `--no-save-changes`, `-o`

**Persistent sessions** survive close and can be reconnected by name. Use them when you need to login first, then come back later to do work while already authenticated:
**Profiles** survive close and can be reconnected by name. Use them when you need to login first, then come back later to do work while already authenticated:

```bash
# Session 1: Login and save state
Expand All @@ -296,10 +296,10 @@ firecrawl browser close
Read-only reconnect (no writes to session state):

```bash
firecrawl browser launch-session --profile my-app --write-mode readonly
firecrawl browser launch-session --profile my-app --no-save-changes
```

Shorthand with persistent session:
Shorthand with profile:

```bash
firecrawl browser --profile my-app "open https://example.com"
Expand Down
8 changes: 4 additions & 4 deletions skills/firecrawl-cli/rules/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ description: |
## Quick Setup (Recommended)

```bash
npx -y firecrawl-cli@1.7.1 init --all --browser
npx -y firecrawl-cli@1.8.0 init --all --browser
```

This installs `firecrawl-cli` globally and authenticates.

## Manual Install

```bash
npm install -g firecrawl-cli@1.7.1
npm install -g firecrawl-cli@1.8.0
```

## Verify
Expand Down Expand Up @@ -51,5 +51,5 @@ Ask the user how they'd like to authenticate:
If `firecrawl` is not found after installation:

1. Ensure npm global bin is in PATH
2. Try: `npx firecrawl-cli@1.7.1 --version`
3. Reinstall: `npm install -g firecrawl-cli@1.7.1`
2. Try: `npx firecrawl-cli@1.8.0 --version`
3. Reinstall: `npm install -g firecrawl-cli@1.8.0`
12 changes: 6 additions & 6 deletions src/commands/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface BrowserLaunchOptions {
ttl?: number;
ttlInactivity?: number;
profile?: string;
writeMode?: 'readonly' | 'readwrite';
saveChanges?: boolean;
apiKey?: string;
apiUrl?: string;
output?: string;
Expand Down Expand Up @@ -53,7 +53,7 @@ export interface BrowserCloseOptions {
export interface BrowserQuickExecuteOptions {
code: string;
profile?: string;
writeMode?: 'readonly' | 'readwrite';
saveChanges?: boolean;
apiKey?: string;
apiUrl?: string;
output?: string;
Expand All @@ -74,7 +74,7 @@ export async function handleBrowserLaunch(
activityTtl?: number;
profile?: {
name: string;
writeMode?: 'readonly' | 'readwrite';
saveChanges?: boolean;
};
} = {};
if (options.ttl !== undefined) args.ttl = options.ttl;
Expand All @@ -83,7 +83,7 @@ export async function handleBrowserLaunch(
if (options.profile) {
args.profile = {
name: options.profile,
writeMode: options.writeMode,
saveChanges: options.saveChanges,
};
}

Expand Down Expand Up @@ -291,13 +291,13 @@ export async function handleBrowserQuickExecute(
const launchArgs: {
profile?: {
name: string;
writeMode?: 'readonly' | 'readwrite';
saveChanges?: boolean;
};
} = {};
if (options.profile) {
launchArgs.profile = {
name: options.profile,
writeMode: options.writeMode,
saveChanges: options.saveChanges,
};
}

Expand Down
30 changes: 7 additions & 23 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,26 +741,17 @@ function createBrowserCommand(): Command {
'Name for a profile (survives close, reconnect by name later)'
)
.option(
'--write-mode <mode>',
'Write mode for profile: readonly or readwrite (default: readwrite)'
'--no-save-changes',
'Load existing profile data without saving changes (default: saves changes)'
)
.option('-o, --output <path>', 'Output file path (default: stdout)')
.option('--json', 'Output as JSON format', false)
.action(async (code, options) => {
if (code) {
if (
options.writeMode &&
!['readonly', 'readwrite'].includes(options.writeMode)
) {
console.error(
'Error: --write-mode must be "readonly" or "readwrite"'
);
process.exit(1);
}
await handleBrowserQuickExecute({
code,
profile: options.profile,
writeMode: options.writeMode,
saveChanges: options.saveChanges,
apiKey: options.apiKey,
apiUrl: options.apiUrl,
output: options.output,
Expand Down Expand Up @@ -809,8 +800,8 @@ Explicit subcommands:
'Name for a profile (survives close, reconnect by name later)'
)
.option(
'--write-mode <mode>',
'Write mode for profile: readonly or readwrite (default: readwrite)'
'--no-save-changes',
'Load existing profile data without saving changes (default: saves changes)'
)
.option(
'-k, --api-key <key>',
Expand All @@ -834,23 +825,16 @@ Examples:
$ firecrawl browser launch-session --ttl 600
$ firecrawl browser launch-session --ttl 300 --ttl-inactivity 60
$ firecrawl browser launch-session --profile my-session
$ firecrawl browser launch-session --profile my-session --write-mode readonly
$ firecrawl browser launch-session --profile my-session --no-save-changes
$ firecrawl browser launch-session -o session.json --json
`
)
.action(async (options) => {
if (
options.writeMode &&
!['readonly', 'readwrite'].includes(options.writeMode)
) {
console.error('Error: --write-mode must be "readonly" or "readwrite"');
process.exit(1);
}
await handleBrowserLaunch({
ttl: options.ttl,
ttlInactivity: options.ttlInactivity,
profile: options.profile,
writeMode: options.writeMode,
saveChanges: options.saveChanges,
apiKey: options.apiKey,
apiUrl: options.apiUrl,
output: options.output,
Expand Down