Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@amikofalvy
Copy link
Collaborator

Summary

  • Implement a system where Zod schemas are the single source of truth for both CLI command definitions (Commander.js) and documentation generation
  • Add command schemas in agents-cli/src/schemas/ defining all CLI commands with metadata (options, arguments, examples, descriptions)
  • Create CLIReference React component that imports schemas directly and renders documentation
  • Use fumadocs pre component for proper bash syntax highlighting in code examples

Motivation

CLI documentation at agents-docs/content/docs/typescript-sdk/cli-reference.mdx was maintained separately from actual CLI definitions, leading to documentation drift. This change ensures docs are always in sync with the CLI implementation.

Changes

New files

  • agents-cli/src/schemas/types.ts - Type definitions for command metadata
  • agents-cli/src/schemas/commander-builder.ts - Utilities to build Commander.js commands from schemas
  • agents-cli/src/schemas/commands/*.schema.ts - Individual command schemas (13 files)
  • agents-docs/src/components/cli-reference.tsx - React component that renders CLI docs from schemas

Modified files

  • agents-cli/src/index.ts - Updated to use schema-based command registration
  • agents-cli/tsdown.config.ts - Added schema exports for docs consumption
  • agents-docs/content/docs/typescript-sdk/cli-reference.mdx - Simplified to use the new component

Test plan

  • Verify CLI commands work correctly with inkeep --help
  • Verify docs render correctly at /typescript-sdk/cli-reference
  • Verify bash syntax highlighting in code examples
  • Verify copy button works on code blocks

🤖 Generated with Claude Code

Implement a system where Zod schemas are the single source of truth for both
CLI command definitions (Commander.js) and documentation generation.

Changes:
- Add command schemas in agents-cli/src/schemas/ defining all CLI commands
  with metadata (options, arguments, examples, descriptions)
- Create CLIReference React component that imports schemas directly
- Update CLI to use schema-based command registration
- Simplify cli-reference.mdx to use the new component
- Use fumadocs pre component for proper bash syntax highlighting

This prevents documentation drift by generating docs from the same schemas
that define the CLI commands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2025

⚠️ No Changeset found

Latest commit: e655639

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
agents-docs Ready Ready Preview, Comment Dec 22, 2025 10:46am
agents-manage-api Error Error Dec 22, 2025 10:46am
agents-manage-ui Ready Ready Preview, Comment Dec 22, 2025 10:46am
agents-run-api Ready Ready Preview, Comment Dec 22, 2025 10:46am

@claude
Copy link

claude bot commented Dec 22, 2025

Claude Code is working…

I'll analyze this and get back to you.

View job run

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.

2 participants