← 返回
未分类 Key 中文

Fuel CLI

UK fuel prices CLI — find nearby stations by postcode or coordinates, get station details, ranked by price/distance/freshness, and agent-friendly JSON envelo...
英国燃料价格命令行工具 — 通过邮编或坐标查找附近加油站,获取站点详情,按价格/距离/新鲜度排名,支持代理友好的 JSON 包装
shan8851
未分类 clawhub v0.1.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 384
下载
💾 0
安装
1
版本
#latest

概述

fuel-cli

Use fuel for UK fuel prices: nearby station search, station detail, ranked results with freshness tracking.

Setup

  • npm install -g @shan8851/fuel-cli
  • Register at https://www.fuel-finder.service.gov.uk for Fuel Finder OAuth credentials
  • export FUEL_FINDER_CLIENT_ID= and export FUEL_FINDER_CLIENT_SECRET= or add to .env
  • Warm cache reads work without credentials until the cache needs a refresh

Nearby Stations

  • By postcode: fuel near "SE1 9SG" --fuel E10
  • By coordinates: fuel near "51.501,-0.141" --fuel B7_STANDARD
  • Custom radius: fuel near "SE1 9SG" --fuel E10 --radius 8mi
  • Sort options: fuel near "SE1 9SG" --fuel E10 --sort price (best, price, distance, freshest)
  • Limit results: fuel near "SE1 9SG" --fuel E10 --limit 5
  • Force refresh: fuel near "SE1 9SG" --fuel E10 --refresh

Station Detail

  • By name: fuel station "tesco watford"
  • By node ID: fuel station ""
  • Project one field: fuel station "" --output station.prices.0.pencePerLitre
  • Project subtree: fuel station "" --output station.openingTimes

Fuel Types

  • E10 — E10 unleaded petrol
  • E5 — Super unleaded petrol
  • B7_STANDARD — Standard diesel
  • B7_PREMIUM — Premium diesel
  • B10 — B10 biodiesel
  • HVO — HVO diesel

Output

  • Defaults to text in a TTY and JSON when piped
  • Force JSON: fuel near "SE1 9SG" --fuel E10 --json
  • Force text: fuel near "SE1 9SG" --fuel E10 --text
  • Disable colour: fuel --no-color near "SE1 9SG" --fuel E10
  • Success envelope: { ok, schemaVersion, command, requestedAt, data }
  • Error envelope: { ok, schemaVersion, command, requestedAt, error }

Agent Notes

  • --fuel is required on near — petrol and diesel are never mixed in one ranking
  • --output is available on both near and station
  • Paths use dot notation with zero-based array indexes, for example stations.0.selectedPricePencePerLitre or station.prices.0.pencePerLitre
  • In text mode, scalar projections print just the value; object or array projections print plain JSON
  • Projection errors are structured: malformed paths return INVALID_INPUT, missing paths return NOT_FOUND
  • Data-quality advisories live under data.quality.advisories — warn about stale prices, missing timestamps, and excluded test stations
  • data.quality.freshnessCounts breaks down fresh/aging/stale/unknown price counts
  • Likely test/demo forecourts are excluded automatically when normal stations exist; count is in data.quality.excludedLikelyTestStations

Configuration

  • FUEL_FINDER_CLIENT_ID — required for live data (free registration)
  • FUEL_FINDER_CLIENT_SECRET — required for live data
  • FUEL_FINDER_BASE_URL — optional, defaults to https://www.fuel-finder.service.gov.uk
  • FUEL_CACHE_DIR — optional, override cache location (defaults to platform cache dir)

Notes

  • near requires --fuel so petrol and diesel results are never mixed
  • Accepts UK postcodes (SE1 9SG) and coordinates (51.501,-0.141)
  • Radius accepts unitless (miles) or with mi/km suffix
  • Persistent local cache for station and price data — works offline until cache expires
  • Prices include freshness bands (fresh < 30min, aging < 24h, stale > 24h, unknown)
  • Exit codes: 0 success, 2 bad input or ambiguity, 3 upstream failure, 4 internal error
  • When a station query is ambiguous, the error includes candidate suggestions with brand, address, postcode, and node ID

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-07 08:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

companies-house-cli

shan8851
UK Companies House CLI — 搜索公司、公司概况、董事、申报、PSC、抵押、破产,提供代理友好的 JSON 输出,兼容 rail-cli 与 tf...
★ 0 📥 450

tfl-cli

shan8851
伦敦交通命令行工具 — 地铁状态查询、行程规划、实时到站、运营中断、自行车停放点,以及通过 `--output <path>` 进行代理友好的路线投影输出。
★ 1 📥 500

Rail CLI

shan8851
英国国家铁路CLI:实时出发、到达、车站搜索、目的地过滤、批量车站搜索(从stdin)以及轻量级字段选择 for...
★ 0 📥 488