Add firecrawl prometheus command group (Alpha)#130
Open
codybmenefee wants to merge 1 commit into
Open
Conversation
6321665 to
b5847b8
Compare
Connects the CLI to a Prometheus instance's /api/v1 surface: ask for a verified Firecrawl collector (build) and manage self-healing data feeds (feeds create/ls/show/data/run/heal/pause/resume/rm). Mirrors the reference CLI in the prometheus repo. - Auth is BYOK: forwards your Firecrawl key as X-Firecrawl-Key (reuses getApiKey). - Base URL: --prometheus-url > PROMETHEUS_API_URL > PROMETHEUS_URL > hosted alias. - TTY-aware output: pretty for humans, raw JSON when piped or with --json. New: src/commands/prometheus.ts, src/utils/prometheus-client.ts, src/types/prometheus.ts. Registered in src/index.ts. Rebased onto current main. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
b5847b8 to
75c261a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of 3 for the Prometheus Alpha preview. Companion PRs: firecrawl/prometheus#5 (auth/access) and firecrawl-web#2446 (the launcher).
What this does
Connects the CLI to a Prometheus instance's
/api/v1surface so you can, from the terminal:firecrawl prometheus build "<prompt>"— describe data in plain English, get back a verified Firecrawl-SDK collector + a data sample.firecrawl prometheus feeds …— manage self-healing recurring feeds:create,ls,show,data,run,heal,pause,resume,rm.It mirrors the reference CLI shipped in the prometheus repo (
cli/bin.mjs) — same endpoints, same subcommands — ported into the CLI's Commander + config conventions.Auth & config
X-Firecrawl-Key(reusesgetApiKey—firecrawl login/FIRECRAWL_API_KEY/--api-key). No separate credential; refuses to run without a key.--prometheus-url>PROMETHEUS_API_URL>PROMETHEUS_URL> the hosted Vercel alias. OptionalPROMETHEUS_TOKENbearer for gatewayed instances.--json(consistent with the rest of the CLI).Files
src/commands/prometheus.ts— the command group + handlers.src/utils/prometheus-client.ts—/api/v1fetch client (base-URL + key resolution, typed errors).src/types/prometheus.ts— build/feed DTOs.src/index.ts— registers the command.Verification (against a live instance)
prometheus build "top 5 Hacker News stories…"→ exit 0, 5 sample rows, validscript.ts(import FirecrawlApp from '@mendable/firecrawl-js'…),integration.run: tsx script.ts.feeds ls/feeds show <id>/feeds data <id>→ real feed metadata + collected JSON.tsc --noEmit+tscbuild clean; prettier-formatted.🤖 Generated with Claude Code