Utilities for scraping the official Proxmox API viewer, normalizing responses, and publishing OpenAPI specs plus a companion SPA.
This toolkit provides third‑party automation building blocks for Proxmox VE. It supplies the ingredients required to deliver a full‑featured Terraform provider and other infrastructure‑as‑code integrations.
- Install and run the pipeline
npm install @mihailfox/proxmox-openapi --registry=https://npm.pkg.github.com npx proxmox-openapi pipeline --mode full --report var/automation-summary.json
- Build and preview the SPA
npm install npm run ui:dev
- Use the GitHub Action (CI)
jobs: openapi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Generate Proxmox OpenAPI artifacts uses: ./.github/actions/proxmox-openapi-artifacts with: mode: ci fallback-to-cache: true
- Node.js 24 or newer (
"engines": { "node": ">=24.0.0" }). - macOS, Linux, or Windows for local development. CI runs on Ubuntu.
- For npm installs from GitHub Packages, configure an auth token (see package README).
- Deliver first-party quality building blocks that unblock a Terraform provider and future IaC integrations for Proxmox VE.
- Keep schema generation reproducible so external tooling can track upstream releases with confidence.
- Provide an approachable UI and documentation hub that mirrors the automation behaviour available through the npm package and GitHub Action.
app/: Vite-based SPA that surfaces the generated specifications and embeds Swagger UI with lazy loading.packages/proxmox-openapi/: Consolidated source for scraping, normalization, OpenAPI generation, automation orchestration, and the published CLI (@mihailfox/proxmox-openapi)..github/actions/proxmox-openapi-artifacts/: First-party GitHub Action wrapping the automation pipeline for CI..github/workflows/: CI pipelines for validations, artifact generation, GitHub Pages, and project automation. Thedeploy-pagesworkflow now includes a post-deploylighthouse-performancejob that audits key SPA routes and commits JSON/markdown reports to theperformance-reportsbranch..devcontainer/: Containerized development environment configs. See docs/devcontainer.md.var/: Workspace-local output directory (automation summaries, OpenAPI bundles, release staging, static site builds). GitHub Pages installs the latest published CLI (@mihailfox/proxmox-openapi@latest) before running automation, and falls back to a local build if the package is unavailable.
- We pin Git’s hooks directory to
.githooks(git config core.hooksPath .githooks) so every commit runs Biome on staged sources. The pre-commit script (.githooks/pre-commit) exits quietly ifnpxor@biomejs/biomeare missing. - The hook executes
npx @biomejs/biome check --write --staged --files-ignore-unknown=true --no-errors-on-unmatched. It formats only staged files, sorts imports, and applies autofixable lint fixes without touching unstaged work. - Format the entire tree manually with
npx @biomejs/biome check --write --organize-imports-enabled=true .whenever you want a clean sweep.
The SPA under app/ is a React + Vite project that ships the marketing pages, API explorer, and statically bundled
OpenAPI artifacts. The build expects fresh schema bundles under var/openapi, which are synced into the public assets
via npm run openapi:prepare before Vite serves or builds the site. GitHub Pages deploys the compiled assets located in
dist/ together with the generated OpenAPI bundle. See docs/spa-deployment.md for the
deployment workflow and rollback guidance.
The automation pipeline chains the following stages (implemented in packages/proxmox-openapi/src/internal/automation/pipeline.ts):
- Scrape –
@proxmox-openapi/api-scraperlaunches Playwright, fetchesapidoc.js, and persists a raw snapshot (JSON). - Normalize –
@proxmox-openapi/api-normalizerconverts the raw tree into a versioned intermediate representation (IR). - Generate –
@proxmox-openapi/openapi-generatoremits OpenAPI 3.1 JSON/YAML documents and enriches tags/metadata. - Validate – Swagger Parser validates the JSON output and persists a structured run summary.
Run the end-to-end flow with npx proxmox-openapi pipeline (or npm run automation:pipeline, which proxies the same CLI).
Pass --mode=full for a live scrape or --no-fallback-to-cache to fail fast when Proxmox endpoints are unreachable. The
command writes a JSON summary to var/automation-summary.json when invoked with --report <path>. Stage-specific
commands (scrape, normalize, generate) mirror the library internals under packages/proxmox-openapi/src/internal/
for targeted debugging.
- Install dependencies with
npm install. - Generate or refresh the OpenAPI artifacts (
npx proxmox-openapi pipeline --mode full --report var/automation-summary.json). - Start the SPA dev server (
npm run ui:dev). The script copies the current artifacts and launches Vite athttp://127.0.0.1:5173. - When finished, stop the dev server with
Ctrl+C. Regenerate artifacts whenever the API schema changes.
- The devcontainer definition lives under
.devcontainer/; see docs/devcontainer.md for the full image layout, helper scripts, and troubleshooting tips. - Shell history persists through the
${HOME}/.dev_con_bash_historybind mount so multiple Devcontainer workspaces can coexist without clobbering~/.bash_historyon the host. ./launcher.shwraps the most common devcontainer actions:./launcher.sh vscode --attach-shellopens the repo in VS Code and waits for the container before spawning a shell../launcher.sh get_config customizations.vscode.settingsqueries arbitrary paths fromdevcontainer.jsonif you need to script against the configuration.
- The launcher sources
scripts/common.sh, which also powers other automation helpers. Use./launcher.sh helpfor the full command list.
The "Project Stage Sync" workflow keeps the delivery project up to date. Review the automation runbook for triggers,
token requirements, CLI flags, and manual override instructions. When opening a pull request, ensure the relevant issue is linked so the
workflow can reconcile status changes. Use packages/proxmox-openapi/scripts/automation/format-summary.ts to turn pipeline summaries into Markdown for PRs.
CI workflows run under concurrency groups (${{ github.workflow }}-${{ github.ref }}) so any superseded run is cancelled before new work starts.
- Run a Lighthouse audit (Performance, Accessibility, Best Practices ≥ 90) against the deployed pages site after significant UI changes.
- Check for broken links using a crawler such as
npx broken-link-checker https://mihailfox.github.io/proxmox-openapi/before publishing. - Verify that the embedded Swagger UI loads the latest
openapi/proxmox-ve.jsonbundle after every automation pipeline run.
npm run test:allexecutes unit suites for the scraper, normalizer, generator, and automation helpers.- Playwright suites cover scraper smoke tests (
packages/proxmox-openapi/tests/api-scraper/smoke.spec.ts) and UI contrast/theme behaviour (tests/ui/theme.spec.ts).
The bundled action in .github/actions/proxmox-openapi-artifacts runs the automation pipeline directly from source.
It leverages the @mihailfox/proxmox-openapi package so GitHub Actions, local scripts, and downstream consumers rely on
an identical code path. After cloning, lint updates with npm run action:lint to ensure the action workspace stays clean.
jobs:
openapi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Generate Proxmox OpenAPI artifacts
uses: mihailfox/proxmox-openapi/.github/actions/proxmox-openapi-artifacts@v1
with:
mode: ci
fallback-to-cache: trueNote Workflows that install
@mihailfox/proxmox-openapimust configure npm for GitHub Packages. For example:cat <<'RC' >> ~/.npmrc //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} @mihailfox:registry=https://npm.pkg.github.com RC
Download the release bundle and reference it locally:
mkdir -p .github/actions/proxmox-openapi-artifacts
curl -sSL https://github.com/mihailfox/proxmox-openapi/releases/download/v1.0.0/proxmox-openapi-artifacts-action-v1.0.0.tgz \
| tar -xz -C .github/actions/proxmox-openapi-artifacts --strip-components=1 proxmox-openapi-artifacts-actionjobs:
openapi:
runs-on: self-hosted
steps:
- uses: actions/checkout@v5
- name: Generate Proxmox OpenAPI artifacts
uses: ./.github/actions/proxmox-openapi-artifacts
with:
mode: full
offline: true-
Configure an
.npmrcentry with your GitHub Packages token:@mihailfox:registry=https://npm.pkg.github.com //npm.pkg.github.com/:_authToken=${NPM_TOKEN}
-
Install and run the CLI:
npm install @mihailfox/proxmox-openapi npx proxmox-openapi pipeline --mode full --report var/automation-summary.json npx proxmox-openapi scrape --output var/cache/api-scraper/raw/proxmox-openapi-schema.json npx proxmox-openapi generate --output var/openapi --basename proxmox-ve
-
See docs/packages.md for CLI flag reference, library usage, and release cadence details.
- Publishing a GitHub Release triggers
.github/workflows/release.yml. That workflow rebuilds artifacts, validates them, and uploads release assets. It also publishes the npm package (@mihailfox/proxmox-openapi) to GitHub Packages. - Use semantic tags (for example
v1.2.3) and optional prerelease suffixes (-alpha.*,-beta.*,-rc.*) when drafting the release. - See docs/releases.md for download commands, checksum verification, and release metadata.
- The release workflow aligns every
package.jsonversion with the tag, commits the bump back tomain, and records the upstream Proxmox VE version scraped from the documentation index. Release notes and manifests include both values for traceability.
- Create a fork of the repo and clone it locally.
- Install dependencies with
npm install. - Run targeted checks (
npm run lint,npm run test:all, etc.) before pushing. - Reference the linked issue in branch names/PR bodies and document any automation impact.
- Keep
CHANGELOG.mdcurrent. Our release workflow reads the top “Unreleased” section and uses it as the body for the next GitHub Release. Log user‑visible changes under the Common Changelog categories (Added, Changed, Deprecated, Removed, Fixed, Security). - Prefer conventional commits (e.g.
feat:,fix(ci):,docs(action):) and small, focused pull requests. - See docs/automation.md for expectations around project updates and troubleshooting.
- See CONTRIBUTING.md for Documentation Style guidelines applied across this repository.
Git hooks run Biome on staged files via
.githooks/pre-commit. Usenpm run formatfor a full sweep across the repo.