firecrawl / firecrawl/cli

bug(search): documented --pretty option is rejected

Open Beginner friendly
#181 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
631
Forks
100
Avg merge
5h 9m
Merged PRs (30d)
25

Description

## Summary

`firecrawl search` documents and internally supports a `--pretty` output option, but the command does not register the flag. The released CLI therefore rejects documented Search examples before making an API request.

## Reproduction

Environment:

- `firecrawl-cli@1.19.29`
- Node.js `v24.18.0`
- npm `11.16.0`

Run:

```bash
npm exec --yes --package firecrawl-cli@1.19.29 -- \
firecrawl search "test" --pretty
```

Actual result:

```text
error: unknown option '--pretty'
```

No API key is needed to reproduce this because argument parsing fails before any request. `firecrawl search --help` lists `--json` but not `--pretty`.

## Expected behavior

`firecrawl search ... --pretty` should emit indented JSON, consistent with the documented contract, the Search option type, the Search output handler, and other CLI commands that expose `--pretty`.

## Current source

At `firecrawl/cli@c0560791deb920e45fe9ccde26f7e7973c92a5f2` (`package.json` version `1.19.29`):

- [`src/index.ts`](https://github.com/firecrawl/cli/blob/c0560791deb920e45fe9ccde26f7e7973c92a5f2/src/index.ts#L970-L976) comments out the Search `--pretty` registration but registers `--json`.
- The same command still passes `options.pretty` into `handleSearchCommand`.
- [`src/types/search.ts`](https://github.com/firecrawl/cli/blob/c0560791deb920e45fe9ccde26f7e7973c92a5f2/src/types/search.ts#L36-L42) includes `pretty?: boolean`.
- [`src/commands/search.ts`](https://github.com/firecrawl/cli/blob/c0560791deb920e45fe9ccde26f7e7973c92a5f2/src/commands/search.ts#L307-L329) already formats indented JSON when `options.pretty` is true.

Current Firecrawl documentation still advertises Search `--pretty` in the [CLI option table](https://github.com/firecrawl/firecrawl-docs/blob/fc652b9fce073de0cf274f6b916a31e3937a28be/sdks/cli.mdx#L158-L178) and multiple Search snippets, including the [basic example](https://github.com/firecrawl/firecrawl-docs/blob/fc652b9fce073de0cf274f6b916a31e3937a28be/snippets/v2/cli/search/basic.mdx#L1-L9).

## Suggested fix

Restore the Search `-p, --pretty` registration and add command-level coverage proving that:

1. `firecrawl search --help` lists `--pretty`.
2. `firecrawl search "test" --pretty` reaches the Search handler instead of failing option parsing.
3. Pretty mode emits indented JSON and implies JSON output.

If the option was intentionally removed, the alternative is to remove the remaining `pretty` handler/type path and update every affected documentation snippet. Given that implementation support already exists and other commands expose the same option, restoring the registration appears to be the smaller consistency fix.

## Duplicate check

No matching open or closed issue was found in `firecrawl/cli` using repository issue searches for `pretty search` and the broader term `pretty` on 2026-08-06.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/index.ts at the Search command's option registration, then read src/types/search.ts and src/commands/search.ts to confirm the existing pretty-output path. Add command-level coverage for help, option parsing, and indented JSON output, and consider the issue complete when `firecrawl search --help` lists `--pretty` and the command reaches the handler without rejecting it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.