Skip to content

feat: auto-generated showcase site (commands.json + llms.txt + GitHub Pages)#46

Merged
jklaassenjc merged 2 commits into
mainfrom
juergen/kla-442-showcase-site
Jun 12, 2026
Merged

feat: auto-generated showcase site (commands.json + llms.txt + GitHub Pages)#46
jklaassenjc merged 2 commits into
mainfrom
juergen/kla-442-showcase-site

Conversation

@jklaassenjc

@jklaassenjc jklaassenjc commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Borrows the pattern from jamf-cli's generator/site/. Generates a public command catalog from internal/schema — the same source jc schema uses, so single source of truth. Adding a new command means: edit schema.go, run make site, commit. The verify-site CI gate catches "forgot to regenerate" on PRs; the deploy-site workflow regenerates at deploy time as belt-and-suspenders so Pages always reflects what's actually shipping.

What's included

  • cmd/sitegen/main.go — renders the schema manifest into three artifacts:
    • docs/site/commands.json — manifest + sidebar categories
    • docs/site/llms.txt — short index per llmstxt.org spec
    • docs/site/llms-full.txt — full agent-facing reference
  • docs/site/index.html — vanilla HTML+JS, zero build dependencies:
    • ⌘K-focusable filter searches name, description, category, subcommands, every flag
    • Category sidebar with scroll-spy active state
    • Per-command card: subcommand chips + flags table
    • Dark/light mode follows prefers-color-scheme
    • Hand-curated long-form paragraphs (with inline `code` / *italic*) for commands where the one-line description undersells the feature
  • internal/schema/schema.go — adds optional Long field to CommandEntry. Populated for the 7 commands in Setup + AI & Automation in this PR; the field is omitempty so other commands can be enriched incrementally.
  • Makefilemake site to regenerate, make verify-site to diff against committed artifacts.
  • .github/workflows/verify-site.yml — PR-time stale-catalog detector. Path-filtered to schema, sitegen, docs/site/, and Makefile changes.
  • .github/workflows/deploy-site.yml — main-merge deploy via actions/upload-pages-artifact + actions/deploy-pages.
  • README.md — site link in header, contributor notes under Development.

Why this design

  • Single source of truth: internal/schema already powers jc schema, the MCP server, and jc ask. Reusing it means the catalog can never drift from what the CLI actually exposes.
  • No build pipeline: vanilla HTML+JS. Anyone can read or edit index.html directly. No npm, no bundler, no version pinning.
  • Defense in depth on staleness: verify-site (PR gate) + regenerate-at-deploy (workflow). One can fail; the other catches.
  • Version field stripped from commands.json so git-describe churn doesn't churn the artifact every commit.

Manual step after merge

Enable Pages for the repo: Settings → Pages → Source: GitHub Actions. URL will be https://thejumpcloud.github.io/jc-cli/.

Stats

  • 38 commands rendered under 9 categories
  • 7 commands have long-form elaborations (auth, config, recipe, mcp, schema, ask, explain)
  • llms-full.txt is ~16 KB; well-formed markdown
  • commands.json is ~33 KB

Test plan

  • make site regenerates all four artifacts deterministically
  • make verify-site clean against committed copies
  • make verify-site exits non-zero when artifacts drift (sanity-checked by editing schema and re-running)
  • Local browser walk: ⌘K filter, sidebar nav, scroll-spy, dark/light mode, mobile breakpoint
  • All four artifacts serve over python3 -m http.server and return 200
  • go vet ./... clean
  • go test ./internal/schema/... ./internal/api/... clean
  • After merge: enable Pages in Settings → Pages → Source: GitHub Actions, then verify https://thejumpcloud.github.io/jc-cli/ resolves

Refs KLA-442

🤖 Generated with Claude Code


Note

Low Risk
Documentation, static site generation, and CI only; no runtime CLI or API behavior changes beyond optional schema manifest fields.

Overview
Adds a schema-driven public command catalog for GitHub Pages: new cmd/sitegen renders schema.BuildCommandManifest() into commands.json, llms.txt, and llms-full.txt (with sidebar categories; version omitted from JSON to avoid churn).

