feat: auto-generated showcase site (commands.json + llms.txt + GitHub Pages)#46
Conversation
… 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>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
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.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Reviewed by Cursor Bugbot for commit 9469f96. Configure here.
… 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>

Summary
Borrows the pattern from jamf-cli's
generator/site/. Generates a public command catalog frominternal/schema— the same sourcejc schemauses, so single source of truth. Adding a new command means: editschema.go, runmake site, commit. Theverify-siteCI gate catches "forgot to regenerate" on PRs; thedeploy-siteworkflow 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 categoriesdocs/site/llms.txt— short index per llmstxt.org specdocs/site/llms-full.txt— full agent-facing referencedocs/site/index.html— vanilla HTML+JS, zero build dependencies:prefers-color-scheme`code`/*italic*) for commands where the one-line description undersells the featureinternal/schema/schema.go— adds optionalLongfield toCommandEntry. Populated for the 7 commands in Setup + AI & Automation in this PR; the field isomitemptyso other commands can be enriched incrementally.make siteto regenerate,make verify-siteto 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 viaactions/upload-pages-artifact+actions/deploy-pages.Why this design
internal/schemaalready powersjc schema, the MCP server, andjc ask. Reusing it means the catalog can never drift from what the CLI actually exposes.index.htmldirectly. No npm, no bundler, no version pinning.verify-site(PR gate) + regenerate-at-deploy (workflow). One can fail; the other catches.commands.jsonso 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
llms-full.txtis ~16 KB; well-formed markdowncommands.jsonis ~33 KBTest plan
make siteregenerates all four artifacts deterministicallymake verify-siteclean against committed copiesmake verify-siteexits non-zero when artifacts drift (sanity-checked by editing schema and re-running)python3 -m http.serverand return 200go vet ./...cleango test ./internal/schema/... ./internal/api/...cleanRefs 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/sitegenrendersschema.BuildCommandManifest()intocommands.json,llms.txt, andllms-full.txt(with sidebar categories; version omitted from JSON to avoid churn).Makefile gains
make siteandmake verify-site(diff committed artifacts vs fresh generation). CI:verify-siteon PRs when schema/site paths change;deploy-siteon main runsmake sitethen publishesdocs/sitevia GitHub Pages.docs/site/index.htmlis a static, no-build UI that loadscommands.json(search, categories, command cards).internal/schema: optionalLongonCommandEntrywith 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.