Skip to content

feat: CLI stage handler (v0.23.3)#28

Merged
coredipper merged 1 commit intomainfrom
feat/cli-stage-handler
Mar 26, 2026
Merged

feat: CLI stage handler (v0.23.3)#28
coredipper merged 1 commit intomainfrom
feat/cli-stage-handler

Conversation

@coredipper
Copy link
Copy Markdown
Owner

Summary

Shell out to any CLI tool as an organism stage. Watcher, convergence detection, and developmental gating work unchanged on CLI-backed stages.

  • cli_handler(): wraps any CLI command as a SkillStage handler. Supports arg/stdin/none input modes, custom output parsers, configurable success codes, timeout detection.
  • cli_organism(): convenience for multi-CLI workflows via managed_organism().
  • _action_type convention: handlers can return {"_action_type": "FAILURE"} to signal failure to the organism, triggering halt_on_block.
  • 10 new tests (1151 total, zero regressions)
  • Example 83: CLI pipeline with echo, wc, failure detection, JSON parsing

🤖 Generated with Claude Code

Shell out to any CLI tool as an organism stage. The watcher,
convergence detection, and developmental gating all work unchanged
on CLI-backed stages.

cli_handler() — factory wrapping CLI commands as SkillStage handlers:
- input_mode: "arg" (append to command), "stdin" (pipe), "none"
- parse_output: optional callable for structured output
- success_codes: configurable (default: only 0)
- timeout with timed_out detection
- sanitize_task strips shell metacharacters by default

cli_organism() — convenience building ManagedOrganism from command dict

_action_type convention — handlers can signal FAILURE to the organism
by returning {"_action_type": "FAILURE"} in their output dict.
_coerce_handler_output() respects this, triggering halt_on_block.

- 10 new tests (1151 total, all passing)
- Example 83: CLI pipeline with echo, wc, failure detection, JSON parsing
- Bump version to 0.23.3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coredipper coredipper merged commit abe53ae into main 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