Skip to content

Make agent CLI command configurable#317

Merged
clcollins merged 4 commits into
mainfrom
srepd/configurable-agent-cli
Jun 9, 2026
Merged

Make agent CLI command configurable#317
clcollins merged 4 commits into
mainfrom
srepd/configurable-agent-cli

Conversation

@clcollins

Copy link
Copy Markdown
Owner

Summary

  • Add agent_cli_command config key (default: claude --print) so the /agent CLI subprocess is no longer hardcoded
  • Binary is resolved via exec.LookPath — works with full paths, toolbox commands, and alternative agent CLIs
  • Handler signature changed from hasClaudeCode func() bool to lookPath func(string) (string, error) for proper binary detection

Closes #307

Test plan

  • make test-all passes
  • golangci-lint clean
  • Default behavior unchanged — claude --print used when agent_cli_command not set
  • Custom command: set agent_cli_command: /full/path/to/claude --print in config
  • Missing binary: shows agent CLI "binary" not found on PATH in status

🤖 Generated with Claude Code

Replace the hardcoded exec.CommandContext(ctx, "claude", "--print")
with a configurable agent_cli_command config key (default: "claude
--print"). The binary is resolved via exec.LookPath so it works with
full paths, toolbox commands, and alternative agent CLIs.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@codecov-commenter

codecov-commenter commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.75%. Comparing base (591c436) to head (736950d).

Files with missing lines Patch % Lines
cmd/root.go 0.00% 2 Missing ⚠️
cmd/config.go 0.00% 1 Missing ⚠️
pkg/tui/model.go 50.00% 1 Missing ⚠️
pkg/tui/tui.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #317      +/-   ##
==========================================
+ Coverage   67.48%   67.75%   +0.27%     
==========================================
  Files          45       45              
  Lines        6885     6906      +21     
==========================================
+ Hits         4646     4679      +33     
+ Misses       1927     1915      -12     
  Partials      312      312              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

clcollins and others added 3 commits June 9, 2026 10:33
Log stderr as WARN and include it in the error message shown to the
user when the agent command fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Cover agentQuery: command parsing, empty command, command not found,
stderr capture, env var passing, stdin piping. Cover handleClaudePrompt:
default command fallback, custom command, toolbox-wrapped command.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clcollins clcollins merged commit 3844410 into main Jun 9, 2026
10 checks passed
@clcollins clcollins deleted the srepd/configurable-agent-cli branch June 9, 2026 20:53
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.

BUG: Agent CLI command is hardcoded — should be configurable like cluster_login_command

2 participants