Skip to content

Add generated input_schema to command manifest#309

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feat/command-input-schema
Jun 29, 2026
Merged

Add generated input_schema to command manifest#309
AndreyVMarkelov merged 1 commit into
masterfrom
feat/command-input-schema

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Generates a JSON Schema per command (input_schema) from manifest args and flags, enabling tool callers and MCP integrations to validate structured input before building CLI invocations
  • Uses JSON-friendly property names (if_exists) while preserving CLI names in x-cli-name (if-exists)
  • Marks sensitive inputs with writeOnly/x-sensitive, propagates conflicts, shorthand, inherited, may-prompt
  • Validates --output format on help requests early so invalid formats produce proper structured errors instead of confusing output

Test plan

  • go test ./... passes
  • golangci-lint run ./... clean
  • gofmt -s -l . clean
  • TestJSONHelpManifestV1MachineFields validates put input_schema structure, types, defaults, excludes help/output
  • TestJSONHelpManifestV1SelectedCommandMetadata validates cp variadic arrays, share-link update conflicts/sensitive/format
  • TestJSONHelpManifestRegistryAudit verifies all commands have valid input_schema
  • TestRawArgsHelpOutputFormatError covers valid/invalid formats and edge cases
  • TestExecuteExitsWithMappedCodes covers --output=yaml with help flags/commands

…tput

Generates a JSON Schema per command from manifest args and flags, enabling
tool callers and MCP integrations to validate structured input before
building CLI invocations. Also validates --output format on help requests
early so invalid formats produce proper structured errors.
@AndreyVMarkelov AndreyVMarkelov merged commit 8624e37 into master Jun 29, 2026
8 checks passed
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