Skip to content

Add firecrawl prometheus command group (Alpha)#130

Open
codybmenefee wants to merge 1 commit into
mainfrom
prometheus-commands
Open

Add firecrawl prometheus command group (Alpha)#130
codybmenefee wants to merge 1 commit into
mainfrom
prometheus-commands

Conversation

@codybmenefee

Copy link
Copy Markdown

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/v1 surface 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

  • BYOK: forwards your existing Firecrawl key as X-Firecrawl-Key (reuses getApiKeyfirecrawl login / FIRECRAWL_API_KEY / --api-key). No separate credential; refuses to run without a key.
  • Base URL: --prometheus-url > PROMETHEUS_API_URL > PROMETHEUS_URL > the hosted Vercel alias. Optional PROMETHEUS_TOKEN bearer for gatewayed instances.
  • TTY-aware output: pretty tables/summaries for humans, raw JSON when piped or with --json (consistent with the rest of the CLI).

Files

  • src/commands/prometheus.ts — the command group + handlers.
  • src/utils/prometheus-client.ts/api/v1 fetch 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, valid script.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.
  • Unreachable host and missing key both give clean, actionable errors.
  • tsc --noEmit + tsc build clean; prettier-formatted.

🤖 Generated with Claude Code

@codybmenefee codybmenefee force-pushed the prometheus-commands branch from 6321665 to b5847b8 Compare June 9, 2026 13:57
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>
@codybmenefee codybmenefee force-pushed the prometheus-commands branch from b5847b8 to 75c261a Compare June 9, 2026 13:59
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.

1 participant