Skip to content

feat: add JSON Schema support for AI agent integration#92

Closed
glimow wants to merge 5 commits intomainfrom
feat/schema-output
Closed

feat: add JSON Schema support for AI agent integration#92
glimow wants to merge 5 commits intomainfrom
feat/schema-output

Conversation

@glimow
Copy link
Copy Markdown
Member

@glimow glimow commented Mar 26, 2026

Summary

Add JSON Schema support for AI agents and automation tools to programmatically discover the structure of CLI command inputs and outputs.

Changes

  • Add pkg/cli/schema package with reflection-based schema generation
  • Add -o schema output format option to all commands (output schema)
  • Add --input-schema flag for create/update commands (input schema)
  • Update help text with AI agent integration section

Usage

Get output JSON Schema:

escape-cli profiles list -o schema
escape-cli scans get <id> -o schema

Get input JSON Schema (for commands accepting stdin):

escape-cli profiles create-rest --input-schema
escape-cli custom-rules create --input-schema
escape-cli assets create --input-schema

Machine-readable output:

escape-cli profiles list -o json

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 schema
  • profiles create-webapp - WebApp profile creation schema
  • profiles create-graphql - GraphQL profile creation schema
  • custom-rules create - Custom rule creation schema
  • custom-rules update - Custom rule update schema
  • assets create - Asset creation schema (REST example, varies by asset_type)

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>
@glimow glimow requested a review from QuentinN42 as a code owner March 26, 2026 17:53
Tristan Kalos (Glimow) 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
@glimow glimow changed the title feat: add JSON Schema output format for AI agent usage feat: add JSON Schema support for AI agent integration Mar 26, 2026
@glimow
Copy link
Copy Markdown
Member Author

glimow commented Mar 26, 2026

Merged into fix/paginated-json-output for a combined PR with pagination fixes and API client regeneration.

@glimow glimow closed this Mar 26, 2026
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