Skip to content

feat(hltv): add HLTV adapters#2028

Open
CrazysCodes wants to merge 1 commit into
jackwener:mainfrom
CrazysCodes:add-hltv-adapters
Open

feat(hltv): add HLTV adapters#2028
CrazysCodes wants to merge 1 commit into
jackwener:mainfrom
CrazysCodes:add-hltv-adapters

Conversation

@CrazysCodes

Copy link
Copy Markdown

Description

Add a new read-only HLTV adapter for CS2/CS:GO data. It supports searching HLTV entities and reading structured player, match, team, event, map-pool, form, duel, and series stats from visible HLTV pages.

The adapter uses Browser/UI parsing because HLTV does not expose a stable public JSON API for these stats views.

Related issue: N/A

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Documentation (if adding/modifying an adapter)

  • Added doc page under docs/adapters/ (if new adapter)
  • Updated docs/adapters/index.md table (if new adapter)
  • Updated sidebar in docs/.vitepress/config.mts (if new adapter)
  • Updated README.md / README.zh-CN.md when command discoverability changed
  • Used positional args for the command's primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Screenshots / Output

Checks run locally:

node --check clis/hltv/*.js
node scripts/check-silent-column-drop.mjs
node scripts/check-typed-error-lint.mjs
npx tsc --noEmit
npm run build
npm run docs:build

All checks passed.

Smoke test:

env HOME=/private/tmp/opencli-pr-home node dist/src/main.js hltv search niko --limit 1 -f json

Sample output:

[
  {
    "rank": 1,
    "type": "player",
    "id": "3741",
    "name": "Nikola 'NiKo' Kovač",
    "title": null,
    "date": null,
    "author": null,
    "url": "https://www.hltv.org/player/3741/niko"
  }
]

Notes:

  • HOME=/private/tmp/opencli-pr-home was used only to isolate this branch from my local ~/.opencli/clis/hltv development adapter.
  • Heavier browser smoke tests may take longer due to HLTV/Cloudflare/browser-session behavior, but the adapter builds, type-checks, renders docs, and the lightweight search smoke test succeeds.

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