Skip to content

JGC-501 - Force non-interactive mode when CLI is invoked by an agent - #1573

Merged
ehl-jf merged 1 commit into
masterfrom
bugfix/JGC-501
Jun 15, 2026
Merged

ehl-jf merged 1 commit into
masterfrom
bugfix/JGC-501

Conversation

@ehl-jf

@ehl-jf ehl-jf commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Since v2.107.0, jf api (and any other command) prompts for interactive configuration when no server profile exists and $CI is not set. This causes automation scripts driven by AI agents (Claude Code, Cursor, Gemini, etc.) to hang waiting for a yes/no answer — even when --url and auth flags are supplied on the command line.

Root cause: ShouldOfferConfig() suppresses the prompt only for $CI=true. The existing DetectExecutionContext().IsAgent infrastructure — already used for AI-help rendering — was not consulted here.

Fix

Add a second early-return guard in ShouldOfferConfig() (common/cliutils/utils.go) that mirrors the CI check:

server config exists?            → no offer (unchanged)
CI=true?                         → no offer (unchanged)
DetectExecutionContext().IsAgent? → no offer  ← new
AskYesNo(…)                      → interactive prompt (unchanged for human TTY)

When the guard fires, the CLI skips the offer and proceeds. If no URL is known (not configured, not passed via --url), the existing fast-fail error fires normally — the script gets a non-zero exit code instead of hanging.


  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the master branch.
  • I used gofmt for formatting the code before submitting the pull request.

@ehl-jf ehl-jf added improvement Automatically generated release notes safe-to-test labels Jun 10, 2026
@ehl-jf
ehl-jf enabled auto-merge (squash) June 15, 2026 07:03
@ehl-jf
ehl-jf disabled auto-merge June 15, 2026 07:05
@ehl-jf
ehl-jf merged commit 8ccac4f into master Jun 15, 2026
9 of 11 checks passed
@ehl-jf
ehl-jf deleted the bugfix/JGC-501 branch June 15, 2026 07:22
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
jfrog-cli 2.109.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What changed in v2.109.0

> Auto-generated from 4 repositories · 2026-06-17  
> Comparing `v2.108.0` → `v2.109.0`

> ℹ️  No changes in: gofrog, jfrog-cli-security, jfrog-client-go

### ✨ New Features

- **[jfrog-cli]** Add AI-agent help text to mcp and uv commands [#3545](jfrog/jfrog-cli#3545) (@ehl-jf)
- **[jfrog-cli-artifactory]** JGC-492 - Add --format flag for release-bundle-create, promote, and distribute [#488](jfrog/jfrog-cli-artifactory#488) (@ehl-jf)

### 🐛 Bug Fixes

- **[build-info-go]** RTECO-1187 - Updated logic to skip cache check for empty depedency project [#392](jfrog/build-info-go#392) (@naveenku-jfrog)

### 📦 Other Changes

- **[jfrog-cli-core]** JGC-501 - Force non-interactive mode when CLI is invoked by an agent [#1573](jfrog/jfrog-cli-core#1573) (@ehl-jf)

---

### 📊 Summary

| Repository | Changes |
|---|---|
| [jfrog-cli](https://github.com/jfrog/jfrog-cli) | 1 |
| [build-info-go](https://github.com/jfrog/build-info-go) | 1 |
| [jfrog-cli-artifactory](https://github.com/jfrog/jfrog-cli-artifactory) | 1 |
| [jfrog-cli-core](https://github.com/jfrog/jfrog-cli-core) | 1 |
| **Total** | **4** |

### 🔗 Module Version Changes

| Module | From | To |
|---|---|---|
| [build-info-go](https://github.com/jfrog/build-info-go) | `v1.13.1-0.20260610071651-260ad6720e0d` | `v1.13.1-0.20260615080618-42488b58c305` |
| [jfrog-cli-artifactory](https://github.com/jfrog/jfrog-cli-artifactory) | `v0.8.1-0.20260610074911-82ce7d90edbd` | `v0.8.1-0.20260617065038-e7be947840da` |
| [jfrog-cli-core](https://github.com/jfrog/jfrog-cli-core) | `v2.60.1-0.20260609101026-df3091b39d06` | `v2.60.1-0.20260615072209-8ccac4f0072e` |
</pre>
  <p>View the full release notes at <a href="https://github.com/jfrog/jfrog-cli/releases/tag/v2.109.0">https://github.com/jfrog/jfrog-cli/releases/tag/v2.109.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!11786

This branch had an error being deployed

1 failed deployment
frogbot — 38becf42 Deployed Jun 11, 2026 by ehl-jf via scan-pull-request #2672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Automatically generated release notes safe-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants