Add AI context description to commands#3503
Open
ehl-jf wants to merge 2 commits into
Open
Conversation
dfde4c1 to
2cba82a
Compare
Add a global --ai-help flag that, together with the JFROG_CLI_AI_HELP env var, switches the conversion layer in jfrog-cli-core to render AIDescription instead of Description. The argv pre-pass runs before getCommands() so the conversion layer (invoked during command setup) reads the env var early; urfave/cli's own flag parsing happens later inside app.Run, by which time command strings are already frozen. The flag deliberately omits EnvVar: urfave/cli's BoolFlag EnvVar binding parses the env value with strconv.ParseBool at startup and crashes on unparseable values (e.g. JFROG_CLI_AI_HELP=maybe). Our resolver in docs/common.AIHelpEnabled treats unparseable as a soft fall-back to detection - bypassing urfave/cli's binding preserves that gentler behavior. No AIDescription content is populated yet; that arrives via the follow-up backfill commit (umbrella subagent for help.go files and call-site rewrites).
2cba82a to
eae5fc3
Compare
4 tasks
BlasttS
reviewed
Jun 1, 2026
| The list should be comma-separated(,) in the form of user1,user2,... | ||
| ` | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Shouldn't all the changes below be in jfrog-cli-artifactory ?
https://github.com/jfrog/jfrog-cli-artifactory/blob/main/artifactory/docs/groupaddusers/help.go
Is there a reason we have this in CLI too ?
This applies to all help.go files.
Contributor
Author
There was a problem hiding this comment.
It is because the commands are not located in RT repo.
Contributor
Author
There was a problem hiding this comment.
Maybe they should someday.
eae5fc3 to
01b7665
Compare
This was referenced Jun 1, 2026
BlasttS
approved these changes
Jun 1, 2026
…l sites Builds on commit 0650eec (which added the --ai-help flag and argv pre-pass to main.go). This commit completes the umbrella's side of JGC-473 by: 1. Adding GetAIDescription() to 85 docs/<ns>/<cmd>/help.go files for all visible jfrog-cli local commands. 28 help.go files for hidden / deprecated / dead-code stubs were intentionally skipped. 2. Rewriting cli.Command literals in main.go and 7 */cli.go files to route Usage / HelpName through corecommon.ResolveDescription, so the conversion-layer mechanism in jfrog-cli-core applies to the umbrella's own urfave/cli-based commands (which don't go through components.Command). For namespace shells with hardcoded Usage strings (rt, mc, pl, c, etc.) new <name>AIUsage constants were introduced. 3. Adding JFROG_CLI_AI_HELP=false default in main_test.go's setupIntegrationTests so help-text assertions remain deterministic when the test runner inherits an AI agent's env (CLAUDECODE, CURSOR_AGENT, etc.). CI runners without agent env are unaffected. TEMPORARY go.mod state - REMOVE the 5 replace directives in the replace block before merge. Each points at the in-flight JGC-473 branch of the respective repo (jfrog-cli-core on JGC-473-devbase; 4 plugin repos on developer's fork because direct org push is not in scope for plugin repos). Once each repo's JGC-473 PR merges to its base branch, the require pinning is sufficient and these replaces MUST be removed. This PR MUST NOT merge until: (a) all 5 cross-repo JGC-473 PRs have merged, AND (b) the yarn-coordination break between core master and jfrog-cli-artifactory main is resolved upstream (RTECO-1035 follow-up).
01b7665 to
a662e89
Compare
|
|
||
| When to use: | ||
| - Modifying RBAC after the fact (adding repos, users, or actions to a permission target). | ||
| - Drift correction in GitOps-style RBAC management. |
Collaborator
There was a problem hiding this comment.
I couldn't find anything about GitOps-style RBAC management in the JFrog public documentation. Do we need to validate the text?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Top-of-stack PR for JGC-473. Adds AI-agent-oriented help text to the JFrog CLI as a whole.
Two commits:
--ai-helpglobal flag + argv pre-pass. Bridges--ai-helptoJFROG_CLI_AI_HELPbeforegetCommands()runs, since the conversion layer in jfrog-cli-core reads the env var during command setup.GetAIDescription()in 85 localdocs/<ns>/<cmd>/help.gofiles (28 hidden/dead-code stubs skipped) and rewrite ~85cli.Commandliterals inmain.go+ 7*/cli.gofiles to routeUsage/HelpNamethroughcorecommon.ResolveDescription(umbrella uses urfave/cli directly, notcomponents.Command). Namespace shells got<name>AIUsageconsts.main_test.goforcesJFROG_CLI_AI_HELP=falsein setup so help-text-asserting tests are deterministic under an AI-agent shell.Dependency status
requireto its master pseudo-versionv2.60.1-0.20260601130310-8d52a530da18— noreplace.replacedirectives ingo.modpoint at the in-flight JGC-473 branches of the plugin repos (on the developer's fork). Each must be dropped and re-pinned to the plugin's merged pseudo-version once that plugin's PR merges. Do not merge this PR until all four plugin PRs have merged and the replaces are removed.Blocking PRs (plugins)
Test plan
go build ./...cleango test ./...0 failures on a clean (non-agent) env. (The RTECO-1368TestVisibility_*_E2Etests are sensitive to the runner's agent env — they pass on CI and on a shell withoutCLAUDECODE/CURSOR_*.)CLAUDECODEauto-detect,--ai-helpflag, unparseable env value (graceful), namespace listings, runtime unaffected.jf rt upload,jf audit,jf evd create,jf apptrust ping,jf worker deploy.Out of scope (follow-ups)
Description:block instead of multi-line text inName:).apptrust version-rollbackdeclares 2 Arguments but Action requires 3 — pre-existing, separate fix.