feat: add JSON Schema support for AI agent integration#92
Closed
feat: add JSON Schema support for AI agent integration#92
Conversation
Add a new `-o schema` output format that generates JSON Schema for command output types. This enables AI agents and automation tools to programmatically discover the structure of CLI command outputs without needing to execute commands or maintain external documentation. Changes: - Add pkg/cli/schema package with reflection-based schema generation - Add `schema` output format option to all commands - Update help text to document the new output format Usage: escape-cli <command> -o schema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
added 2 commits
March 26, 2026 21:51
Add exhaustive case handling for all reflect.Kind values to satisfy the exhaustive linter. Cases already handled above the switch (Pointer, Slice, Array, Map) are included for completeness.
Add support for AI agents to discover input JSON Schema for commands that accept stdin input. This complements the existing -o schema flag which shows output schemas. Changes: - Add --input-schema global flag to root command - Add InputSchema function to out package - Update create/update commands to support --input-schema: - profiles create-rest, create-webapp, create-graphql - custom-rules create, update - assets create - Document AI agent integration flags in help text
Member
Author
|
Merged into fix/paginated-json-output for a combined PR with pagination fixes and API client regeneration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add JSON Schema support for AI agents and automation tools to programmatically discover the structure of CLI command inputs and outputs.
Changes
pkg/cli/schemapackage with reflection-based schema generation-o schemaoutput format option to all commands (output schema)--input-schemaflag for create/update commands (input schema)Usage
Get output JSON Schema:
Get input JSON Schema (for commands accepting stdin):
Machine-readable output:
Supported Commands
Output Schema (
-o schema)All commands support this flag to show the JSON Schema of their response.
Input Schema (
--input-schema)profiles create-rest- REST profile creation schemaprofiles create-webapp- WebApp profile creation schemaprofiles create-graphql- GraphQL profile creation schemacustom-rules create- Custom rule creation schemacustom-rules update- Custom rule update schemaassets create- Asset creation schema (REST example, varies by asset_type)