Makefile gains make site and make verify-site (diff committed artifacts vs fresh generation). CI: verify-site on PRs when schema/site paths change; deploy-site on main runs make site then publishes docs/site via GitHub Pages.

docs/site/index.html is a static, no-build UI that loads commands.json (search, categories, command cards). internal/schema: optional Long on CommandEntry with copy for seven Setup/AI commands. README links the catalog and documents the regenerate workflow.

Reviewed by Cursor Bugbot for commit e479d43. Bugbot is set up for automated code reviews on this repo. Configure here.

… Pages)

Borrows the pattern from jamf-cli's generator/site/. The site is generated
from internal/schema (the same source the `jc schema` command uses) so
there's a single source of truth — no parallel Cobra walker, no hand-kept
catalog file. Adding a new command means: edit schema.go, run `make site`,
commit. The verify-site CI gate catches the "forgot to regenerate" case
on PRs; the deploy-site workflow regenerates at deploy time as defense in
depth so Pages always reflects what's actually shipping.

Components:

- cmd/sitegen/main.go — renders schema.BuildCommandManifest() into:
  - docs/site/commands.json  (manifest + sidebar categories)
  - docs/site/llms.txt       (short index per https://llmstxt.org/)
  - docs/site/llms-full.txt  (full reference for AI agents)
  Hardcoded category map groups 38 commands under 9 sidebar headings.
  Version is deliberately omitted from output so git-describe churn
  doesn't churn commands.json on every commit.

- docs/site/index.html — vanilla HTML+JS, zero build deps:
  - ⌘K-focusable filter searches across command name, description,
    category, subcommands, and every flag
  - Category sidebar with scroll-spy active state
  - Per-command card: subcommand chips + flags table
  - Dark/light mode follows prefers-color-scheme
  - Long-form elaboration paragraphs (with `code` / *italic*)
    rendered for hand-curated commands

- internal/schema/schema.go — adds optional Long field to CommandEntry,
  populated for the 7 commands in Setup + AI & Automation where the
  one-line Description undersells the feature. Other commands can be
  enriched incrementally; the field is omitempty.

- Makefile — `make site` regenerates, `make verify-site` diffs against
  the committed artifacts and fails if stale.

- .github/workflows/verify-site.yml — PR-time stale-catalog detector.
  Runs only when schema, sitegen, docs/site/, or the Makefile changed.

- .github/workflows/deploy-site.yml — main-merge deploy to Pages via
  actions/upload-pages-artifact + actions/deploy-pages. Regenerates at
  deploy time as defense in depth.

- README.md — site link in header, contributor notes in Development.

Pages URL will be https://thejumpcloud.github.io/jc-cli/ once Pages is
enabled for the repo (Settings → Pages → Source: GitHub Actions).

Refs KLA-442

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@socket-security

socket-security Bot commented Jun 12, 2026

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: github actions/upload-artifact is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?github/actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fagithub/actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore github/actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 9469f96. Configure here.

Comment thread docs/site/index.html
Comment thread docs/site/index.html
Comment thread docs/site/index.html
… global flags

Cursor Bugbot review on PR #46 flagged three filter gaps:

1. Sidebar links tested `dataset.path` while cards tested a full haystack
   — searching `mfa` (a subcommand on jc users) showed the card but
   hid its sidebar link. Both now resolve the card by id and use the
   same haystack, so the two panes can never disagree.
2. The new `cmd.long` paragraphs weren't indexed — queries like
   `keychain`, `Touch ID`, `webhook` didn't surface the enriched cards
   even though those tokens lived in the elaborations.
3. `manifest.global_flags` (--plan, --output, --quiet, etc.) wasn't in
   any haystack. Added a synthetic "Global flags" card at the top of
   the catalog with its own Reference sidebar entry, so global flags
   are both findable via search and discoverable while browsing.

Also extended the per-card haystack to include each flag's shorthand
and default value while I was in there — searches for `-o` or `60`
(the MCP rate-limit default) now hit too.

Refs KLA-442, addresses Bugbot review on PR #46

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jklaassenjc jklaassenjc merged commit 2fde285 into main Jun 12, 2026
8 checks passed
@jklaassenjc jklaassenjc deleted the juergen/kla-442-showcase-site branch June 12, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants