Shared DX + AX Contract
All 18 CLIs in the Keel Data Stack follow the same operational contract so both human operators (DX) and AI coding/data agents (AX) move seamlessly across tools without re-learning conventions.
1. Dual-Mode Output (--format auto|human|agent|json)
Section titled “1. Dual-Mode Output (--format auto|human|agent|json)”auto(default): renders readable colorized tables when connected to an interactive TTY, and switches automatically to clean, zero-ANSI structured output when piped or called by an agent.human: rich terminal formatting and progress summaries.agent: token-budgeted structured output designed to fit cleanly inside LLM context windows without noisy ASCII borders.json: deterministic machine-readable JSON envelopes for scripts and CI checks.
2. Strict stdout / stderr Separation
Section titled “2. Strict stdout / stderr Separation”stdoutemits pure data payloads only.stderrcarries progress indicators and file-write notices only.
Piping <tool> ... --format json | jq ... never breaks on stray log lines.
3. Actionable Error Envelopes
Section titled “3. Actionable Error Envelopes”Failures emit stable error codes (E_*), concise failure counts, bounded sample rows (never dumping millions of rows into an agent’s context), a concrete fix_hint, and a retryable boolean flag.
4. Zero Interactivity
Section titled “4. Zero Interactivity”Keel tools never hang on [y/N] prompts in CI or headless agent shells. Destructive or target-changing operations use explicit flags and dry-run plan commands.
5. Clean, Predictable Exit Codes
Section titled “5. Clean, Predictable Exit Codes”| Exit Code | Meaning |
|---|---|
0 |
Pass / clean check / migration verified |
1 |
Data quality, SQL audit, contract, or drift check failure |
2 |
I/O, connection, parse, CLI usage, or config error |
6. Embedded SKILL.md (<tool> skill)
Section titled “6. Embedded SKILL.md (<tool> skill)”Because docs drift from installed versions, every binary embeds its own SKILL.md so an agent always learns the exact behavior of the binary on $PATH.