Skip to content

feat(index): add a search command - #302

Merged
PhantomInTheWire merged 9 commits into
mainfrom
kris/index-search
Oct 6, 2026
Merged

PhantomInTheWire merged 9 commits into
mainfrom
kris/index-search

Conversation

@KrisOei

@KrisOei KrisOei commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds firecrawl gov for the Government Index, and gov to search --categories.

firecrawl gov <query> [--limit n] [--json | --pretty] [-o file]
  GET /v2/search/gov?query&k&integration=cli     # keyless when no API key
  success: false → print error, exit 1
  render
    ## <position>. <title>
    <url>
    <description>
 firecrawl search <query> --categories <list>
-  research, pdf, developer
+  research, pdf, developer, gov     # gov is exclusive; results in data.web

Tests cover the request URL, rendering, --json, keyless, and both failure paths.


Summary by cubic

Adds a gov search command and lets the existing search command target the gov category, both backed by Firecrawl's Government Index so users can search US federal, state, and local government legal sources from the terminal.

  • The command supports --limit, --json, --pretty, and -o/--output, plus keyless mode and per-command API key or URL overrides; it exits with code 1 on failed requests and unsuccessful responses.
  • search now accepts --categories gov, which cannot be combined with other categories.
  • Registered in root help, listed under native commands in list, and documented in the README with a link to the REST reference.
  • Covers the gov handler with unit tests and the CLI surface with argv parsing tests.

Written for commit c94e8fb. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Shadow auto-approve: would not auto-approve because issues were found.

Fix all with cubic | Re-trigger cubic

Comment thread src/__tests__/commands/gov.test.ts
Comment thread src/commands/gov.ts
Comment thread src/commands/legal-regulatory.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 2 unresolved P0–P2 issues from previous reviews.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Adds a new legal-regulatory search command following existing developer/research patterns, with tests, CLI registration, and README docs; additive and bounded, and the deferred duplication matches existing per-command helpers.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Adds a new legal-regulatory search command for /v2/search/gov, with CLI registration, unit/argv tests, and README docs, mirroring existing developer/research commands. Additive and bounded, with no existing behavior changed; deferred duplication matches the current per-command helper pattern.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files (changes from recent commits).

Confidence score: 4/5

  • In src/index.ts, --categories gov,pdf is accepted and forwarded even though gov is documented as exclusive. Reject lists that combine gov with another category.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/index.ts">

<violation number="1" location="src/index.ts:1048">
P2: `--categories gov,pdf` passes validation and is forwarded as both categories, despite `gov` being documented as exclusive. Reject any category list that contains `gov` alongside another category.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.
Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread src/__tests__/commands/gov.test.ts
Comment thread src/index.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 2 unresolved P0–P2 issues from previous reviews.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 4 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would require human review. Adds a legal-regulatory search command for /v2/search/gov and a gov search category, but the documented exclusivity of gov is not enforced: --categories gov,pdf passes validation. The -o output regression test was also dropped.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 7 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would require human review. Adds a gov search command and --categories gov with tests/docs, but the documented gov exclusivity is still not enforced and the dropped -o output test remains unaddressed.

Re-trigger cubic

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

@PhantomInTheWire
PhantomInTheWire merged commit e7589ca into main Oct 6, 2026
8 checks passed
@PhantomInTheWire
PhantomInTheWire deleted the kris/index-search branch October 6, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants