mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
Fixes #245. Running ``headroom init -g`` with no supported agents on PATH previously produced a single-line ClickException that read like the -g flag had been removed: Error: No supported user init targets were auto-detected. Specify one explicitly. This left reporter #245 concluding the feature was gone. Replace that message with a structured diagnostic that: * states which scope (user / local) was tried * lists every target probed (claude, codex, copilot, openclaw) and the shutil.which() result for each * explicitly confirms that -g / --global is still a supported flag * shows the concrete per-target invocation for each agent (``headroom init -g claude``, ...) so the user knows the escape hatch The implementation factors ``detect_init_targets`` into a ``_probe_init_targets`` helper that returns ``[(name, which_result)]``. ``detect_init_targets`` keeps its existing signature so the test suite and external imports aren't broken; the new helper backs both the auto-detection path and the diagnostic error formatter. Unit tests in tests/test_cli/test_init_cli.py cover: * the end-to-end message shape (structural markers + every target name + the example invocation) * the local-scope variant omitting global-only agents (copilot / openclaw) * that found binaries are surfaced with their absolute path so users can debug cases where shutil.which returns an unexpected result No behavior change when at least one target is detected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test_init_cli.py | ||
| test_install_cli.py | ||
| test_main_help_version.py | ||
| test_mcp.py | ||
| test_wrap_aider.py | ||
| test_wrap_bridge.py | ||
| test_wrap_codex.py | ||
| test_wrap_copilot.py | ||
| test_wrap_openclaw.py | ||
| test_wrap_persistent.py | ||