Skip to content

Add agentic JSON output mode for AI agent integration#536

Open
danielsuguimoto wants to merge 1 commit into
kool-dev:mainfrom
danielsuguimoto:feat/agentic-output
Open

Add agentic JSON output mode for AI agent integration#536
danielsuguimoto wants to merge 1 commit into
kool-dev:mainfrom
danielsuguimoto:feat/agentic-output

Conversation

@danielsuguimoto

Copy link
Copy Markdown
Contributor
Issue N/A
🪲 Bug Fix No
🧰 Improvement Yes
🏆 Feature Yes
📝 Refactor No
❌ Removed No
📖 Documentation No
⚠️ Break Change No

Description
Adds a global --output json flag that enables machine-readable JSON output across kool commands, making the CLI suitable for use by AI agents and automation tools. When JSON mode is active, commands emit structured payloads instead of human-readable tables or text, diagnostics route to stderr to keep stdout clean for data, and interactive prompts are automatically disabled.

Commands with JSON output:

  • kool status: emits {"services":[...],"count":N} with service state, ports, and running status
  • kool logs: emits JSON Lines format ({"service":"...","message":"..."}) with streaming support for --follow
  • kool info: emits structured payload with kool/docker versions, binary paths, and environment variables (KOOL_API_TOKEN is redacted)
  • kool run: script listing works in JSON mode; script-not-found errors emit structured JSON to stderr with suggestions field

The existing --json flag on kool run is now hidden but remains functional for backwards compatibility, unified under the global --output json flag.


Notes

  • --output json is a global flag that must be placed before the script name when using kool run
  • Script output from kool run <script> remains raw (unstructured) as it passes through the underlying command output
  • The legacy --json flag on kool run is hidden but still works for backwards compatibility
  • All 306 tests pass with go vet clean

@github-actions github-actions Bot added release-drafter:added Release drafter: Added release-drafter:changed Release drafter: Changed release-drafter:minor Release drafter: Minor labels Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-drafter:added Release drafter: Added release-drafter:changed Release drafter: Changed release-drafter:minor Release drafter: Minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant