Skip to content

AX-1705 - Add JFrog CLI credential support to inject-instructions#36

Merged
MatanEden1 merged 14 commits into
mainfrom
AX-1705-Cursor-plugin-add-support-for-jf_cli
Jul 7, 2026
Merged

AX-1705 - Add JFrog CLI credential support to inject-instructions#36
MatanEden1 merged 14 commits into
mainfrom
AX-1705-Cursor-plugin-add-support-for-jf_cli

Conversation

@MatanEden1

Copy link
Copy Markdown
Collaborator

Replaces #29 — same change, now from a branch on jfrog/cursor-plugin directly instead of a fork branch.

What

Add support for JF_CLI

Why

Users who have the JFrog CLI configured but no env vars set were not getting agent guard instructions injected.

Validation

Test 1 — env vars only: Rename ~/.jfrog/jfrog-cli.conf.v6 to .v6.bak, run the script with env vars present, restore the file. Expect: Resolved credentials from environment variables.

Test 2 — jf config export fallback: With v6 present, run with JFROG_URL="" JF_URL="" JFROG_ACCESS_TOKEN="" JF_ACCESS_TOKEN="" as inline overrides. Expect: Resolved credentials via 'jf config export' and the full template injected in stdout.

Test 3 — no credentials: Rename v6 to .v6.bak and blank env vars inline. Expect: 'jf config export' failedNo JFrog credentials resolvedAgent Guard not enabled. Stdout must be {}. Restore the file after.

MatanEden1 and others added 10 commits June 22, 2026 16:00
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…jection validation

- inject-instructions.mjs: add 3s timeout on 'jf config export'; emit
  {} on template read failure (fail-closed, well-formed empty payload)
- jfrog-mcp-management.md: resolve servers via 'jf config show
  --format=json' instead of parsing ~/.jfrog/jfrog-cli.conf.v6; add
  Live-execution pre-flight rule; fix two typos
- add scripts/validate-hook-injector.mjs smoke test + CI workflow

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add Apache license URL line to inject-instructions.mjs and
  validate-hook-injector.mjs headers.
- Template: rename "gateway" -> "agent guard" throughout and
  JFROG_MCP_GATEWAY_REPO -> JFROG_AGENT_GUARD_REPO; describe
  --list-available output as compact TSV; use jf CLI server with
  "isDefault": true when multiple servers exist; fix the garbled
  --server clarification; restructure the Pre-flight <SERVER_ID> block
  into an ordered "stop at first match" list; add the case-sensitive
  package-scope and no-python3/2>&1 Key Rules.

Kept Cursor-specific mechanics (.cursor/mcp.json, mcpServers,
${env:VAR}, cursor agent mcp / Tools & MCPs UI, full_network notes).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Port the early JFROG_URL validation block from claude-plugin: warn and
exit with a single SessionStart payload when JFROG_URL is unset or has a
trailing slash, surfacing the misconfig before the MCP server fails with
a confusing DNS/double-slash error. Wording adapted to "restart Cursor".

Supply a JFROG_URL override in the validator's force-enable test so it
exercises the real template-injection path past the new URL check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…in-add-support-for-jf_cli

# Conflicts:
#	plugins/jfrog/templates/jfrog-mcp-management.md
The injector emits a flat { additional_context } object, not a
hookSpecificOutput/SessionStart wrapper, so the CI validation script
was failing on every run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@MatanEden1 MatanEden1 requested a review from yanivt-jfrog July 7, 2026 09:47
Comment thread .github/workflows/validate-inject-instructions.yml
Comment thread plugins/jfrog/scripts/inject-instructions.mjs
Comment thread plugins/jfrog/scripts/inject-instructions.mjs Outdated
Comment thread scripts/validate-hook-injector.mjs
Comment thread plugins/jfrog/templates/jfrog-mcp-management.md
Comment thread .github/workflows/validate-inject-instructions.yml Outdated
Comment thread plugins/jfrog/templates/jfrog-mcp-management.md
Comment thread plugins/jfrog/templates/jfrog-mcp-management.md
@MatanEden1 MatanEden1 requested a review from yanivt-jfrog July 7, 2026 11:48
MatanEden1 and others added 2 commits July 7, 2026 14:56
Reviewer asked for a comment on what this part does, in addition to
the function-level docstring covering the env-vars-first/jf-CLI
-fallback order.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…I fallback

jf config show/export only support --format=json from CLI 2.105.0
onward; older CLIs error on it. Reviewer flagged this as an
undocumented new hard requirement introduced by the jf-CLI credential
fallback.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@MatanEden1 MatanEden1 merged commit f4f9dad into main Jul 7, 2026
3 checks passed
@MatanEden1 MatanEden1 deleted the AX-1705-Cursor-plugin-add-support-for-jf_cli branch July 7, 2026 13:32
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.

2 participants