From 0494fd65307e35570ae91fe1339702dd16a04de7 Mon Sep 17 00:00:00 2001 From: mogery Date: Fri, 6 Nov 2026 16:59:33 +0000 Subject: [PATCH 1/2] feat(browser): warn that firecrawl browser is deprecated Every firecrawl browser invocation, including its subcommands, now prints one line on stderr naming firecrawl scrape and firecrawl interact as the replacement. Stdout and exit codes are unchanged, so scripts and --json output keep working. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- src/__tests__/cli-argv.test.ts | 20 ++++++++++++++++++++ src/index.ts | 5 +++++ 2 files changed, 25 insertions(+) diff --git a/src/__tests__/cli-argv.test.ts b/src/__tests__/cli-argv.test.ts index 63f56a7d31..797fc4777c 100644 --- a/src/__tests__/cli-argv.test.ts +++ b/src/__tests__/cli-argv.test.ts @@ -270,4 +270,24 @@ describe('CLI argv parsing', () => { expect(result.stderr).not.toContain('unknown command'); } ); + + testWithBuiltCli( + 'warns on stderr that browser is deprecated, for the command and its subcommands', + () => { + for (const args of [ + ['browser', '--api-url', 'http://127.0.0.1:9'], + ['browser', 'list', '--api-url', 'http://127.0.0.1:9'], + ]) { + const result = spawnSync(process.execPath, [cliPath, ...args], { + encoding: 'utf8', + env: { ...process.env, FIRECRAWL_NO_UPDATE_CHECK: '1' }, + }); + expect(result.stderr).toContain( + '`firecrawl browser` is deprecated and will be removed' + ); + expect(result.stderr).toContain('firecrawl interact'); + expect(result.stdout).not.toContain('deprecated'); + } + } + ); }); diff --git a/src/index.ts b/src/index.ts index 64fd32b03a..7b1f78e8ca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2249,6 +2249,11 @@ function createBrowserCommand(): Command { ) .option('-o, --output ', 'Output file path (default: stdout)') .option('--json', 'Output as JSON format', false) + .hook('preAction', () => { + process.stderr.write( + 'Warning: `firecrawl browser` is deprecated and will be removed in a future release. Use `firecrawl scrape `, then `firecrawl interact ""` or `firecrawl interact -c ""`. See `firecrawl interact --help`.\n' + ); + }) .action(async (code, options) => { if (code) { await handleBrowserQuickExecute({ From acc3be972c646606f885cc321a7bc984e294d12a Mon Sep 17 00:00:00 2001 From: mogery Date: Fri, 6 Nov 2026 17:15:02 +0000 Subject: [PATCH 2/2] fix(browser): show the deprecation warning in browser help too Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- src/__tests__/cli-argv.test.ts | 36 +++++++++++++++++++++++++++++----- src/index.ts | 7 ++++--- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/__tests__/cli-argv.test.ts b/src/__tests__/cli-argv.test.ts index 797fc4777c..1d914b0cda 100644 --- a/src/__tests__/cli-argv.test.ts +++ b/src/__tests__/cli-argv.test.ts @@ -274,19 +274,45 @@ describe('CLI argv parsing', () => { testWithBuiltCli( 'warns on stderr that browser is deprecated, for the command and its subcommands', () => { - for (const args of [ - ['browser', '--api-url', 'http://127.0.0.1:9'], - ['browser', 'list', '--api-url', 'http://127.0.0.1:9'], - ]) { + const offline = [ + '--api-key', + 'fc-test', + '--api-url', + 'http://127.0.0.1:9', + ]; + for (const [args, status] of [ + [['browser', ...offline], 0], + [['browser', 'list', ...offline], 1], + ] as const) { const result = spawnSync(process.execPath, [cliPath, ...args], { encoding: 'utf8', env: { ...process.env, FIRECRAWL_NO_UPDATE_CHECK: '1' }, }); + expect(result.status).toBe(status); expect(result.stderr).toContain( '`firecrawl browser` is deprecated and will be removed' ); expect(result.stderr).toContain('firecrawl interact'); - expect(result.stdout).not.toContain('deprecated'); + expect(result.stdout).not.toContain('deprecated and will be removed'); + } + } + ); + + testWithBuiltCli( + 'shows the browser deprecation warning in browser help and subcommand help', + () => { + for (const args of [ + ['browser', '--help'], + ['browser', 'list', '--help'], + ]) { + const result = spawnSync(process.execPath, [cliPath, ...args], { + encoding: 'utf8', + env: { ...process.env, FIRECRAWL_NO_UPDATE_CHECK: '1' }, + }); + expect(result.status).toBe(0); + expect(result.stdout).toContain( + '`firecrawl browser` is deprecated and will be removed' + ); } } ); diff --git a/src/index.ts b/src/index.ts index 7b1f78e8ca..1271d2f226 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2229,6 +2229,8 @@ function createAgentCommand(): Command { * Create and configure the browser command (deprecated — prefer scrape + interact) */ function createBrowserCommand(): Command { + const deprecationWarning = + 'Warning: `firecrawl browser` is deprecated and will be removed in a future release. Use `firecrawl scrape `, then `firecrawl interact ""` or `firecrawl interact -c ""`. See `firecrawl interact --help`.'; const browserCmd = new Command('browser') .description( '[Deprecated: prefer scrape + interact] Launch cloud browser sessions and execute code remotely via Playwright' @@ -2250,10 +2252,9 @@ function createBrowserCommand(): Command { .option('-o, --output ', 'Output file path (default: stdout)') .option('--json', 'Output as JSON format', false) .hook('preAction', () => { - process.stderr.write( - 'Warning: `firecrawl browser` is deprecated and will be removed in a future release. Use `firecrawl scrape `, then `firecrawl interact ""` or `firecrawl interact -c ""`. See `firecrawl interact --help`.\n' - ); + process.stderr.write(`${deprecationWarning}\n`); }) + .addHelpText('beforeAll', `${deprecationWarning}\n`) .action(async (code, options) => { if (code) { await handleBrowserQuickExecute({