How eduardolat/clancy works
Clancy is a command-line orchestrator for repeatedly running an AI coding agent until its output meets a stop condition or safety limit. The principal flow loads YAML settings, resolves a literal or file-based prompt, prepares the agent command, and runs it through a platform-specific process runner; the loop checks output and handles retries, delays, and timeouts. The CLI also generates a starter configuration and reports version metadata. The README documents example prompt templates; their use is not wired into the runtime flow shown here.
Main entry points: main.go CLI commands · runner.go Runner interface · config.go Config loading · loop.go Loop controller
Components 13
CLI entry
- CLI commands
cmd/clancy/main.go - Version metadata
internal/version/version.go
Configuration and input
- Config loading
internal/config/config.go - Prompt resolution
internal/config/config.go - Example prompts
prompts
Agent runtime
- Loop controller
internal/loop/loop.go - Runner interface
internal/runner/runner.go - Command execution
internal/runner/runner_unix.go - Windows execution
internal/runner/runner_windows.go
Other components
- CLI user
- YAML config
- Prompt file
- Agent process
Connections 13
- CLI user → CLI commands: invokes
README.md - CLI commands → Config loading: loads settings
cmd/clancy/main.go - CLI commands → Prompt resolution: resolves prompt
cmd/clancy/main.go - Config loading → YAML config: reads
internal/config/config.go - Prompt resolution → Prompt file: reads when configured
internal/config/config.go - CLI commands → Loop controller: starts
cmd/clancy/main.go - CLI commands → Runner interface: creates runner
cmd/clancy/main.go - CLI commands → Version metadata: reports
cmd/clancy/main.go - Loop controller → Runner interface: uses
internal/loop/loop.go - Runner interface → Command execution: implements on Unix
internal/runner/runner_unix.go - Runner interface → Windows execution: implements on Windows
internal/runner/runner_windows.go - Command execution → Agent process: runs command
internal/runner/runner_unix.go - Windows execution → Agent process: runs command
internal/runner/runner_windows.go