From 0650eecbe0017b85abcb141ce17bf2e863eaf107 Mon Sep 17 00:00:00 2001 From: ehl-jf Date: Thu, 21 May 2026 14:04:07 +0200 Subject: [PATCH 1/2] JGC-473 - Add --ai-help flag and argv pre-pass for AI-mode help 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). --- main.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/main.go b/main.go index 0a5dbb7d9..ce11d0c4d 100644 --- a/main.go +++ b/main.go @@ -88,6 +88,18 @@ func execMain() error { return err } + // AI-help argv pre-pass: detect `--ai-help` (or `-ai-help`) anywhere in argv and + // pin the env var before getCommands() runs. The conversion layer calls + // corecommon.ResolveDescription during command setup, which reads this env + // var — by the time urfave/cli parses global flags inside app.Run, command + // strings have already been frozen. + for _, a := range os.Args[1:] { + if a == "--ai-help" || a == "-ai-help" { + _ = os.Setenv(corecommon.EnvAIHelp, "true") + break + } + } + // Set JFrog CLI's user-agent on the jfrog-client-go. clientutils.SetUserAgent(coreutils.GetCliUserAgent()) @@ -95,6 +107,17 @@ func execMain() error { app.Name = jfrogAppName app.Usage = "For full documentation, visit https://docs.jfrog.com/" app.Version = cliutils.GetVersion() + app.Flags = []cli.Flag{ + // EnvVar intentionally omitted: the argv pre-pass above already bridges + // --ai-help to JFROG_CLI_AI_HELP, and urfave/cli's BoolFlag EnvVar binding + // would crash startup on unparseable env values (e.g. JFROG_CLI_AI_HELP=maybe). + // Our resolver in docs/common.AIHelpEnabled treats unparseable as "fall back + // to detection" instead of erroring. + cli.BoolFlag{ + Name: "ai-help", + Usage: "Render agent-oriented help text. Also enabled by $JFROG_CLI_AI_HELP=true or when an AI agent is auto-detected.", + }, + } args := os.Args cliutils.SetCliExecutableName(args[0]) app.EnableBashCompletion = true From dfde4c12221e1ff49965931fdbfe3d2a7c0c4edb Mon Sep 17 00:00:00 2001 From: ehl-jf Date: Thu, 21 May 2026 16:41:26 +0200 Subject: [PATCH 2/2] JGC-473 - Add AIDescription content to umbrella commands and wire call sites Builds on commit 0650eecb (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///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 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). --- artifactory/cli.go | 60 ++++---- buildtools/cli.go | 136 +++++++++--------- completion/cli.go | 12 +- config/cli.go | 28 ++-- docs/artifactory/groupaddusers/help.go | 22 +++ docs/artifactory/groupcreate/help.go | 21 +++ docs/artifactory/groupdelete/help.go | 20 +++ .../permissiontargetcreate/help.go | 24 ++++ .../permissiontargetdelete/help.go | 23 +++ .../permissiontargettemplate/help.go | 20 +++ .../permissiontargetupdate/help.go | 23 +++ docs/artifactory/terraform/help.go | 22 +++ docs/artifactory/terraformconfig/help.go | 20 +++ docs/artifactory/transferconfig/help.go | 26 ++++ docs/artifactory/transferconfigmerge/help.go | 23 +++ docs/artifactory/transferfiles/help.go | 27 ++++ .../artifactory/transferplugininstall/help.go | 23 +++ docs/artifactory/transfersettings/help.go | 20 +++ docs/artifactory/twine/help.go | 23 +++ docs/artifactory/usercreate/help.go | 23 +++ docs/artifactory/userscreate/help.go | 23 +++ docs/artifactory/usersdelete/help.go | 22 +++ docs/buildtools/conan/help.go | 26 +++- docs/buildtools/conanconfig/help.go | 20 +++ docs/buildtools/docker/help.go | 28 ++++ docs/buildtools/dockerbuild/help.go | 25 +++- docs/buildtools/dockerlogin/help.go | 23 +++ docs/buildtools/dockerpull/help.go | 23 +++ docs/buildtools/dockerpush/help.go | 23 +++ docs/buildtools/dotnet/help.go | 24 ++++ docs/buildtools/dotnetconfig/help.go | 20 +++ docs/buildtools/gocommand/help.go | 24 ++++ docs/buildtools/goconfig/help.go | 20 +++ docs/buildtools/gopublish/help.go | 23 +++ docs/buildtools/gradle/help.go | 26 ++++ docs/buildtools/gradleconfig/help.go | 24 ++++ docs/buildtools/helmcommand/help.go | 25 ++++ docs/buildtools/huggingface/help.go | 20 +++ docs/buildtools/huggingfacedownload/help.go | 24 ++++ docs/buildtools/huggingfaceupload/help.go | 26 ++++ docs/buildtools/mvn/help.go | 26 ++++ docs/buildtools/mvnconfig/help.go | 24 ++++ docs/buildtools/npmci/help.go | 24 ++++ docs/buildtools/npmcommand/help.go | 28 ++++ docs/buildtools/npmconfig/help.go | 24 ++++ docs/buildtools/npminstall/help.go | 24 ++++ docs/buildtools/npmpublish/help.go | 23 +++ docs/buildtools/nuget/help.go | 24 ++++ docs/buildtools/nugetconfig/help.go | 20 +++ docs/buildtools/pipconfig/help.go | 20 +++ docs/buildtools/pipenvconfig/help.go | 19 +++ docs/buildtools/pipenvinstall/help.go | 22 +++ docs/buildtools/pipinstall/help.go | 23 +++ docs/buildtools/pnpmcommand/help.go | 23 +++ docs/buildtools/pnpmconfig/help.go | 21 +++ docs/buildtools/poetry/help.go | 24 ++++ docs/buildtools/poetryconfig/help.go | 20 +++ docs/buildtools/rubyconfig/help.go | 20 +++ docs/buildtools/yarn/help.go | 25 ++++ docs/buildtools/yarnconfig/help.go | 21 +++ docs/completion/bash/help.go | 21 +++ docs/completion/fish/help.go | 19 +++ docs/completion/zsh/help.go | 20 +++ docs/config/add/help.go | 26 ++++ docs/config/edit/help.go | 23 +++ docs/config/exportcmd/help.go | 21 +++ docs/config/importcmd/help.go | 20 +++ docs/config/remove/help.go | 24 ++++ docs/config/show/help.go | 25 ++++ docs/config/use/help.go | 20 +++ docs/general/api/help.go | 27 ++++ docs/general/login/help.go | 22 +++ docs/general/oidc/help.go | 27 +++- docs/general/stats/help.go | 26 +++- docs/general/summary/help.go | 19 +++ docs/general/token/help.go | 27 ++++ docs/missioncontrol/jpdadd/help.go | 23 +++ docs/missioncontrol/jpddelete/help.go | 21 +++ docs/missioncontrol/licenseacquire/help.go | 23 +++ docs/missioncontrol/licensedeploy/help.go | 24 ++++ docs/missioncontrol/licenserelease/help.go | 22 +++ docs/pipelines/status/help.go | 24 ++++ docs/pipelines/sync/help.go | 22 +++ docs/pipelines/syncstatus/help.go | 22 +++ docs/pipelines/trigger/help.go | 23 +++ docs/pipelines/version/help.go | 19 +++ docs/plugin/install/help.go | 23 +++ docs/plugin/publish/help.go | 22 +++ docs/plugin/uninstall/help.go | 20 +++ go.mod | 16 ++- go.sum | 24 ++-- main.go | 50 ++++--- main_test.go | 10 ++ missioncontrol/cli.go | 20 +-- pipelines/cli.go | 20 +-- plugins/cli.go | 12 +- 96 files changed, 2146 insertions(+), 181 deletions(-) diff --git a/artifactory/cli.go b/artifactory/cli.go index 287206636..09c4411be 100644 --- a/artifactory/cli.go +++ b/artifactory/cli.go @@ -378,8 +378,8 @@ func GetCommands() []cli.Command { { Name: "permission-target-template", Aliases: []string{"ptt"}, - Usage: permissiontargettemplate.GetDescription(), - HelpName: corecommon.CreateUsage("rt ptt", permissiontargettemplate.GetDescription(), permissiontargettemplate.Usage), + Usage: corecommon.ResolveDescription(permissiontargettemplate.GetDescription(), permissiontargettemplate.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt ptt", corecommon.ResolveDescription(permissiontargettemplate.GetDescription(), permissiontargettemplate.GetAIDescription()), permissiontargettemplate.Usage), UsageText: permissiontargettemplate.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -390,8 +390,8 @@ func GetCommands() []cli.Command { Name: "permission-target-create", Aliases: []string{"ptc"}, Flags: cliutils.GetCommandFlags(cliutils.PermissionTargetCreate), - Usage: permissiontargetcreate.GetDescription(), - HelpName: corecommon.CreateUsage("rt ptc", permissiontargetcreate.GetDescription(), permissiontargetcreate.Usage), + Usage: corecommon.ResolveDescription(permissiontargetcreate.GetDescription(), permissiontargetcreate.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt ptc", corecommon.ResolveDescription(permissiontargetcreate.GetDescription(), permissiontargetcreate.GetAIDescription()), permissiontargetcreate.Usage), UsageText: permissiontargetcreate.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -402,8 +402,8 @@ func GetCommands() []cli.Command { Name: "permission-target-update", Aliases: []string{"ptu"}, Flags: cliutils.GetCommandFlags(cliutils.PermissionTargetUpdate), - Usage: permissiontargetupdate.GetDescription(), - HelpName: corecommon.CreateUsage("rt ptu", permissiontargetupdate.GetDescription(), permissiontargetupdate.Usage), + Usage: corecommon.ResolveDescription(permissiontargetupdate.GetDescription(), permissiontargetupdate.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt ptu", corecommon.ResolveDescription(permissiontargetupdate.GetDescription(), permissiontargetupdate.GetAIDescription()), permissiontargetupdate.Usage), UsageText: permissiontargetupdate.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -414,8 +414,8 @@ func GetCommands() []cli.Command { Name: "permission-target-delete", Aliases: []string{"ptdel"}, Flags: cliutils.GetCommandFlags(cliutils.PermissionTargetDelete), - Usage: permissiontargetdelete.GetDescription(), - HelpName: corecommon.CreateUsage("rt ptdel", permissiontargetdelete.GetDescription(), permissiontargetdelete.Usage), + Usage: corecommon.ResolveDescription(permissiontargetdelete.GetDescription(), permissiontargetdelete.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt ptdel", corecommon.ResolveDescription(permissiontargetdelete.GetDescription(), permissiontargetdelete.GetAIDescription()), permissiontargetdelete.Usage), UsageText: permissiontargetdelete.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -425,8 +425,8 @@ func GetCommands() []cli.Command { { Name: "user-create", Flags: cliutils.GetCommandFlags(cliutils.UserCreate), - Usage: usercreate.GetDescription(), - HelpName: corecommon.CreateUsage("rt user-create", usercreate.GetDescription(), usercreate.Usage), + Usage: corecommon.ResolveDescription(usercreate.GetDescription(), usercreate.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt user-create", corecommon.ResolveDescription(usercreate.GetDescription(), usercreate.GetAIDescription()), usercreate.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Action: userCreateCmd, @@ -436,8 +436,8 @@ func GetCommands() []cli.Command { Name: "users-create", Aliases: []string{"uc"}, Flags: cliutils.GetCommandFlags(cliutils.UsersCreate), - Usage: userscreate.GetDescription(), - HelpName: corecommon.CreateUsage("rt uc", userscreate.GetDescription(), userscreate.Usage), + Usage: corecommon.ResolveDescription(userscreate.GetDescription(), userscreate.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt uc", corecommon.ResolveDescription(userscreate.GetDescription(), userscreate.GetAIDescription()), userscreate.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Action: usersCreateCmd, @@ -447,8 +447,8 @@ func GetCommands() []cli.Command { Name: "users-delete", Aliases: []string{"udel"}, Flags: cliutils.GetCommandFlags(cliutils.UsersDelete), - Usage: usersdelete.GetDescription(), - HelpName: corecommon.CreateUsage("rt udel", usersdelete.GetDescription(), usersdelete.Usage), + Usage: corecommon.ResolveDescription(usersdelete.GetDescription(), usersdelete.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt udel", corecommon.ResolveDescription(usersdelete.GetDescription(), usersdelete.GetAIDescription()), usersdelete.Usage), UsageText: usersdelete.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -459,8 +459,8 @@ func GetCommands() []cli.Command { Name: "group-create", Aliases: []string{"gc"}, Flags: cliutils.GetCommandFlags(cliutils.GroupCreate), - Usage: groupcreate.GetDescription(), - HelpName: corecommon.CreateUsage("rt gc", groupcreate.GetDescription(), groupcreate.Usage), + Usage: corecommon.ResolveDescription(groupcreate.GetDescription(), groupcreate.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt gc", corecommon.ResolveDescription(groupcreate.GetDescription(), groupcreate.GetAIDescription()), groupcreate.Usage), UsageText: groupcreate.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -471,8 +471,8 @@ func GetCommands() []cli.Command { Name: "group-add-users", Aliases: []string{"gau"}, Flags: cliutils.GetCommandFlags(cliutils.GroupAddUsers), - Usage: groupaddusers.GetDescription(), - HelpName: corecommon.CreateUsage("rt gau", groupaddusers.GetDescription(), groupaddusers.Usage), + Usage: corecommon.ResolveDescription(groupaddusers.GetDescription(), groupaddusers.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt gau", corecommon.ResolveDescription(groupaddusers.GetDescription(), groupaddusers.GetAIDescription()), groupaddusers.Usage), UsageText: groupaddusers.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -483,8 +483,8 @@ func GetCommands() []cli.Command { Name: "group-delete", Aliases: []string{"gdel"}, Flags: cliutils.GetCommandFlags(cliutils.GroupDelete), - Usage: groupdelete.GetDescription(), - HelpName: corecommon.CreateUsage("rt gdel", groupdelete.GetDescription(), groupdelete.Usage), + Usage: corecommon.ResolveDescription(groupdelete.GetDescription(), groupdelete.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt gdel", corecommon.ResolveDescription(groupdelete.GetDescription(), groupdelete.GetAIDescription()), groupdelete.Usage), UsageText: groupdelete.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -507,8 +507,8 @@ func GetCommands() []cli.Command { }, { Name: "transfer-settings", - Usage: transfersettings.GetDescription(), - HelpName: corecommon.CreateUsage("rt transfer-settings", transfersettings.GetDescription(), transfersettings.Usage), + Usage: corecommon.ResolveDescription(transfersettings.GetDescription(), transfersettings.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt transfer-settings", corecommon.ResolveDescription(transfersettings.GetDescription(), transfersettings.GetAIDescription()), transfersettings.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Action: transferSettingsCmd, @@ -517,8 +517,8 @@ func GetCommands() []cli.Command { { Name: "transfer-config", Flags: cliutils.GetCommandFlags(cliutils.TransferConfig), - Usage: transferconfig.GetDescription(), - HelpName: corecommon.CreateUsage("rt transfer-config", transferconfig.GetDescription(), transferconfig.Usage), + Usage: corecommon.ResolveDescription(transferconfig.GetDescription(), transferconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt transfer-config", corecommon.ResolveDescription(transferconfig.GetDescription(), transferconfig.GetAIDescription()), transferconfig.Usage), UsageText: transferconfig.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -528,8 +528,8 @@ func GetCommands() []cli.Command { { Name: "transfer-config-merge", Flags: cliutils.GetCommandFlags(cliutils.TransferConfigMerge), - Usage: transferconfigmerge.GetDescription(), - HelpName: corecommon.CreateUsage("rt transfer-config-merge", transferconfigmerge.GetDescription(), transferconfigmerge.Usage), + Usage: corecommon.ResolveDescription(transferconfigmerge.GetDescription(), transferconfigmerge.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt transfer-config-merge", corecommon.ResolveDescription(transferconfigmerge.GetDescription(), transferconfigmerge.GetAIDescription()), transferconfigmerge.Usage), UsageText: transferconfigmerge.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -539,8 +539,8 @@ func GetCommands() []cli.Command { { Name: "transfer-files", Flags: cliutils.GetCommandFlags(cliutils.TransferFiles), - Usage: transferfiles.GetDescription(), - HelpName: corecommon.CreateUsage("rt transfer-files", transferfiles.GetDescription(), transferfiles.Usage), + Usage: corecommon.ResolveDescription(transferfiles.GetDescription(), transferfiles.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt transfer-files", corecommon.ResolveDescription(transferfiles.GetDescription(), transferfiles.GetAIDescription()), transferfiles.Usage), UsageText: transferfiles.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -550,8 +550,8 @@ func GetCommands() []cli.Command { { Name: "transfer-plugin-install", Flags: cliutils.GetCommandFlags(cliutils.TransferInstall), - Usage: transferplugininstall.GetDescription(), - HelpName: corecommon.CreateUsage("rt transfer-plugin-install", transferplugininstall.GetDescription(), transferplugininstall.Usage), + Usage: corecommon.ResolveDescription(transferplugininstall.GetDescription(), transferplugininstall.GetAIDescription()), + HelpName: corecommon.CreateUsage("rt transfer-plugin-install", corecommon.ResolveDescription(transferplugininstall.GetDescription(), transferplugininstall.GetAIDescription()), transferplugininstall.Usage), UsageText: transferplugininstall.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), diff --git a/buildtools/cli.go b/buildtools/cli.go index fb74931d7..fb02828ec 100644 --- a/buildtools/cli.go +++ b/buildtools/cli.go @@ -117,8 +117,8 @@ func GetCommands() []cli.Command { Name: "mvn-config", Aliases: []string{"mvnc"}, Flags: cliutils.GetCommandFlags(cliutils.MvnConfig), - Usage: mvnconfig.GetDescription(), - HelpName: corecommon.CreateUsage("mvn-config", mvnconfig.GetDescription(), mvnconfig.Usage), + Usage: corecommon.ResolveDescription(mvnconfig.GetDescription(), mvnconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("mvn-config", corecommon.ResolveDescription(mvnconfig.GetDescription(), mvnconfig.GetAIDescription()), mvnconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -129,8 +129,8 @@ func GetCommands() []cli.Command { { Name: "mvn", Flags: cliutils.GetCommandFlags(cliutils.Mvn), - Usage: mvndoc.GetDescription(), - HelpName: corecommon.CreateUsage("mvn", mvndoc.GetDescription(), mvndoc.Usage), + Usage: corecommon.ResolveDescription(mvndoc.GetDescription(), mvndoc.GetAIDescription()), + HelpName: corecommon.CreateUsage("mvn", corecommon.ResolveDescription(mvndoc.GetDescription(), mvndoc.GetAIDescription()), mvndoc.Usage), UsageText: mvndoc.GetArguments(), ArgsUsage: common.CreateEnvVars(mvndoc.EnvVar...), SkipFlagParsing: true, @@ -145,8 +145,8 @@ func GetCommands() []cli.Command { Name: "gradle-config", Aliases: []string{"gradlec"}, Flags: cliutils.GetCommandFlags(cliutils.GradleConfig), - Usage: gradleconfig.GetDescription(), - HelpName: corecommon.CreateUsage("gradle-config", gradleconfig.GetDescription(), gradleconfig.Usage), + Usage: corecommon.ResolveDescription(gradleconfig.GetDescription(), gradleconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("gradle-config", corecommon.ResolveDescription(gradleconfig.GetDescription(), gradleconfig.GetAIDescription()), gradleconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -157,8 +157,8 @@ func GetCommands() []cli.Command { { Name: "gradle", Flags: cliutils.GetCommandFlags(cliutils.Gradle), - Usage: gradledoc.GetDescription(), - HelpName: corecommon.CreateUsage("gradle", gradledoc.GetDescription(), gradledoc.Usage), + Usage: corecommon.ResolveDescription(gradledoc.GetDescription(), gradledoc.GetAIDescription()), + HelpName: corecommon.CreateUsage("gradle", corecommon.ResolveDescription(gradledoc.GetDescription(), gradledoc.GetAIDescription()), gradledoc.Usage), UsageText: gradledoc.GetArguments(), ArgsUsage: common.CreateEnvVars(gradledoc.EnvVar...), SkipFlagParsing: true, @@ -170,8 +170,8 @@ func GetCommands() []cli.Command { Name: "yarn-config", Aliases: []string{"yarnc"}, Flags: cliutils.GetCommandFlags(cliutils.YarnConfig), - Usage: yarnconfig.GetDescription(), - HelpName: corecommon.CreateUsage("yarn-config", yarnconfig.GetDescription(), yarnconfig.Usage), + Usage: corecommon.ResolveDescription(yarnconfig.GetDescription(), yarnconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("yarn-config", corecommon.ResolveDescription(yarnconfig.GetDescription(), yarnconfig.GetAIDescription()), yarnconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -182,8 +182,8 @@ func GetCommands() []cli.Command { { Name: "yarn", Flags: cliutils.GetCommandFlags(cliutils.Yarn), - Usage: yarndocs.GetDescription(), - HelpName: corecommon.CreateUsage("yarn", yarndocs.GetDescription(), yarndocs.Usage), + Usage: corecommon.ResolveDescription(yarndocs.GetDescription(), yarndocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("yarn", corecommon.ResolveDescription(yarndocs.GetDescription(), yarndocs.GetAIDescription()), yarndocs.Usage), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, BashComplete: corecommon.CreateBashCompletionFunc(), @@ -194,8 +194,8 @@ func GetCommands() []cli.Command { Name: "nuget-config", Flags: cliutils.GetCommandFlags(cliutils.NugetConfig), Aliases: []string{"nugetc"}, - Usage: nugetconfig.GetDescription(), - HelpName: corecommon.CreateUsage("nuget-config", nugetconfig.GetDescription(), nugetconfig.Usage), + Usage: corecommon.ResolveDescription(nugetconfig.GetDescription(), nugetconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("nuget-config", corecommon.ResolveDescription(nugetconfig.GetDescription(), nugetconfig.GetAIDescription()), nugetconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -206,8 +206,8 @@ func GetCommands() []cli.Command { { Name: "nuget", Flags: cliutils.GetCommandFlags(cliutils.Nuget), - Usage: nugetdocs.GetDescription(), - HelpName: corecommon.CreateUsage("nuget", nugetdocs.GetDescription(), nugetdocs.Usage), + Usage: corecommon.ResolveDescription(nugetdocs.GetDescription(), nugetdocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("nuget", corecommon.ResolveDescription(nugetdocs.GetDescription(), nugetdocs.GetAIDescription()), nugetdocs.Usage), UsageText: nugetdocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -219,8 +219,8 @@ func GetCommands() []cli.Command { Name: "dotnet-config", Flags: cliutils.GetCommandFlags(cliutils.DotnetConfig), Aliases: []string{"dotnetc"}, - Usage: dotnetconfig.GetDescription(), - HelpName: corecommon.CreateUsage("dotnet-config", dotnetconfig.GetDescription(), dotnetconfig.Usage), + Usage: corecommon.ResolveDescription(dotnetconfig.GetDescription(), dotnetconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("dotnet-config", corecommon.ResolveDescription(dotnetconfig.GetDescription(), dotnetconfig.GetAIDescription()), dotnetconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -231,8 +231,8 @@ func GetCommands() []cli.Command { { Name: "dotnet", Flags: cliutils.GetCommandFlags(cliutils.Dotnet), - Usage: dotnetdocs.GetDescription(), - HelpName: corecommon.CreateUsage("dotnet", dotnetdocs.GetDescription(), dotnetdocs.Usage), + Usage: corecommon.ResolveDescription(dotnetdocs.GetDescription(), dotnetdocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("dotnet", corecommon.ResolveDescription(dotnetdocs.GetDescription(), dotnetdocs.GetAIDescription()), dotnetdocs.Usage), UsageText: dotnetdocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -244,8 +244,8 @@ func GetCommands() []cli.Command { Name: "go-config", Aliases: []string{"goc"}, Flags: cliutils.GetCommandFlags(cliutils.GoConfig), - Usage: goconfig.GetDescription(), - HelpName: corecommon.CreateUsage("go-config", goconfig.GetDescription(), goconfig.Usage), + Usage: corecommon.ResolveDescription(goconfig.GetDescription(), goconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("go-config", corecommon.ResolveDescription(goconfig.GetDescription(), goconfig.GetAIDescription()), goconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -256,8 +256,8 @@ func GetCommands() []cli.Command { { Name: "go", Flags: cliutils.GetCommandFlags(cliutils.Go), - Usage: gocommand.GetDescription(), - HelpName: corecommon.CreateUsage("go", gocommand.GetDescription(), gocommand.Usage), + Usage: corecommon.ResolveDescription(gocommand.GetDescription(), gocommand.GetAIDescription()), + HelpName: corecommon.CreateUsage("go", corecommon.ResolveDescription(gocommand.GetDescription(), gocommand.GetAIDescription()), gocommand.Usage), UsageText: gocommand.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -272,8 +272,8 @@ func GetCommands() []cli.Command { Name: "go-publish", Flags: cliutils.GetCommandFlags(cliutils.GoPublish), Aliases: []string{"gp"}, - Usage: gopublish.GetDescription(), - HelpName: corecommon.CreateUsage("go-publish", gopublish.GetDescription(), gopublish.Usage), + Usage: corecommon.ResolveDescription(gopublish.GetDescription(), gopublish.GetAIDescription()), + HelpName: corecommon.CreateUsage("go-publish", corecommon.ResolveDescription(gopublish.GetDescription(), gopublish.GetAIDescription()), gopublish.Usage), UsageText: gopublish.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -284,8 +284,8 @@ func GetCommands() []cli.Command { Name: "pip-config", Flags: cliutils.GetCommandFlags(cliutils.PipConfig), Aliases: []string{"pipc"}, - Usage: pipconfig.GetDescription(), - HelpName: corecommon.CreateUsage("pip-config", pipconfig.GetDescription(), pipconfig.Usage), + Usage: corecommon.ResolveDescription(pipconfig.GetDescription(), pipconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("pip-config", corecommon.ResolveDescription(pipconfig.GetDescription(), pipconfig.GetAIDescription()), pipconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -296,8 +296,8 @@ func GetCommands() []cli.Command { { Name: "pip", Flags: cliutils.GetCommandFlags(cliutils.PipInstall), - Usage: pipinstall.GetDescription(), - HelpName: corecommon.CreateUsage("pip", pipinstall.GetDescription(), pipinstall.Usage), + Usage: corecommon.ResolveDescription(pipinstall.GetDescription(), pipinstall.GetAIDescription()), + HelpName: corecommon.CreateUsage("pip", corecommon.ResolveDescription(pipinstall.GetDescription(), pipinstall.GetAIDescription()), pipinstall.Usage), UsageText: pipinstall.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -312,8 +312,8 @@ func GetCommands() []cli.Command { Name: "pipenv-config", Flags: cliutils.GetCommandFlags(cliutils.PipenvConfig), Aliases: []string{"pipec"}, - Usage: pipenvconfig.GetDescription(), - HelpName: corecommon.CreateUsage("pipenv-config", pipenvconfig.GetDescription(), pipenvconfig.Usage), + Usage: corecommon.ResolveDescription(pipenvconfig.GetDescription(), pipenvconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("pipenv-config", corecommon.ResolveDescription(pipenvconfig.GetDescription(), pipenvconfig.GetAIDescription()), pipenvconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -324,8 +324,8 @@ func GetCommands() []cli.Command { { Name: "pipenv", Flags: cliutils.GetCommandFlags(cliutils.PipenvInstall), - Usage: pipenvinstall.GetDescription(), - HelpName: corecommon.CreateUsage("pipenv", pipenvinstall.GetDescription(), pipenvinstall.Usage), + Usage: corecommon.ResolveDescription(pipenvinstall.GetDescription(), pipenvinstall.GetAIDescription()), + HelpName: corecommon.CreateUsage("pipenv", corecommon.ResolveDescription(pipenvinstall.GetDescription(), pipenvinstall.GetAIDescription()), pipenvinstall.Usage), UsageText: pipenvinstall.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -337,8 +337,8 @@ func GetCommands() []cli.Command { Name: "poetry-config", Flags: cliutils.GetCommandFlags(cliutils.PoetryConfig), Aliases: []string{"poc"}, - Usage: poetryconfig.GetDescription(), - HelpName: corecommon.CreateUsage("poetry-config", poetryconfig.GetDescription(), poetryconfig.Usage), + Usage: corecommon.ResolveDescription(poetryconfig.GetDescription(), poetryconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("poetry-config", corecommon.ResolveDescription(poetryconfig.GetDescription(), poetryconfig.GetAIDescription()), poetryconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -349,8 +349,8 @@ func GetCommands() []cli.Command { { Name: "poetry", Flags: cliutils.GetCommandFlags(cliutils.Poetry), - Usage: poetry.GetDescription(), - HelpName: corecommon.CreateUsage("poetry", poetry.GetDescription(), poetry.Usage), + Usage: corecommon.ResolveDescription(poetry.GetDescription(), poetry.GetAIDescription()), + HelpName: corecommon.CreateUsage("poetry", corecommon.ResolveDescription(poetry.GetDescription(), poetry.GetAIDescription()), poetry.Usage), UsageText: poetry.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -374,8 +374,8 @@ func GetCommands() []cli.Command { { Name: "helm", Flags: cliutils.GetCommandFlags(cliutils.Helm), - Usage: helmcommand.GetDescription(), - HelpName: corecommon.CreateUsage("helm", helmcommand.GetDescription(), helmcommand.Usage), + Usage: corecommon.ResolveDescription(helmcommand.GetDescription(), helmcommand.GetAIDescription()), + HelpName: corecommon.CreateUsage("helm", corecommon.ResolveDescription(helmcommand.GetDescription(), helmcommand.GetAIDescription()), helmcommand.Usage), UsageText: helmcommand.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -388,8 +388,8 @@ func GetCommands() []cli.Command { Name: "conan-config", Flags: cliutils.GetCommandFlags(cliutils.ConanConfig), Aliases: []string{"conanc"}, - Usage: conanconfig.GetDescription(), - HelpName: corecommon.CreateUsage("conan-config", conanconfig.GetDescription(), conanconfig.Usage), + Usage: corecommon.ResolveDescription(conanconfig.GetDescription(), conanconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("conan-config", corecommon.ResolveDescription(conanconfig.GetDescription(), conanconfig.GetAIDescription()), conanconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -401,8 +401,8 @@ func GetCommands() []cli.Command { Name: "conan", Hidden: false, Flags: cliutils.GetCommandFlags(cliutils.Conan), - Usage: conan.GetDescription(), - HelpName: corecommon.CreateUsage("conan", conan.GetDescription(), conan.Usage), + Usage: corecommon.ResolveDescription(conan.GetDescription(), conan.GetAIDescription()), + HelpName: corecommon.CreateUsage("conan", corecommon.ResolveDescription(conan.GetDescription(), conan.GetAIDescription()), conan.Usage), UsageText: conan.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -414,8 +414,8 @@ func GetCommands() []cli.Command { Name: "ruby-config", Flags: cliutils.GetCommandFlags(cliutils.RubyConfig), Aliases: []string{"rubyc"}, - Usage: rubyconfig.GetDescription(), - HelpName: corecommon.CreateUsage("ruby-config", rubyconfig.GetDescription(), rubyconfig.Usage), + Usage: corecommon.ResolveDescription(rubyconfig.GetDescription(), rubyconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("ruby-config", corecommon.ResolveDescription(rubyconfig.GetDescription(), rubyconfig.GetAIDescription()), rubyconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -427,8 +427,8 @@ func GetCommands() []cli.Command { Name: "npm-config", Flags: cliutils.GetCommandFlags(cliutils.NpmConfig), Aliases: []string{"npmc"}, - Usage: npmconfig.GetDescription(), - HelpName: corecommon.CreateUsage("npm-config", npmconfig.GetDescription(), npmconfig.Usage), + Usage: corecommon.ResolveDescription(npmconfig.GetDescription(), npmconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("npm-config", corecommon.ResolveDescription(npmconfig.GetDescription(), npmconfig.GetAIDescription()), npmconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -438,8 +438,8 @@ func GetCommands() []cli.Command { }, { Name: "npm", - Usage: npmcommand.GetDescription(), - HelpName: corecommon.CreateUsage("npm", npmcommand.GetDescription(), npmcommand.Usage), + Usage: corecommon.ResolveDescription(npmcommand.GetDescription(), npmcommand.GetAIDescription()), + HelpName: corecommon.CreateUsage("npm", corecommon.ResolveDescription(npmcommand.GetDescription(), npmcommand.GetAIDescription()), npmcommand.Usage), UsageText: npmcommand.GetArguments(), SkipFlagParsing: true, BashComplete: corecommon.CreateBashCompletionFunc("install", "i", "isntall", "add", "ci", "publish", "p"), @@ -457,8 +457,8 @@ func GetCommands() []cli.Command { Name: "pnpm-config", Flags: cliutils.GetCommandFlags(cliutils.PnpmConfig), Aliases: []string{"pnpmc"}, - Usage: pnpmconfig.GetDescription(), - HelpName: corecommon.CreateUsage("pnpm-config", pnpmconfig.GetDescription(), pnpmconfig.Usage), + Usage: corecommon.ResolveDescription(pnpmconfig.GetDescription(), pnpmconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("pnpm-config", corecommon.ResolveDescription(pnpmconfig.GetDescription(), pnpmconfig.GetAIDescription()), pnpmconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -469,8 +469,8 @@ func GetCommands() []cli.Command { { Name: "pnpm", Flags: cliutils.GetCommandFlags(cliutils.Pnpm), - Usage: pnpmcommand.GetDescription(), - HelpName: corecommon.CreateUsage("pnpm", pnpmcommand.GetDescription(), pnpmcommand.Usage), + Usage: corecommon.ResolveDescription(pnpmcommand.GetDescription(), pnpmcommand.GetAIDescription()), + HelpName: corecommon.CreateUsage("pnpm", corecommon.ResolveDescription(pnpmcommand.GetDescription(), pnpmcommand.GetAIDescription()), pnpmcommand.Usage), UsageText: pnpmcommand.GetArguments(), SkipFlagParsing: true, BashComplete: corecommon.CreateBashCompletionFunc("install", "i", "publish", "p"), @@ -480,8 +480,8 @@ func GetCommands() []cli.Command { { Name: "docker", Flags: cliutils.GetCommandFlags(cliutils.Docker), - Usage: docker.GetDescription(), - HelpName: corecommon.CreateUsage("docker", docker.GetDescription(), docker.Usage), + Usage: corecommon.ResolveDescription(docker.GetDescription(), docker.GetAIDescription()), + HelpName: corecommon.CreateUsage("docker", corecommon.ResolveDescription(docker.GetDescription(), docker.GetAIDescription()), docker.Usage), UsageText: docker.GetArguments(), SkipFlagParsing: skipFlagParsingForDockerCmd(), BashComplete: corecommon.CreateBashCompletionFunc("login", "push", "pull", "scan"), @@ -492,8 +492,8 @@ func GetCommands() []cli.Command { Name: "terraform-config", Flags: cliutils.GetCommandFlags(cliutils.TerraformConfig), Aliases: []string{"tfc"}, - Usage: terraformconfig.GetDescription(), - HelpName: corecommon.CreateUsage("terraform-config", terraformconfig.GetDescription(), terraformconfig.Usage), + Usage: corecommon.ResolveDescription(terraformconfig.GetDescription(), terraformconfig.GetAIDescription()), + HelpName: corecommon.CreateUsage("terraform-config", corecommon.ResolveDescription(terraformconfig.GetDescription(), terraformconfig.GetAIDescription()), terraformconfig.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Category: buildToolsCategory, @@ -505,8 +505,8 @@ func GetCommands() []cli.Command { Name: "terraform", Flags: cliutils.GetCommandFlags(cliutils.Terraform), Aliases: []string{"tf"}, - Usage: terraformdocs.GetDescription(), - HelpName: corecommon.CreateUsage("terraform", terraformdocs.GetDescription(), terraformdocs.Usage), + Usage: corecommon.ResolveDescription(terraformdocs.GetDescription(), terraformdocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("terraform", corecommon.ResolveDescription(terraformdocs.GetDescription(), terraformdocs.GetAIDescription()), terraformdocs.Usage), UsageText: terraformdocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -517,8 +517,8 @@ func GetCommands() []cli.Command { { Name: "twine", Flags: cliutils.GetCommandFlags(cliutils.Twine), - Usage: twinedocs.GetDescription(), - HelpName: corecommon.CreateUsage("twine", twinedocs.GetDescription(), twinedocs.Usage), + Usage: corecommon.ResolveDescription(twinedocs.GetDescription(), twinedocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("twine", corecommon.ResolveDescription(twinedocs.GetDescription(), twinedocs.GetAIDescription()), twinedocs.Usage), UsageText: twinedocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), SkipFlagParsing: true, @@ -529,8 +529,8 @@ func GetCommands() []cli.Command { { Name: "hugging-face", Aliases: []string{"hf"}, - HelpName: corecommon.CreateUsage("hugging-face", huggingface.GetDescription(), huggingface.Usage), - Description: huggingface.GetDescription(), + HelpName: corecommon.CreateUsage("hugging-face", corecommon.ResolveDescription(huggingface.GetDescription(), huggingface.GetAIDescription()), huggingface.Usage), + Description: corecommon.ResolveDescription(huggingface.GetDescription(), huggingface.GetAIDescription()), Hidden: false, Category: buildToolsCategory, Action: func(c *cli.Context) error { @@ -544,8 +544,8 @@ func GetCommands() []cli.Command { Name: "upload", Aliases: []string{"u"}, Flags: cliutils.GetCommandFlags(cliutils.HuggingFaceUpload), - HelpName: corecommon.CreateUsage("hf upload", huggingfaceuploaddocs.GetDescription(), huggingfaceuploaddocs.Usage), - Usage: huggingfaceuploaddocs.GetDescription(), + HelpName: corecommon.CreateUsage("hf upload", corecommon.ResolveDescription(huggingfaceuploaddocs.GetDescription(), huggingfaceuploaddocs.GetAIDescription()), huggingfaceuploaddocs.Usage), + Usage: corecommon.ResolveDescription(huggingfaceuploaddocs.GetDescription(), huggingfaceuploaddocs.GetAIDescription()), UsageText: huggingfaceuploaddocs.GetArguments(), Action: huggingFaceUploadCmd, }, @@ -553,8 +553,8 @@ func GetCommands() []cli.Command { Name: "download", Aliases: []string{"d"}, Flags: cliutils.GetCommandFlags(cliutils.HuggingFaceDownload), - HelpName: corecommon.CreateUsage("hf download", huggingfacedownloaddocs.GetDescription(), huggingfacedownloaddocs.Usage), - Usage: huggingfacedownloaddocs.GetDescription(), + HelpName: corecommon.CreateUsage("hf download", corecommon.ResolveDescription(huggingfacedownloaddocs.GetDescription(), huggingfacedownloaddocs.GetAIDescription()), huggingfacedownloaddocs.Usage), + Usage: corecommon.ResolveDescription(huggingfacedownloaddocs.GetDescription(), huggingfacedownloaddocs.GetAIDescription()), UsageText: huggingfacedownloaddocs.GetArguments(), Action: huggingFaceDownloadCmd, }, diff --git a/completion/cli.go b/completion/cli.go index 54c3b5d66..cd41259e5 100644 --- a/completion/cli.go +++ b/completion/cli.go @@ -17,8 +17,8 @@ func GetCommands() []cli.Command { { Name: "bash", Flags: cliutils.GetCommandFlags(cliutils.Completion), - Usage: bash_docs.GetDescription(), - HelpName: corecommon.CreateUsage("completion bash", bash_docs.GetDescription(), bash_docs.Usage), + Usage: corecommon.ResolveDescription(bash_docs.GetDescription(), bash_docs.GetAIDescription()), + HelpName: corecommon.CreateUsage("completion bash", corecommon.ResolveDescription(bash_docs.GetDescription(), bash_docs.GetAIDescription()), bash_docs.Usage), BashComplete: corecommon.CreateBashCompletionFunc(), Action: func(c *cli.Context) { bash.WriteBashCompletionScript(getInstallFlag(c)) @@ -27,8 +27,8 @@ func GetCommands() []cli.Command { { Name: "zsh", Flags: cliutils.GetCommandFlags(cliutils.Completion), - Usage: zsh_docs.GetDescription(), - HelpName: corecommon.CreateUsage("completion zsh", zsh_docs.GetDescription(), zsh_docs.Usage), + Usage: corecommon.ResolveDescription(zsh_docs.GetDescription(), zsh_docs.GetAIDescription()), + HelpName: corecommon.CreateUsage("completion zsh", corecommon.ResolveDescription(zsh_docs.GetDescription(), zsh_docs.GetAIDescription()), zsh_docs.Usage), BashComplete: corecommon.CreateBashCompletionFunc(), Action: func(c *cli.Context) { zsh.WriteZshCompletionScript(getInstallFlag(c)) @@ -37,8 +37,8 @@ func GetCommands() []cli.Command { { Name: "fish", Flags: cliutils.GetCommandFlags(cliutils.Completion), - Usage: fish_docs.GetDescription(), - HelpName: corecommon.CreateUsage("completion fish", fish_docs.GetDescription(), fish_docs.Usage), + Usage: corecommon.ResolveDescription(fish_docs.GetDescription(), fish_docs.GetAIDescription()), + HelpName: corecommon.CreateUsage("completion fish", corecommon.ResolveDescription(fish_docs.GetDescription(), fish_docs.GetAIDescription()), fish_docs.Usage), BashComplete: corecommon.CreateBashCompletionFunc(), Action: func(c *cli.Context) { fish.WriteFishCompletionScript(c, getInstallFlag(c)) diff --git a/config/cli.go b/config/cli.go index 0692d6a92..5477d86ee 100644 --- a/config/cli.go +++ b/config/cli.go @@ -39,58 +39,58 @@ func GetCommands() []cli.Command { return cliutils.GetSortedCommands(cli.CommandsByName{ { Name: "add", - Usage: add.GetDescription(), + Usage: corecommon.ResolveDescription(add.GetDescription(), add.GetAIDescription()), Flags: cliutils.GetCommandFlags(cliutils.AddConfig), - HelpName: corecommon.CreateUsage("c add", add.GetDescription(), add.Usage), + HelpName: corecommon.CreateUsage("c add", corecommon.ResolveDescription(add.GetDescription(), add.GetAIDescription()), add.Usage), BashComplete: corecommon.CreateBashCompletionFunc(), Action: addCmd, }, { Name: "edit", - Usage: edit.GetDescription(), + Usage: corecommon.ResolveDescription(edit.GetDescription(), edit.GetAIDescription()), Flags: cliutils.GetCommandFlags(cliutils.EditConfig), - HelpName: corecommon.CreateUsage("c edit", edit.GetDescription(), edit.Usage), + HelpName: corecommon.CreateUsage("c edit", corecommon.ResolveDescription(edit.GetDescription(), edit.GetAIDescription()), edit.Usage), BashComplete: corecommon.CreateBashCompletionFunc(commands.GetAllServerIds()...), Action: editCmd, }, { Name: "show", Aliases: []string{"s"}, - Usage: show.GetDescription(), + Usage: corecommon.ResolveDescription(show.GetDescription(), show.GetAIDescription()), Flags: cliutils.GetCommandFlags(cliutils.ConfigShow), - HelpName: corecommon.CreateUsage("c show", show.GetDescription(), show.Usage), + HelpName: corecommon.CreateUsage("c show", corecommon.ResolveDescription(show.GetDescription(), show.GetAIDescription()), show.Usage), BashComplete: corecommon.CreateBashCompletionFunc(commands.GetAllServerIds()...), Action: showCmd, }, { Name: "remove", Aliases: []string{"rm"}, - Usage: remove.GetDescription(), + Usage: corecommon.ResolveDescription(remove.GetDescription(), remove.GetAIDescription()), Flags: cliutils.GetCommandFlags(cliutils.DeleteConfig), - HelpName: corecommon.CreateUsage("c rm", remove.GetDescription(), remove.Usage), + HelpName: corecommon.CreateUsage("c rm", corecommon.ResolveDescription(remove.GetDescription(), remove.GetAIDescription()), remove.Usage), BashComplete: corecommon.CreateBashCompletionFunc(commands.GetAllServerIds()...), Action: deleteCmd, }, { Name: "import", Aliases: []string{"im"}, - Usage: importcmd.GetDescription(), - HelpName: corecommon.CreateUsage("c import", importcmd.GetDescription(), importcmd.Usage), + Usage: corecommon.ResolveDescription(importcmd.GetDescription(), importcmd.GetAIDescription()), + HelpName: corecommon.CreateUsage("c import", corecommon.ResolveDescription(importcmd.GetDescription(), importcmd.GetAIDescription()), importcmd.Usage), BashComplete: corecommon.CreateBashCompletionFunc(), Action: importCmd, }, { Name: "export", Aliases: []string{"ex"}, - Usage: exportcmd.GetDescription(), - HelpName: corecommon.CreateUsage("c export", exportcmd.GetDescription(), exportcmd.Usage), + Usage: corecommon.ResolveDescription(exportcmd.GetDescription(), exportcmd.GetAIDescription()), + HelpName: corecommon.CreateUsage("c export", corecommon.ResolveDescription(exportcmd.GetDescription(), exportcmd.GetAIDescription()), exportcmd.Usage), BashComplete: corecommon.CreateBashCompletionFunc(commands.GetAllServerIds()...), Action: exportCmd, }, { Name: "use", - Usage: use.GetDescription(), - HelpName: corecommon.CreateUsage("c use", use.GetDescription(), use.Usage), + Usage: corecommon.ResolveDescription(use.GetDescription(), use.GetAIDescription()), + HelpName: corecommon.CreateUsage("c use", corecommon.ResolveDescription(use.GetDescription(), use.GetAIDescription()), use.Usage), BashComplete: corecommon.CreateBashCompletionFunc(commands.GetAllServerIds()...), Action: useCmd, }, diff --git a/docs/artifactory/groupaddusers/help.go b/docs/artifactory/groupaddusers/help.go index 48a59cf0d..c80b5ebae 100644 --- a/docs/artifactory/groupaddusers/help.go +++ b/docs/artifactory/groupaddusers/help.go @@ -15,3 +15,25 @@ func GetArguments() string { The list should be comma-separated(,) in the form of user1,user2,... ` } + +func GetAIDescription() string { + return `Add one or more existing users to an existing group on the configured Artifactory server. + +When to use: +- Onboarding users into a team's group after they have been created. +- Adding service accounts to a release-manager group. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. +- The group and the users must already exist. + +Common patterns: + $ jf rt gau readers alice,bob,carol + +Gotchas: +- Users not already created on the server are not added; the command may succeed with a partial set. +- Existing memberships are preserved; this is additive, not a full replacement. + +Related: jf rt gc, jf rt gdel, jf rt user-create, jf rt uc` +} diff --git a/docs/artifactory/groupcreate/help.go b/docs/artifactory/groupcreate/help.go index 6f82be7f4..e57773627 100644 --- a/docs/artifactory/groupcreate/help.go +++ b/docs/artifactory/groupcreate/help.go @@ -10,3 +10,24 @@ func GetArguments() string { return ` group name The name of the new group.` } + +func GetAIDescription() string { + return `Create an empty user group on the configured Artifactory server. Add users to it with 'jf rt gau' afterward. + +When to use: +- Setting up new team groups before binding them to permission targets. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. + +Common patterns: + $ jf rt gc readers + $ jf rt gc release-managers + +Gotchas: +- Group names must be unique on the server. +- The group is created empty; member assignment is a separate 'jf rt gau' call. + +Related: jf rt gau, jf rt gdel, jf rt ptc` +} diff --git a/docs/artifactory/groupdelete/help.go b/docs/artifactory/groupdelete/help.go index 18d8f7941..52043bfcf 100644 --- a/docs/artifactory/groupdelete/help.go +++ b/docs/artifactory/groupdelete/help.go @@ -10,3 +10,23 @@ func GetArguments() string { return ` group name Group name to be deleted.` } + +func GetAIDescription() string { + return `Delete a user group from Artifactory. Users in the group are not deleted; they simply lose this group membership. + +When to use: +- Removing an obsolete team group during cleanup. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. + +Common patterns: + $ jf rt gdel old-team + +Gotchas: +- No undo; recreate via 'jf rt gc' and re-add users with 'jf rt gau' if needed. +- Deleting a group does not delete permission targets that reference it; those will lose the group as a principal silently. + +Related: jf rt gc, jf rt gau, jf rt ptu` +} diff --git a/docs/artifactory/permissiontargetcreate/help.go b/docs/artifactory/permissiontargetcreate/help.go index 8152e8a0c..b21e46264 100644 --- a/docs/artifactory/permissiontargetcreate/help.go +++ b/docs/artifactory/permissiontargetcreate/help.go @@ -12,3 +12,27 @@ func GetArguments() string { return ` template path Specifies the local file system path for the template file to be used for the permission target creation. The template can be created using the "` + coreutils.GetCliExecutableName() + ` rt ptt" command.` } + +func GetAIDescription() string { + return `Create a new permission target on the configured Artifactory server from a local JSON template. Permission targets bind repositories to users/groups with specified actions (read, deploy, delete, manage). + +When to use: +- Provisioning a new permission target during environment setup. +- Scripting RBAC alongside repository creation. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. +- A permission target JSON template (generate with 'jf rt ptt' or hand-write per the Artifactory schema). + +Common patterns: + $ jf rt ptc ./my-perm-target.json + $ jf rt ptc ./my-perm-target.json --vars=env=prod + +Gotchas: +- Fails if a permission target with the same name already exists; use 'jf rt ptu' to update. +- The JSON schema is strict; missing required fields produce a 400 from the server. +- --vars allows templated variable substitution (key=value pairs). + +Related: jf rt ptt, jf rt ptu, jf rt ptdel` +} diff --git a/docs/artifactory/permissiontargetdelete/help.go b/docs/artifactory/permissiontargetdelete/help.go index 3ebeacda6..33cb7d734 100644 --- a/docs/artifactory/permissiontargetdelete/help.go +++ b/docs/artifactory/permissiontargetdelete/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` permission target name Specifies the permission target that should be removed.` } + +func GetAIDescription() string { + return `Permanently remove a permission target from Artifactory. Affected users/groups lose the binding immediately on next request. + +When to use: +- Removing an obsolete permission target during cleanup. +- Resetting an RBAC misconfiguration before re-creating it. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. + +Common patterns: + $ jf rt ptdel my-perm-target + $ jf rt ptdel my-perm-target --quiet + +Gotchas: +- No undo; the permission target is gone. +- Removing a permission target does NOT delete the repos, users, or groups it referenced. +- --quiet skips the confirmation prompt; useful in CI. + +Related: jf rt ptc, jf rt ptu` +} diff --git a/docs/artifactory/permissiontargettemplate/help.go b/docs/artifactory/permissiontargettemplate/help.go index 3327e4a37..afffce9a4 100644 --- a/docs/artifactory/permissiontargettemplate/help.go +++ b/docs/artifactory/permissiontargettemplate/help.go @@ -10,3 +10,23 @@ func GetArguments() string { return ` template path Specifies the local file system path for the template file.` } + +func GetAIDescription() string { + return `Interactively generate a permission target JSON template at the specified local path. The template is the input for 'jf rt ptc' (create) and 'jf rt ptu' (update). Walks the user through repos, users, groups, and actions. + +When to use: +- First step in scripting permission target creation: produce the template, then edit and apply via ptc/ptu. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges to read repo lists during the interactive flow. + +Common patterns: + $ jf rt ptt ./my-perm-target.json + +Gotchas: +- This is an interactive command; does not work in non-TTY environments. +- The generated file is plain JSON; edit it before passing to ptc/ptu for production use. + +Related: jf rt ptc, jf rt ptu, jf rt ptdel` +} diff --git a/docs/artifactory/permissiontargetupdate/help.go b/docs/artifactory/permissiontargetupdate/help.go index 5d3555427..4d36462a7 100644 --- a/docs/artifactory/permissiontargetupdate/help.go +++ b/docs/artifactory/permissiontargetupdate/help.go @@ -12,3 +12,26 @@ func GetArguments() string { return ` template path Specifies the local file system path for the template file to be used for the permission target update. The template can be created using the "` + coreutils.GetCliExecutableName() + ` rt ptu" command.` } + +func GetAIDescription() string { + return `Replace an existing permission target's definition from a local JSON template. Differs from ptc in that the target must already exist. + +When to use: +- Modifying RBAC after the fact (adding repos, users, or actions to a permission target). +- Drift correction in GitOps-style RBAC management. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. +- The permission target must already exist (use 'jf rt ptc' otherwise). + +Common patterns: + $ jf rt ptu ./my-perm-target.json + $ jf rt ptu ./my-perm-target.json --vars=env=prod + +Gotchas: +- The update is a full replacement; missing fields revert to defaults. +- Failures roll back partially; verify with 'jf api /artifactory/api/v2/security/permissions/'. + +Related: jf rt ptt, jf rt ptc, jf rt ptdel` +} diff --git a/docs/artifactory/terraform/help.go b/docs/artifactory/terraform/help.go index f5dc4dbf2..1fe8085e6 100644 --- a/docs/artifactory/terraform/help.go +++ b/docs/artifactory/terraform/help.go @@ -10,3 +10,25 @@ func GetArguments() string { return ` terraform commands Arguments and options for the terraform command.` } + +func GetAIDescription() string { + return `Run a Terraform command (publish, etc.) through JFrog with module resolution against an Artifactory Terraform registry and optional build-info collection. + +When to use: +- Publishing Terraform modules to an Artifactory Terraform repo. +- Capturing build-info for IaC pipelines. + +Prerequisites: +- A local terraform binary. +- 'jf terraform-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf terraform publish --build-name=my-iac --build-number=3 + +Gotchas: +- 'jf terraform-config' must be run first. +- This command focuses on publish; for plan/apply, use terraform directly or wrap with --build-info collection. + +Related: jf terraform-config, jf rt build-publish` +} diff --git a/docs/artifactory/terraformconfig/help.go b/docs/artifactory/terraformconfig/help.go index 2a7c46bcd..259083025 100644 --- a/docs/artifactory/terraformconfig/help.go +++ b/docs/artifactory/terraformconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"terraform-config [command options]"} func GetDescription() string { return "Generate Terraform configuration" } + +func GetAIDescription() string { + return `Write a per-project Terraform configuration (.jfrog/projects/terraform.yaml) so 'jf terraform' resolves modules through an Artifactory Terraform registry. + +When to use: +- First-time setup of a Terraform project to use a private module registry. + +Prerequisites: +- A configured server. +- The Artifactory Terraform repository key. + +Common patterns: + $ jf terraform-config --server-id-resolve=my-server --repo-resolve=terraform-virtual --repo-deploy=terraform-local + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- The Terraform .terraformrc may need additional credentials for the Artifactory host; consult JFrog docs. + +Related: jf terraform` +} diff --git a/docs/artifactory/transferconfig/help.go b/docs/artifactory/transferconfig/help.go index 7b490046d..8cbb47e88 100644 --- a/docs/artifactory/transferconfig/help.go +++ b/docs/artifactory/transferconfig/help.go @@ -14,3 +14,29 @@ func GetArguments() string { The target server ID. The configuration will be imported to this server. [Warning] This action will wipe all Artifactory content in this target server.` } + +func GetAIDescription() string { + return `Export the full Artifactory configuration from a source server and import it into a target server. Used as the configuration phase of a self-hosted-to-cloud (or vice versa) migration. The target's existing content is wiped. + +When to use: +- Pre-step before 'jf rt transfer-files' in a cross-instance migration. +- One-shot configuration mirroring between two Artifactory instances. + +Prerequisites: +- Both source and target server IDs must be configured via 'jf c add' with admin tokens. +- The target server must be empty or expected to be overwritten. +- Source and target Artifactory versions must be compatible (consult JFrog migration docs). + +Common patterns: + $ jf rt transfer-config source-prod target-cloud + $ jf rt transfer-config source-prod target-cloud --include-repos="libs-*" --exclude-repos="*-deprecated" + $ jf rt transfer-config source-prod target-cloud --force + +Gotchas: +- DESTRUCTIVE on the target: existing repos, permissions, users, and other config are replaced. +- The command prompts for confirmation; --force skips it (dangerous). +- Run when the source server is quiet to avoid drift during the export. +- Does NOT transfer file content; pair with 'jf rt transfer-files' afterwards. + +Related: jf rt transfer-config-merge, jf rt transfer-files, jf rt transfer-settings` +} diff --git a/docs/artifactory/transferconfigmerge/help.go b/docs/artifactory/transferconfigmerge/help.go index 305506eaf..0126058a7 100644 --- a/docs/artifactory/transferconfigmerge/help.go +++ b/docs/artifactory/transferconfigmerge/help.go @@ -13,3 +13,26 @@ func GetArguments() string { target-server-id The target server ID. The configuration will be imported to this server.` } + +func GetAIDescription() string { + return `Merge repository and project definitions from a source Artifactory instance into a target instance non-destructively. Unlike 'transfer-config', this preserves existing target content and aborts on naming conflicts. + +When to use: +- Migrating selected projects/repos into an existing Artifactory deployment. +- Bringing two instances closer together without overwriting either side. + +Prerequisites: +- Both source and target server IDs configured with admin credentials. +- Compatible Artifactory versions on both sides. + +Common patterns: + $ jf rt transfer-config-merge source-prod target-cloud + $ jf rt transfer-config-merge source-prod target-cloud --include-projects="proj-*" --exclude-projects="legacy-*" + +Gotchas: +- Aborts and reports conflicts; resolve them manually before re-running. +- Only repos and projects are merged; permission targets, users, and other config are NOT. +- Run during low-traffic windows on the source to avoid mid-export drift. + +Related: jf rt transfer-config, jf rt transfer-files` +} diff --git a/docs/artifactory/transferfiles/help.go b/docs/artifactory/transferfiles/help.go index 0a83a26e5..ca02d7212 100644 --- a/docs/artifactory/transferfiles/help.go +++ b/docs/artifactory/transferfiles/help.go @@ -13,3 +13,30 @@ func GetArguments() string { target-server-id Server ID of the Artifactory instance to transfer to.` } + +func GetAIDescription() string { + return `Stream artifact contents from a source Artifactory to a target Artifactory. Designed for large-scale migrations: resumable, throttleable, and parallelized. Run AFTER 'jf rt transfer-config' so repo definitions exist on the target. + +When to use: +- Migrating petabytes of binary content from self-hosted to cloud (or between any two Artifactory instances). +- Resuming a previously interrupted transfer. + +Prerequisites: +- Both source and target server IDs configured with admin tokens. +- 'jf rt transfer-config' (or transfer-config-merge) already run so repos exist on the target. +- 'jf rt transfer-plugin-install' installed on the source server's primary node. +- 'jf rt transfer-settings' tuned for throughput. + +Common patterns: + $ jf rt transfer-files source-prod target-cloud + $ jf rt transfer-files source-prod target-cloud --include-repos="libs-*" --status + $ jf rt transfer-files source-prod target-cloud --status # check progress + +Gotchas: +- Requires the data-transfer plugin on the source (install via 'jf rt transfer-plugin-install'). +- Long-running; expect hours-to-days for large stores. Run inside a long-lived session (nohup, tmux, screen). +- Throughput is governed by 'jf rt transfer-settings'; defaults are conservative. +- Idempotent on file content but not on repo property changes; re-running after a target-side delete causes redelivery. + +Related: jf rt transfer-config, jf rt transfer-settings, jf rt transfer-plugin-install` +} diff --git a/docs/artifactory/transferplugininstall/help.go b/docs/artifactory/transferplugininstall/help.go index a23b54412..49ae7c39a 100644 --- a/docs/artifactory/transferplugininstall/help.go +++ b/docs/artifactory/transferplugininstall/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` server-id The ID of the source server, on which the plugin should be installed.` } + +func GetAIDescription() string { + return `Download the data-transfer Artifactory user plugin and install it on the primary node of the source Artifactory. Required as a one-time prep before 'jf rt transfer-files'. The plugin handles the actual byte streaming on the server side. + +When to use: +- One-time setup on the source server before starting a self-hosted-to-cloud migration. + +Prerequisites: +- Must be run on the same host as the source Artifactory's primary node (or with filesystem access to its etc/artifactory/plugins/ directory). +- Admin privileges on the source server. +- The source server ID is configured locally. + +Common patterns: + $ jf rt transfer-plugin-install source-prod + $ jf rt transfer-plugin-install source-prod --dir=/opt/jfrog/artifactory/var/etc/artifactory/plugins + +Gotchas: +- Must run as the user that owns the Artifactory installation; otherwise the file write fails. +- The plugin requires a Groovy plugins admin restart (or wait for the scheduled reload). +- This command only targets self-hosted instances; cloud-hosted sources need a different transfer mechanism. + +Related: jf rt transfer-files, jf rt transfer-settings` +} diff --git a/docs/artifactory/transfersettings/help.go b/docs/artifactory/transfersettings/help.go index 85fa4369f..1224583aa 100644 --- a/docs/artifactory/transfersettings/help.go +++ b/docs/artifactory/transfersettings/help.go @@ -5,3 +5,23 @@ var Usage = []string{"rt transfer-settings"} func GetDescription() string { return "Configure the settings for the 'jf rt transfer-files' command." } + +func GetAIDescription() string { + return `Interactively tune throughput settings (max parallel uploads, etc.) for 'jf rt transfer-files'. Settings are saved under ~/.jfrog/ and reused by subsequent transfer-files runs. + +When to use: +- Before kicking off a large transfer, to set realistic parallelism for the source server's capacity. +- Tuning ongoing transfers if throughput is too low or saturating the source. + +Prerequisites: +- A configured Artifactory server. + +Common patterns: + $ jf rt transfer-settings + +Gotchas: +- Interactive only; cannot be scripted directly. For automation, edit ~/.jfrog/transfer-settings.json directly. +- Settings apply across all subsequent transfer-files invocations. + +Related: jf rt transfer-files, jf rt transfer-config` +} diff --git a/docs/artifactory/twine/help.go b/docs/artifactory/twine/help.go index 8613cbbf6..273eeb908 100644 --- a/docs/artifactory/twine/help.go +++ b/docs/artifactory/twine/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` twine commands Arguments and options for the twine command.` } + +func GetAIDescription() string { + return `Run a Twine command (upload) through JFrog to publish Python distributions to an Artifactory PyPI repository, with optional build-info collection. + +When to use: +- Uploading wheels or sdists to a private PyPI repo. + +Prerequisites: +- A local twine binary (pip install twine). +- 'jf pip-config' or equivalent has the deploy repo set. +- A configured server. +- Built distributions in dist/ (use 'jf poetry build' or python setup.py sdist bdist_wheel). + +Common patterns: + $ jf twine upload dist/* + $ jf twine upload dist/* --build-name=my-pkg --build-number=1 + +Gotchas: +- The Artifactory PyPI repo must be the destination; the command does not auto-detect. +- Twine uses credentials from .pypirc; setting them via jf config is not automatic. + +Related: jf poetry, jf pip, jf rt build-publish` +} diff --git a/docs/artifactory/usercreate/help.go b/docs/artifactory/usercreate/help.go index bf213ecee..51c4796bd 100644 --- a/docs/artifactory/usercreate/help.go +++ b/docs/artifactory/usercreate/help.go @@ -5,3 +5,26 @@ var Usage = []string{"rt user-create "} func GetDescription() string { return "Create a new user" } + +func GetAIDescription() string { + return `Create a single internal user on the configured Artifactory server. Useful for ad-hoc provisioning; for bulk creation use 'jf rt uc' with a CSV file. + +When to use: +- One-off user creation from a script. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. + +Common patterns: + $ jf rt user-create alice 'S3cret!' alice@example.com + $ jf rt user-create alice 'S3cret!' alice@example.com --admin=true + $ jf rt user-create alice 'S3cret!' alice@example.com --groups=readers,writers + +Gotchas: +- Password is passed on the command line; consider 'jf rt uc' with a CSV or 'jf api' for safer handling. +- Email format is validated server-side; malformed addresses produce a 400. +- For external auth (LDAP/SAML), the user is created with the password but auth may still defer to the IdP. + +Related: jf rt uc, jf rt udel, jf rt gau, jf rt gc` +} diff --git a/docs/artifactory/userscreate/help.go b/docs/artifactory/userscreate/help.go index 68a2ff023..cbcdbc82a 100644 --- a/docs/artifactory/userscreate/help.go +++ b/docs/artifactory/userscreate/help.go @@ -5,3 +5,26 @@ var Usage = []string{"rt uc --csv "} func GetDescription() string { return "Create new users" } + +func GetAIDescription() string { + return `Bulk-create users from a CSV file. The CSV header must be 'username,password,email[,admin,groups]' and one user per row. + +When to use: +- Onboarding many users at once (organization migration, team scale-out). + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. +- A CSV with the expected columns. + +Common patterns: + $ jf rt uc --csv=./users.csv + $ jf rt uc --csv=./users.csv --replace=true + +Gotchas: +- The CSV is read line-by-line; one malformed row aborts the batch in default mode. +- --replace=true overwrites existing users with the same username (destructive). +- Passwords sit in plaintext in the CSV; protect the file and delete after use. + +Related: jf rt user-create, jf rt udel, jf rt gau` +} diff --git a/docs/artifactory/usersdelete/help.go b/docs/artifactory/usersdelete/help.go index 1a8f01692..e394f378f 100644 --- a/docs/artifactory/usersdelete/help.go +++ b/docs/artifactory/usersdelete/help.go @@ -10,3 +10,25 @@ func GetArguments() string { return ` users list Comma-separated(,) list of usernames to delete in the form of user1,user2,....` } + +func GetAIDescription() string { + return `Delete one or more users from Artifactory. Provide a comma-separated list inline or via a CSV file. + +When to use: +- Offboarding multiple users in one operation. + +Prerequisites: +- A configured Artifactory server. +- Admin privileges. + +Common patterns: + $ jf rt udel alice,bob,carol + $ jf rt udel --csv=./users.csv + $ jf rt udel alice --quiet + +Gotchas: +- No undo. Audit beforehand with 'jf api /artifactory/api/security/users'. +- Deleting a user does NOT revoke long-lived access tokens issued to that user; rotate or revoke those separately. + +Related: jf rt user-create, jf rt uc, jf rt gdel` +} diff --git a/docs/buildtools/conan/help.go b/docs/buildtools/conan/help.go index cf315c04e..32368e871 100644 --- a/docs/buildtools/conan/help.go +++ b/docs/buildtools/conan/help.go @@ -9,8 +9,32 @@ func GetDescription() string { func GetArguments() string { return ` conan sub-command Arguments and options for the conan command. - + Examples: - jf conan install . --build=missing - jf conan create . --name=hello --version=1.0` } + +func GetAIDescription() string { + return `Run a Conan C/C++ package manager command through JFrog, with remote resolution against an Artifactory Conan repository and optional build-info collection. + +When to use: +- Resolving Conan dependencies from a private Conan repo. +- Producing build-info for C/C++ projects. + +Prerequisites: +- A local conan binary (Conan 1.x or 2.x). +- 'jf conan-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf conan install . --build=missing + $ jf conan create . --name=hello --version=1.0 + $ jf conan upload mypkg/1.0@ --build-name=my-build --build-number=1 + +Gotchas: +- 'jf conan-config' must be run first. +- Conan 1.x and 2.x have different command syntax; jf passes args through verbatim. + +Related: jf conan-config, jf rt build-publish` +} diff --git a/docs/buildtools/conanconfig/help.go b/docs/buildtools/conanconfig/help.go index cca8dfc57..dc5e8c464 100644 --- a/docs/buildtools/conanconfig/help.go +++ b/docs/buildtools/conanconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"conan-config [command options]"} func GetDescription() string { return "Generate conan build configuration." } + +func GetAIDescription() string { + return `Write a per-project Conan configuration (.jfrog/projects/conan.yaml) and configure the local Conan remote so 'jf conan' resolves through an Artifactory Conan repository. + +When to use: +- First-time setup of a C/C++ project using Conan against a private Artifactory Conan repo. + +Prerequisites: +- A configured server. +- The Artifactory Conan repository key. + +Common patterns: + $ jf conan-config --server-id-resolve=my-server --repo-resolve=conan-virtual + +Gotchas: +- Modifies the local Conan remotes configuration (~/.conan/remotes.json or equivalent). +- Interactive prompts trigger when required flags are missing. + +Related: jf conan, jf rt build-publish` +} diff --git a/docs/buildtools/docker/help.go b/docs/buildtools/docker/help.go index a91519f6d..792818197 100644 --- a/docs/buildtools/docker/help.go +++ b/docs/buildtools/docker/help.go @@ -13,3 +13,31 @@ func GetArguments() string { pull Run docker pull. scan Scan a local Docker image for security vulnerabilities with JFrog Xray.` } + +func GetAIDescription() string { + return `Wrap the local docker binary for build, push, pull, login, and scan subcommands. Push and pull can collect build-info; scan delegates to Xray for a local image security scan. + +When to use: +- Building and pushing Docker images to an Artifactory Docker registry with build-info. +- Logging into an Artifactory Docker registry using the configured server credentials. +- Scanning a locally built image with Xray before publishing. + +Prerequisites: +- A local docker daemon and CLI. +- A configured server (for login/push/pull, the server's Docker registry URL must be set up). +- For scan: Xray reachable from the configured server. + +Common patterns: + $ jf docker login my-docker-registry.jfrog.io --server-id=my-server + $ jf docker build -t my-docker-registry.jfrog.io/my-image:1.0 . + $ jf docker push my-docker-registry.jfrog.io/my-image:1.0 --build-name=my-build --build-number=1 + $ jf docker pull my-docker-registry.jfrog.io/my-image:1.0 --build-name=my-build --build-number=1 + $ jf docker scan my-image:1.0 + +Gotchas: +- 'docker scan' is a JFrog extension, not the docker upstream 'scan' subcommand; behaviors differ. +- Push/pull collect build-info only when --build-name and --build-number are present. +- docker buildx (BuildKit) is supported but multi-platform manifests need extra care with build-info. + +Related: jf dl, jf docker-promote, jf xr docker-scan` +} diff --git a/docs/buildtools/dockerbuild/help.go b/docs/buildtools/dockerbuild/help.go index f0b08c8f9..e479c8787 100644 --- a/docs/buildtools/dockerbuild/help.go +++ b/docs/buildtools/dockerbuild/help.go @@ -14,7 +14,30 @@ func GetDescription() string { func GetArguments() string { return ` docker build args The docker build arguments to run docker build. Standard Docker build arguments are supported. - + All standard Docker build arguments are required and supported and are passed through to the Docker daemon. The command also supports 'docker buildx build' for multi-platform builds.` } + +func GetAIDescription() string { + return `Build a Docker image (or buildx multi-platform image) and capture build-info for traceability. Wraps 'docker build' and 'docker buildx build'. + +When to use: +- Building images that need to be tracked alongside other artifacts in a JFrog build. +- Multi-platform builds via buildx with --push to Artifactory. + +Prerequisites: +- A local docker (or buildx) daemon. +- For build-info: --build-name and --build-number passed together. + +Common patterns: + $ jf docker build -t my-image:1.0 . + $ jf docker build -t my-image:1.0 --build-name=my-build --build-number=1 . + $ jf docker buildx build -t my-image:1.0 --platform linux/amd64,linux/arm64 --push . + +Gotchas: +- Build-info captures layers and image digest at build time; subsequent pushes are tracked separately. +- buildx multi-platform builds require --push (cannot --load into local daemon). + +Related: jf docker push, jf docker pull, jf rt build-publish` +} diff --git a/docs/buildtools/dockerlogin/help.go b/docs/buildtools/dockerlogin/help.go index 0131458b1..a24bb0ff8 100644 --- a/docs/buildtools/dockerlogin/help.go +++ b/docs/buildtools/dockerlogin/help.go @@ -14,3 +14,26 @@ func GetArguments() string { return ` You can optionally specify a registry. If not provided, the registry from the JFrog config server-id is used. This argument is mandatory when logging in with a username and password.` } + +func GetAIDescription() string { + return `Authenticate the local docker daemon against an Artifactory Docker registry, reusing credentials from the configured jf server. Skips re-typing username/password and avoids leaving them in shell history. + +When to use: +- Setting up Docker auth on a developer machine after 'jf c add'. +- CI runners that need a docker login before push/pull. + +Prerequisites: +- A configured server (jf c add or jf login). +- A docker daemon running. + +Common patterns: + $ jf docker login --server-id=my-server + $ jf docker login my-docker-registry.jfrog.io --server-id=my-server + $ jf docker login my-docker-registry.jfrog.io --username=alice --password=secret + +Gotchas: +- The registry host must be a Docker repository host on the platform; the platform base URL is NOT a docker registry. +- Credentials are written into the local docker config (~/.docker/config.json) in plaintext or via a credential helper. + +Related: jf docker push, jf docker pull, jf c add` +} diff --git a/docs/buildtools/dockerpull/help.go b/docs/buildtools/dockerpull/help.go index 2bac6666f..c8f1ce7d5 100644 --- a/docs/buildtools/dockerpull/help.go +++ b/docs/buildtools/dockerpull/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` docker pull args The docker pull args to run docker pull.` } + +func GetAIDescription() string { + return `Pull a Docker image from an Artifactory Docker registry and optionally record it in build-info. + +When to use: +- Pulling images from a private registry with build-info attached. +- Tracking what was pulled during a CI job. + +Prerequisites: +- A local docker daemon. +- 'jf docker login' or equivalent docker credentials. +- For build-info: --build-name and --build-number together. + +Common patterns: + $ jf docker pull my-docker-registry.jfrog.io/my-image:1.0 + $ jf docker pull my-docker-registry.jfrog.io/my-image:1.0 --build-name=my-build --build-number=1 + +Gotchas: +- Without authentication to the registry, the daemon falls back to anonymous and fails on private repos. +- Image must be tagged with the full registry host for jf to associate it with the right server. + +Related: jf docker push, jf docker login` +} diff --git a/docs/buildtools/dockerpush/help.go b/docs/buildtools/dockerpush/help.go index a4e0eb3bd..100cd776c 100644 --- a/docs/buildtools/dockerpush/help.go +++ b/docs/buildtools/dockerpush/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` docker push args The docker push args to run docker push.` } + +func GetAIDescription() string { + return `Push a Docker image to an Artifactory Docker registry and optionally record it in build-info. + +When to use: +- Publishing built images to a private Docker repo. +- Capturing the image digest in build-info for downstream traceability. + +Prerequisites: +- A local docker daemon. +- 'jf docker login' or equivalent docker credentials. +- For build-info: --build-name and --build-number together. + +Common patterns: + $ jf docker push my-docker-registry.jfrog.io/my-image:1.0 + $ jf docker push my-docker-registry.jfrog.io/my-image:1.0 --build-name=my-build --build-number=1 + +Gotchas: +- Image tag must include the full registry host that matches the configured server's Docker registry. +- buildx multi-platform manifests push differently; prefer 'jf docker build' with --push for those. + +Related: jf docker pull, jf docker build, jf rt build-publish` +} diff --git a/docs/buildtools/dotnet/help.go b/docs/buildtools/dotnet/help.go index 59d388616..fc19ff95b 100644 --- a/docs/buildtools/dotnet/help.go +++ b/docs/buildtools/dotnet/help.go @@ -10,3 +10,27 @@ func GetArguments() string { return ` dotnet sub-command Arguments and options for the dotnet command.` } + +func GetAIDescription() string { + return `Run a .NET CLI command (restore, build, pack, push) through JFrog: package restoration is routed via Artifactory and optional build-info is collected. + +When to use: +- Building .NET Core/SDK projects that consume NuGet packages from Artifactory. +- Capturing build-info for .NET pipelines. + +Prerequisites: +- The .NET SDK installed (dotnet on PATH). +- 'jf dotnet-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf dotnet restore MyApp.sln + $ jf dotnet build --build-name=my-app --build-number=4 + $ jf dotnet pack --configuration Release + +Gotchas: +- 'jf dotnet-config' must be run first. +- Mixing 'jf nuget' and 'jf dotnet' configs in the same directory can create confused resolution. + +Related: jf dotnet-config, jf nuget` +} diff --git a/docs/buildtools/dotnetconfig/help.go b/docs/buildtools/dotnetconfig/help.go index a7cc8fe9e..e6988115f 100644 --- a/docs/buildtools/dotnetconfig/help.go +++ b/docs/buildtools/dotnetconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"dotnet-config [command options]"} func GetDescription() string { return "Generate dotnet configuration." } + +func GetAIDescription() string { + return `Write a per-project .NET configuration (.jfrog/projects/dotnet.yaml) so 'jf dotnet' resolves NuGet packages through Artifactory. + +When to use: +- First-time setup of a .NET SDK project. + +Prerequisites: +- A configured server. +- The Artifactory NuGet repository key. + +Common patterns: + $ jf dotnet-config --server-id-resolve=my-server --repo-resolve=nuget-virtual + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- For older nuget.exe projects, use 'jf nuget-config' instead. + +Related: jf dotnet, jf nuget-config` +} diff --git a/docs/buildtools/gocommand/help.go b/docs/buildtools/gocommand/help.go index e23c95f95..cd4e583e9 100644 --- a/docs/buildtools/gocommand/help.go +++ b/docs/buildtools/gocommand/help.go @@ -10,3 +10,27 @@ func GetArguments() string { return ` go commands Arguments and options for the go command.` } + +func GetAIDescription() string { + return `Run a go command (build, test, mod download) through JFrog: module downloads resolve via an Artifactory Go repository (GOPROXY), with optional build-info collection. + +When to use: +- Building Go projects that should resolve modules from a private Artifactory Go repo. +- Producing build-info for Go modules. + +Prerequisites: +- A local go toolchain. +- 'jf go-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf go build ./... + $ jf go test ./... + $ jf go build --build-name=my-svc --build-number=12 + +Gotchas: +- 'jf go-config' must be run first; it sets GOPROXY for the go invocation. +- For private modules, GOPRIVATE should be set explicitly in your environment. + +Related: jf go-config, jf go-publish, jf rt build-publish` +} diff --git a/docs/buildtools/goconfig/help.go b/docs/buildtools/goconfig/help.go index 9a2447736..93ae8e4d6 100644 --- a/docs/buildtools/goconfig/help.go +++ b/docs/buildtools/goconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"go-config [command options]"} func GetDescription() string { return "Generate go build configuration." } + +func GetAIDescription() string { + return `Write a per-project Go configuration (.jfrog/projects/go.yaml) so 'jf go' uses an Artifactory Go repository for module resolution and 'jf go-publish' for publish. + +When to use: +- Initial setup of a Go project to use a private module proxy. + +Prerequisites: +- A configured server. +- The Artifactory Go repository key. + +Common patterns: + $ jf go-config --server-id-resolve=my-server --repo-resolve=go-virtual --repo-deploy=go-local + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- 'jf go' will set GOPROXY based on this config; other go invocations are unaffected. + +Related: jf go, jf go-publish` +} diff --git a/docs/buildtools/gopublish/help.go b/docs/buildtools/gopublish/help.go index 1435ffca4..838dd3a34 100644 --- a/docs/buildtools/gopublish/help.go +++ b/docs/buildtools/gopublish/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` project version Package version to be published.` } + +func GetAIDescription() string { + return `Publish a Go module (and optionally its dependencies) to an Artifactory Go repository. The version argument is the semver tag attached to the module in the repository. + +When to use: +- Releasing a new version of a Go module to a private Artifactory Go repo. + +Prerequisites: +- A configured server. +- 'jf go-config' must be run with --repo-deploy set. +- A go.mod in the project root. + +Common patterns: + $ jf gp v1.2.3 + $ jf gp v1.2.3 --deps=ALL:ALL --build-name=my-svc --build-number=12 + +Gotchas: +- The version must follow Go module versioning (vMAJOR.MINOR.PATCH); without 'v' prefix go tooling will reject it. +- --deps publishes dependency versions in addition to the module itself; usually optional. +- Republishing the same version is rejected by Artifactory's Go repository. + +Related: jf go, jf go-config, jf rt build-publish` +} diff --git a/docs/buildtools/gradle/help.go b/docs/buildtools/gradle/help.go index 7f9b5cfe4..982388374 100644 --- a/docs/buildtools/gradle/help.go +++ b/docs/buildtools/gradle/help.go @@ -14,3 +14,29 @@ func GetArguments() string { return ` tasks and options Tasks and options to run with gradle command. For example, -b path/to/build.gradle.` } + +func GetAIDescription() string { + return `Run a Gradle build with JFrog instrumentation: resolves dependencies and publishes artifacts via Artifactory, optionally collecting build-info. Wraps the local gradle binary; tasks and flags after the command are passed through. + +When to use: +- Building Gradle projects that resolve and publish to Artifactory. +- Producing a JFrog build-info record alongside the publish. + +Prerequisites: +- A local gradle binary on PATH (or use the project's gradlew). +- 'jf gradle-config' run once in the project directory. +- A configured server referenced by 'jf gradle-config'. + +Common patterns: + $ jf gradle clean build + $ jf gradle artifactoryPublish --build-name=my-build --build-number=1 + $ jf gradle build -b path/to/build.gradle + +Gotchas: +- 'jf gradle-config' must be run first; the command fails with a clear error if missing. +- --build-name and --build-number are required together for build-info. +- Gradle daemon caches can hide config changes; use --no-daemon when debugging. +- Set JFROG_CLI_RELEASES_REPO to fetch the Gradle extractor through a private repo (air-gapped builds). + +Related: jf gradle-config, jf rt build-publish` +} diff --git a/docs/buildtools/gradleconfig/help.go b/docs/buildtools/gradleconfig/help.go index 025eb4604..cf3a009ea 100644 --- a/docs/buildtools/gradleconfig/help.go +++ b/docs/buildtools/gradleconfig/help.go @@ -5,3 +5,27 @@ var Usage = []string{"gradle-config [command options]"} func GetDescription() string { return "Generate gradle build configuration." } + +func GetAIDescription() string { + return `Write a per-project Gradle configuration file (.jfrog/projects/gradle.yaml) that points 'jf gradle' at the right Artifactory server and repositories for resolution and deployment. + +When to use: +- Initial setup of a Gradle project to build through JFrog. +- Switching an existing project to a different repository or server. + +Prerequisites: +- A configured server. +- The resolver and deployer repository keys in Artifactory. +- Run from the project root. + +Common patterns: + $ jf gradle-config --server-id-resolve=my-server --repo-resolve=libs-release --repo-deploy=libs-snapshot + $ jf gradle-config --global + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- --global writes to ~/.jfrog/projects/ and affects all projects on the machine. +- The generated config is consumed by 'jf gradle' in the same directory; running gradle from elsewhere will not find it. + +Related: jf gradle, jf mvn-config` +} diff --git a/docs/buildtools/helmcommand/help.go b/docs/buildtools/helmcommand/help.go index 492af6988..6de06d975 100644 --- a/docs/buildtools/helmcommand/help.go +++ b/docs/buildtools/helmcommand/help.go @@ -6,6 +6,31 @@ func GetDescription() string { return "Run native Helm command with build-info collection support." } +func GetAIDescription() string { + return `Run a Helm command (package, push, pull, dependency update) through JFrog with build-info collection. Wraps the local helm binary; arguments pass through. + +When to use: +- Packaging and pushing Helm charts to an Artifactory OCI Helm repository. +- Resolving chart dependencies through Artifactory with build-info tracking. + +Prerequisites: +- A local helm binary (Helm 3+). +- A configured server. +- For build-info: --build-name and --build-number passed together. + +Common patterns: + $ jf helm package ./mychart --build-name=my-build --build-number=1 + $ jf helm push mychart-0.1.0.tgz oci://myrepo.jfrog.io/helm-local --build-name=my-build --build-number=1 + $ jf helm dependency update ./mychart --build-name=my-build --build-number=1 + +Gotchas: +- Only 'package', 'push', and 'dependency' contribute to build-info; other commands are pure passthroughs. +- OCI registries require the URL prefix oci://; HTTP-based Helm repos use the helm-repo URL form. +- --repository-cache lets you override the chart cache location, useful in CI. + +Related: jf rt build-publish, jf docker push` +} + func GetArguments() string { return ` helm arguments Helm command and arguments to execute. All standard Helm commands are supported. diff --git a/docs/buildtools/huggingface/help.go b/docs/buildtools/huggingface/help.go index 8b790c8e1..0ddc65daf 100644 --- a/docs/buildtools/huggingface/help.go +++ b/docs/buildtools/huggingface/help.go @@ -6,3 +6,23 @@ var Usage = []string{"hf download ", func GetDescription() string { return `Download or upload models/datasets from/to HuggingFace Hub.` } + +func GetAIDescription() string { + return `Parent command for HuggingFace Hub operations routed through an Artifactory HuggingFaceML repository. Use the 'upload' and 'download' subcommands. + +When to use: +- Caching ML models or datasets through Artifactory for compliance/auditability. +- Mirroring private HF repos into Artifactory. + +Prerequisites: +- A configured server with an HF-type Artifactory repo. + +Common patterns: + $ jf hf download bert-base-uncased --repo-key=hf-virtual + $ jf hf upload ./my-model my-org/my-model --repo-key=hf-local + +Gotchas: +- 'jf hf' alone shows subcommand help; an explicit subcommand is required to do work. + +Related: jf hf upload, jf hf download` +} diff --git a/docs/buildtools/huggingfacedownload/help.go b/docs/buildtools/huggingfacedownload/help.go index 8d6729e27..b48007c84 100644 --- a/docs/buildtools/huggingfacedownload/help.go +++ b/docs/buildtools/huggingfacedownload/help.go @@ -26,3 +26,27 @@ func GetArguments() string { --hf-hub-download-timeout [Optional] Timeout in seconds for Download. Default: 86400 (24 hours).` } + +func GetAIDescription() string { + return `Download a HuggingFace model or dataset from HuggingFace Hub through an Artifactory HuggingFaceML repository, which caches it for future requests. + +When to use: +- Pulling a model in CI from a private HF mirror in Artifactory. +- Caching public HF models locally to reduce egress and ensure availability. + +Prerequisites: +- A configured server with an Artifactory HF repository (--repo-key). +- HF_TOKEN if the source repo is private. + +Common patterns: + $ jf hf download bert-base-uncased --repo-key=hf-virtual + $ jf hf download my-org/my-dataset --repo-key=hf-virtual --repo-type=dataset + $ jf hf download my-org/my-model --repo-key=hf-virtual --revision=v1.0 + +Gotchas: +- --repo-key is mandatory. +- Default --repo-type is 'model'. +- The first download of a large model takes a long time; subsequent downloads are served from Artifactory cache. + +Related: jf hf upload` +} diff --git a/docs/buildtools/huggingfaceupload/help.go b/docs/buildtools/huggingfaceupload/help.go index 0da06a58f..219671f6a 100644 --- a/docs/buildtools/huggingfaceupload/help.go +++ b/docs/buildtools/huggingfaceupload/help.go @@ -29,3 +29,29 @@ func GetArguments() string { --hf-hub-download-timeout [Optional] Timeout in seconds for Download. Default: 86400 (24 hours).` } + +func GetAIDescription() string { + return `Upload a HuggingFace model or dataset folder to HuggingFace Hub via an Artifactory HuggingFaceML repository. Files are streamed through the configured Artifactory server, which caches and tracks the artifacts. + +When to use: +- Pushing a fine-tuned model to a private HF org behind Artifactory. +- Mirroring a dataset for offline access in regulated environments. + +Prerequisites: +- A configured server with an Artifactory HF repository (--repo-key). +- A HuggingFace token in HF_TOKEN if the destination repo is private. +- The folder to upload exists locally. + +Common patterns: + $ jf hf upload ./my-model my-org/my-model --repo-key=hf-local + $ jf hf upload ./my-dataset my-org/my-dataset --repo-key=hf-local --repo-type=dataset + $ jf hf upload ./my-model my-org/my-model --repo-key=hf-local --revision=v1.0 + +Gotchas: +- --repo-key is mandatory; the upload fails fast without it. +- Default --repo-type is 'model'; pass 'dataset' for datasets. +- HF_TOKEN is required by upstream HuggingFace if the target repo is private. +- Large model uploads can take hours; tune --hf-hub-download-timeout and --hf-hub-etag-timeout. + +Related: jf hf download` +} diff --git a/docs/buildtools/mvn/help.go b/docs/buildtools/mvn/help.go index 5694f4bd6..60082c8d3 100644 --- a/docs/buildtools/mvn/help.go +++ b/docs/buildtools/mvn/help.go @@ -14,3 +14,29 @@ func GetArguments() string { return ` goals and options Goals and options to run with mvn command. For example -f path/to/pom.xml` } + +func GetAIDescription() string { + return `Run a Maven build with JFrog instrumentation: resolves dependencies and deploys artifacts through Artifactory, optionally collecting build-info for traceability. Wraps the local mvn binary; goals and flags after the command name are passed through. + +When to use: +- Building Maven projects against Artifactory release/snapshot repositories. +- Producing a JFrog build-info record alongside the artifact deployment. + +Prerequisites: +- A local mvn binary on PATH (this command does not install Maven). +- 'jf mvn-config' run once in the project directory to set the resolver and deployer repositories. +- A configured server (jf c add) referenced by 'jf mvn-config'. + +Common patterns: + $ jf mvn clean install + $ jf mvn deploy -f path/to/pom.xml --build-name=my-build --build-number=1 + $ jf mvn package -DskipTests + +Gotchas: +- 'jf mvn-config' must be run first; without it the resolution/deployment repos are unknown. +- --build-name and --build-number are required together for build-info collection; passing only one is silently ignored. +- All flags after 'mvn' are passed verbatim to Maven; jf-specific flags (--build-name, etc.) are consumed by jf, the rest go to mvn. +- Set JFROG_CLI_RELEASES_REPO to fetch the Maven extractor through a private repo (air-gapped builds). + +Related: jf mvn-config, jf rt build-publish, jf rt build-add-deps` +} diff --git a/docs/buildtools/mvnconfig/help.go b/docs/buildtools/mvnconfig/help.go index 943edb34b..52fde87ef 100644 --- a/docs/buildtools/mvnconfig/help.go +++ b/docs/buildtools/mvnconfig/help.go @@ -5,3 +5,27 @@ var Usage = []string{"mvn-config [command options]"} func GetDescription() string { return "Generate maven build configuration." } + +func GetAIDescription() string { + return `Write a per-project Maven configuration file (.jfrog/projects/maven.yaml) that tells 'jf mvn' which Artifactory server and repositories to use for resolution and deployment. Run once per project; commit the file or .gitignore it depending on team policy. + +When to use: +- Initial setup of a Maven project to build through JFrog. +- Re-pointing an existing project at a different server or repo. + +Prerequisites: +- A configured server (jf c add or jf login). +- Knowledge of the resolver (releases/snapshots) and deployer (releases/snapshots) repo keys in Artifactory. +- Run from the project root (the directory containing pom.xml). + +Common patterns: + $ jf mvn-config --server-id-resolve=my-server --repo-resolve-releases=libs-release --repo-resolve-snapshots=libs-snapshot + $ jf mvn-config --global # write to ~/.jfrog/projects/ instead of ./.jfrog/ + +Gotchas: +- Interactive prompts run by default if required flags are missing. +- The generated yaml is read by every subsequent 'jf mvn' from the same directory. +- --global affects all projects on the machine; prefer per-project config for multi-tenant scenarios. + +Related: jf mvn, jf gradle-config, jf rt build-publish` +} diff --git a/docs/buildtools/npmci/help.go b/docs/buildtools/npmci/help.go index f3aa34e79..0945b3521 100644 --- a/docs/buildtools/npmci/help.go +++ b/docs/buildtools/npmci/help.go @@ -12,3 +12,27 @@ func GetArguments() string { return ` npm ci args The npm ci args to run npm ci.` } + +func GetAIDescription() string { + return `Run 'npm ci' through JFrog: dependencies resolve via the Artifactory npm virtual repo configured by 'jf npm-config'. Strictly uses package-lock.json (will fail if it does not match package.json). Captures build-info when --build-name and --build-number are passed. + +When to use: +- Reproducible installs in CI (no dependency hoisting, no version drift). +- Producing build-info for an immutable install step. + +Prerequisites: +- A local npm binary. +- 'jf npm-config' run once. +- A configured server. +- A valid package-lock.json checked into the repo. + +Common patterns: + $ jf npm ci + $ jf npm ci --build-name=my-app --build-number=42 + +Gotchas: +- Fails if package-lock.json is missing or stale relative to package.json. +- Deletes node_modules before installing; slower than 'npm install' but deterministic. + +Related: jf npm install, jf npm publish, jf npm-config` +} diff --git a/docs/buildtools/npmcommand/help.go b/docs/buildtools/npmcommand/help.go index fc60d030b..6cbc8cc7e 100644 --- a/docs/buildtools/npmcommand/help.go +++ b/docs/buildtools/npmcommand/help.go @@ -12,3 +12,31 @@ func GetArguments() string { install, i, isntall, add Run npm install. help, h` } + +func GetAIDescription() string { + return `Run an npm command through JFrog: install/ci routes through an Artifactory virtual repo, publish deploys to a target repo, and build-info can be collected. Wraps the local npm binary; arguments after the command are passed through. + +When to use: +- Installing dependencies via an Artifactory npm virtual repo (caches public registries, enforces curation). +- Publishing an npm package to an Artifactory npm-local repo. +- Producing JFrog build-info for npm projects. + +Prerequisites: +- A local npm binary on PATH. +- 'jf npm-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf npm install + $ jf npm ci --build-name=my-app --build-number=42 + $ jf npm publish --build-name=my-app --build-number=42 + $ jf npm install --omit=dev + +Gotchas: +- 'jf npm-config' must be run first; without it, npm commands resolve through the public registry, defeating the point. +- --build-name and --build-number are needed together for build-info. +- Some flags conflict between the npm version and the JFrog wrapper; in case of doubt, use --command-name to be explicit. +- Curation (if enabled) can block install on policy-failed packages; surface those errors with --verbose. + +Related: jf npm-config, jf rt build-publish, jf xr audit npm` +} diff --git a/docs/buildtools/npmconfig/help.go b/docs/buildtools/npmconfig/help.go index 09f62d89d..288203c13 100644 --- a/docs/buildtools/npmconfig/help.go +++ b/docs/buildtools/npmconfig/help.go @@ -5,3 +5,27 @@ var Usage = []string{"npm-config [command options]"} func GetDescription() string { return "Generate npm configuration." } + +func GetAIDescription() string { + return `Write a per-project npm configuration (.jfrog/projects/npm.yaml) that binds 'jf npm' to a server and repository. Required before 'jf npm install' or 'jf npm publish' will work as intended. + +When to use: +- Initial setup of an npm project to build through JFrog. +- Switching to a different npm repo or server. + +Prerequisites: +- A configured server (jf c add or jf login). +- The npm repository key in Artifactory (a virtual repo for resolve, a local repo for deploy). +- Run from the project root (where package.json lives). + +Common patterns: + $ jf npm-config --server-id-resolve=my-server --repo-resolve=npm-virtual --repo-deploy=npm-local + $ jf npm-config --global + +Gotchas: +- Interactive by default. Pass --interactive=false in scripts. +- --global writes to ~/.jfrog/projects/ and affects all subsequent jf npm runs on the machine. +- A separate npm-config is needed per project; running 'jf npm' from a directory without one fails. + +Related: jf npm, jf yarn-config, jf pnpm-config` +} diff --git a/docs/buildtools/npminstall/help.go b/docs/buildtools/npminstall/help.go index 484249e8b..07e45ab08 100644 --- a/docs/buildtools/npminstall/help.go +++ b/docs/buildtools/npminstall/help.go @@ -12,3 +12,27 @@ func GetArguments() string { return ` npm install args The npm install args to run npm install. For example, --global.` } + +func GetAIDescription() string { + return `Run 'npm install' through JFrog: dependencies resolve via the Artifactory npm virtual repo configured by 'jf npm-config'. Captures build-info when --build-name and --build-number are passed. + +When to use: +- Installing npm dependencies through a private Artifactory npm repo. +- Producing build-info from an npm install step. + +Prerequisites: +- A local npm binary. +- 'jf npm-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf npm install + $ jf npm install --build-name=my-app --build-number=42 + $ jf npm install lodash --save + +Gotchas: +- 'jf npm-config' must be run first. +- --global behaves like npm's --global flag; the install goes outside the project. + +Related: jf npm-config, jf npm ci, jf npm publish` +} diff --git a/docs/buildtools/npmpublish/help.go b/docs/buildtools/npmpublish/help.go index 7102dae4b..d22133e39 100644 --- a/docs/buildtools/npmpublish/help.go +++ b/docs/buildtools/npmpublish/help.go @@ -7,3 +7,26 @@ var Usage = []string{"npm publish [command options]"} func GetDescription() string { return `Packs and deploys the npm package to the Artifactory npm repository, configured by the '` + coreutils.GetCliExecutableName() + ` npmc' command.` } + +func GetAIDescription() string { + return `Build and publish the current npm package to the Artifactory npm repository configured by 'jf npm-config' (--repo-deploy). Captures build-info when --build-name and --build-number are passed. + +When to use: +- Releasing a new version of an internal npm package to a private repo. + +Prerequisites: +- A local npm binary. +- 'jf npm-config' must have --repo-deploy set. +- A configured server. +- A package.json with a unique version (republish of same version may fail by repo policy). + +Common patterns: + $ jf npm publish + $ jf npm publish --build-name=my-app --build-number=42 + +Gotchas: +- The version in package.json must be incremented; otherwise the publish is rejected. +- 'npm pack' is implicit; control output with the standard npmignore / files fields in package.json. + +Related: jf npm install, jf npm-config, jf rt build-publish` +} diff --git a/docs/buildtools/nuget/help.go b/docs/buildtools/nuget/help.go index 5bc9d84c5..2e8f280b0 100644 --- a/docs/buildtools/nuget/help.go +++ b/docs/buildtools/nuget/help.go @@ -10,3 +10,27 @@ func GetArguments() string { return ` nuget command The nuget command to run. For example, restore.` } + +func GetAIDescription() string { + return `Run a NuGet command (restore, pack, push) through JFrog: dependencies resolve via an Artifactory NuGet repository, optionally collecting build-info. + +When to use: +- Restoring NuGet packages from an Artifactory NuGet repo. +- Producing build-info for .NET projects that use nuget.exe directly. + +Prerequisites: +- A local nuget binary on PATH. +- 'jf nuget-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf nuget restore MyApp.sln + $ jf nuget restore --build-name=my-app --build-number=2 + +Gotchas: +- 'jf nuget-config' must be run first. +- For .NET Core/SDK projects, prefer 'jf dotnet' instead. +- The nuget binary on Linux/macOS often comes from Mono and behaves differently than on Windows. + +Related: jf nuget-config, jf dotnet` +} diff --git a/docs/buildtools/nugetconfig/help.go b/docs/buildtools/nugetconfig/help.go index bc3ada55a..f3b374773 100644 --- a/docs/buildtools/nugetconfig/help.go +++ b/docs/buildtools/nugetconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"nuget-config [command options]"} func GetDescription() string { return "Generate nuget configuration." } + +func GetAIDescription() string { + return `Write a per-project NuGet configuration (.jfrog/projects/nuget.yaml) so 'jf nuget' resolves through Artifactory. + +When to use: +- First-time setup of a NuGet project. + +Prerequisites: +- A configured server. +- The Artifactory NuGet repository key. + +Common patterns: + $ jf nuget-config --server-id-resolve=my-server --repo-resolve=nuget-virtual + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- Does NOT affect .NET Core/SDK projects; for those use 'jf dotnet-config'. + +Related: jf nuget, jf dotnet-config` +} diff --git a/docs/buildtools/pipconfig/help.go b/docs/buildtools/pipconfig/help.go index fcabde6cd..c780a1732 100644 --- a/docs/buildtools/pipconfig/help.go +++ b/docs/buildtools/pipconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"pip-config"} func GetDescription() string { return "Generate pip build configuration." } + +func GetAIDescription() string { + return `Write a per-project pip configuration (.jfrog/projects/pip.yaml) so 'jf pip install' resolves through an Artifactory PyPI repository. + +When to use: +- First-time setup of a Python project to use a private PyPI index. + +Prerequisites: +- A configured server. +- The Artifactory PyPI repository key. + +Common patterns: + $ jf pip-config --server-id-resolve=my-server --repo-resolve=pypi-virtual + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- Affects only 'jf pip'; native pip invocations still use the system index. + +Related: jf pip, jf pipenv-config, jf poetry-config` +} diff --git a/docs/buildtools/pipenvconfig/help.go b/docs/buildtools/pipenvconfig/help.go index 064b06ae6..7db4beccd 100644 --- a/docs/buildtools/pipenvconfig/help.go +++ b/docs/buildtools/pipenvconfig/help.go @@ -5,3 +5,22 @@ var Usage = []string{"pipenv-config"} func GetDescription() string { return "Generate pipenv build configuration." } + +func GetAIDescription() string { + return `Write a per-project pipenv configuration (.jfrog/projects/pipenv.yaml) so 'jf pipenv install' resolves through an Artifactory PyPI repository. + +When to use: +- Initial setup of a pipenv project to use a private PyPI index. + +Prerequisites: +- A configured server. +- The Artifactory PyPI repository key. + +Common patterns: + $ jf pipenv-config --server-id-resolve=my-server --repo-resolve=pypi-virtual + +Gotchas: +- Interactive prompts trigger when required flags are missing. + +Related: jf pipenv, jf pip-config, jf poetry-config` +} diff --git a/docs/buildtools/pipenvinstall/help.go b/docs/buildtools/pipenvinstall/help.go index 7fea31044..c194f0235 100644 --- a/docs/buildtools/pipenvinstall/help.go +++ b/docs/buildtools/pipenvinstall/help.go @@ -10,3 +10,25 @@ func GetArguments() string { return ` pipenv sub-command Arguments and options for the pipenv command.` } + +func GetAIDescription() string { + return `Run pipenv install through JFrog, routing dependency resolution via an Artifactory PyPI repository. + +When to use: +- Installing Python dependencies in a pipenv-managed project that should resolve through Artifactory. + +Prerequisites: +- A local pipenv binary. +- 'jf pipenv-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf pipenv install + $ jf pipenv install --dev --build-name=my-svc --build-number=8 + +Gotchas: +- 'jf pipenv-config' must be run first. +- pipenv writes its own Pipfile.lock; ensure the lockfile is committed and updated through 'jf pipenv'. + +Related: jf pipenv-config, jf pip, jf poetry` +} diff --git a/docs/buildtools/pipinstall/help.go b/docs/buildtools/pipinstall/help.go index 6f57b2204..842215d23 100644 --- a/docs/buildtools/pipinstall/help.go +++ b/docs/buildtools/pipinstall/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` pip sub-command Arguments and options for the pip command.` } + +func GetAIDescription() string { + return `Run pip install (or another pip subcommand) through JFrog, routing package downloads via an Artifactory PyPI virtual repository, with optional build-info collection. + +When to use: +- Installing Python dependencies through a private PyPI repo (caching, curation, isolation). + +Prerequisites: +- A local pip on PATH (in the active venv or system). +- 'jf pip-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf pip install -r requirements.txt + $ jf pip install -r requirements.txt --build-name=my-svc --build-number=5 + +Gotchas: +- 'jf pip-config' must be run first; otherwise pip uses the public PyPI index. +- Always activate the target virtualenv before running 'jf pip', or pass --user explicitly. +- Curation policies (if enabled) can block install on packages flagged by Xray. + +Related: jf pip-config, jf pipenv, jf poetry, jf twine` +} diff --git a/docs/buildtools/pnpmcommand/help.go b/docs/buildtools/pnpmcommand/help.go index 297f0a415..883d98ed6 100644 --- a/docs/buildtools/pnpmcommand/help.go +++ b/docs/buildtools/pnpmcommand/help.go @@ -11,3 +11,26 @@ func GetArguments() string { publish Packs and deploys the pnpm package to the designated npm repository. help, h` } + +func GetAIDescription() string { + return `Run pnpm install/publish through JFrog: resolves through an Artifactory npm virtual repo and publishes to a local repo. Wraps the local pnpm binary. + +When to use: +- Installing or publishing pnpm-managed packages via Artifactory. + +Prerequisites: +- A local pnpm binary on PATH. +- 'jf pnpm-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf pnpm install + $ jf pnpm install --build-name=my-app --build-number=3 + $ jf pnpm publish + +Gotchas: +- 'jf pnpm-config' must be run first. +- pnpm's workspace mode (monorepo) requires careful config; verify pnpm-workspace.yaml is respected. + +Related: jf pnpm-config, jf npm, jf yarn` +} diff --git a/docs/buildtools/pnpmconfig/help.go b/docs/buildtools/pnpmconfig/help.go index 214dc232e..25c7c62ec 100644 --- a/docs/buildtools/pnpmconfig/help.go +++ b/docs/buildtools/pnpmconfig/help.go @@ -5,3 +5,24 @@ var Usage = []string{"pnpm-config [command options]"} func GetDescription() string { return "Generate pnpm configuration." } + +func GetAIDescription() string { + return `Write a per-project pnpm configuration (.jfrog/projects/pnpm.yaml) that routes 'jf pnpm' through an Artifactory npm repository. + +When to use: +- Initial setup of a pnpm project for JFrog. + +Prerequisites: +- A configured server. +- The Artifactory npm/pnpm repository key. +- Run from the project root. + +Common patterns: + $ jf pnpm-config --server-id-resolve=my-server --repo-resolve=npm-virtual --repo-deploy=npm-local + +Gotchas: +- Interactive prompts run when required flags are missing. +- Workspace projects need the config in the workspace root, not each package. + +Related: jf pnpm, jf npm-config` +} diff --git a/docs/buildtools/poetry/help.go b/docs/buildtools/poetry/help.go index 5be284a85..8c5f759b7 100644 --- a/docs/buildtools/poetry/help.go +++ b/docs/buildtools/poetry/help.go @@ -10,3 +10,27 @@ func GetArguments() string { return ` poetry sub-command Arguments and options for the poetry command.` } + +func GetAIDescription() string { + return `Run a Poetry command (install, build, publish) through JFrog, routing dependency resolution via an Artifactory PyPI repository, with optional build-info. + +When to use: +- Installing dependencies in a Poetry project against a private PyPI repo. +- Publishing a Poetry-built wheel to Artifactory. + +Prerequisites: +- A local poetry binary. +- 'jf poetry-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf poetry install + $ jf poetry build + $ jf poetry publish --build-name=my-pkg --build-number=1 + +Gotchas: +- 'jf poetry-config' must be run first. +- Poetry's lockfile must be regenerated through 'jf poetry lock' to match the routed source. + +Related: jf poetry-config, jf pip, jf twine` +} diff --git a/docs/buildtools/poetryconfig/help.go b/docs/buildtools/poetryconfig/help.go index c809337f8..135ad6f92 100644 --- a/docs/buildtools/poetryconfig/help.go +++ b/docs/buildtools/poetryconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"poetry-config"} func GetDescription() string { return "Generate poetry build configuration." } + +func GetAIDescription() string { + return `Write a per-project Poetry configuration (.jfrog/projects/poetry.yaml) so 'jf poetry' resolves through an Artifactory PyPI repository. + +When to use: +- Initial setup of a Poetry project to use a private PyPI index. + +Prerequisites: +- A configured server. +- The Artifactory PyPI repository key. + +Common patterns: + $ jf poetry-config --server-id-resolve=my-server --repo-resolve=pypi-virtual --repo-deploy=pypi-local + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- Updates the Poetry sources list in pyproject.toml; review the diff after running. + +Related: jf poetry, jf pip-config` +} diff --git a/docs/buildtools/rubyconfig/help.go b/docs/buildtools/rubyconfig/help.go index 8caba394f..44cd197e3 100644 --- a/docs/buildtools/rubyconfig/help.go +++ b/docs/buildtools/rubyconfig/help.go @@ -5,3 +5,23 @@ var Usage = []string{"ruby-config [command options]"} func GetDescription() string { return "Generate ruby build configuration." } + +func GetAIDescription() string { + return `Write a per-project Ruby configuration (.jfrog/projects/ruby.yaml) and update bundler's source list so gem resolution routes through an Artifactory RubyGems repository. + +When to use: +- Initial setup of a Ruby/Bundler project to use a private RubyGems index. + +Prerequisites: +- A configured server. +- The Artifactory RubyGems repository key. + +Common patterns: + $ jf ruby-config --server-id-resolve=my-server --repo-resolve=rubygems-virtual + +Gotchas: +- Interactive prompts trigger when required flags are missing. +- 'jf ruby-config' modifies the Gemfile or bundler config; review the diff after running. + +Related: jf rt build-publish` +} diff --git a/docs/buildtools/yarn/help.go b/docs/buildtools/yarn/help.go index 82dde23cc..a1e59ad5a 100644 --- a/docs/buildtools/yarn/help.go +++ b/docs/buildtools/yarn/help.go @@ -5,3 +5,28 @@ var Usage = []string{"yarn [yarn command] [command options]"} func GetDescription() string { return "Run Yarn commands." } + +func GetAIDescription() string { + return `Run a Yarn command through JFrog: resolves dependencies via an Artifactory npm/yarn virtual repo, optionally collecting build-info. Wraps the local yarn binary. + +When to use: +- Installing Yarn dependencies through an Artifactory virtual repo. +- Producing JFrog build-info for Yarn projects. + +Prerequisites: +- A local yarn binary on PATH (Yarn 1.x and Yarn berry both supported). +- 'jf yarn-config' run once in the project directory. +- A configured server. + +Common patterns: + $ jf yarn install + $ jf yarn install --build-name=my-app --build-number=7 + $ jf yarn add lodash + +Gotchas: +- 'jf yarn-config' must be run first; the command fails without it. +- --build-name and --build-number are needed together for build-info. +- Yarn berry has different config semantics; verify the .yarnrc.yml after config. + +Related: jf yarn-config, jf npm, jf pnpm` +} diff --git a/docs/buildtools/yarnconfig/help.go b/docs/buildtools/yarnconfig/help.go index 367221b4f..03cf9e0c6 100644 --- a/docs/buildtools/yarnconfig/help.go +++ b/docs/buildtools/yarnconfig/help.go @@ -5,3 +5,24 @@ var Usage = []string{"yarn-config [command options]"} func GetDescription() string { return "Generate Yarn configuration." } + +func GetAIDescription() string { + return `Write a per-project Yarn configuration (.jfrog/projects/yarn.yaml) that points 'jf yarn' at an Artifactory npm/yarn repository for resolution. + +When to use: +- First-time setup of a Yarn project to route through JFrog. + +Prerequisites: +- A configured server. +- The Artifactory yarn/npm repository key. +- Run from the project root. + +Common patterns: + $ jf yarn-config --server-id-resolve=my-server --repo-resolve=npm-virtual + +Gotchas: +- Interactive prompts run when required flags are missing. +- Yarn berry projects may need additional manual .yarnrc.yml tweaks beyond what this command writes. + +Related: jf yarn, jf npm-config` +} diff --git a/docs/completion/bash/help.go b/docs/completion/bash/help.go index 191b8b1ab..d8d04a5ff 100644 --- a/docs/completion/bash/help.go +++ b/docs/completion/bash/help.go @@ -5,3 +5,24 @@ var Usage = []string{"completion bash"} func GetDescription() string { return "Generate bash completion script." } + +func GetAIDescription() string { + return `Emit a bash completion script for jf to standard output. Source it from ~/.bashrc or pipe it into a system completions directory to get tab completion for subcommands and flags. + +When to use: +- One-time shell setup on a developer machine. +- Installing into a Docker base image so interactive shells get completions. + +Prerequisites: +- bash 4.0+ and bash-completion installed. + +Common patterns: + $ jf completion bash > ~/.jfrog-completion.bash && echo 'source ~/.jfrog-completion.bash' >> ~/.bashrc + $ jf completion bash --install + +Gotchas: +- --install writes to a system path; may require elevated privileges. +- The generated script must be re-sourced (or shell reopened) to take effect. + +Related: jf completion zsh, jf completion fish` +} diff --git a/docs/completion/fish/help.go b/docs/completion/fish/help.go index b42cc8b9c..6320e7068 100644 --- a/docs/completion/fish/help.go +++ b/docs/completion/fish/help.go @@ -5,3 +5,22 @@ var Usage = []string{"completion fish"} func GetDescription() string { return "Generate fish completion script." } + +func GetAIDescription() string { + return `Emit a fish completion script for jf. Pipe it to ~/.config/fish/completions/jf.fish so the fish shell picks up tab completion for subcommands and flags. + +When to use: +- One-time shell setup on a developer machine using fish. + +Prerequisites: +- fish 3.0+. + +Common patterns: + $ jf completion fish > ~/.config/fish/completions/jf.fish + $ jf completion fish --install + +Gotchas: +- fish reads completions from ~/.config/fish/completions/; the file must be named jf.fish. + +Related: jf completion bash, jf completion zsh` +} diff --git a/docs/completion/zsh/help.go b/docs/completion/zsh/help.go index ad2bb5014..8bab0668c 100644 --- a/docs/completion/zsh/help.go +++ b/docs/completion/zsh/help.go @@ -5,3 +5,23 @@ var Usage = []string{"completion zsh"} func GetDescription() string { return "Generate zsh completion script." } + +func GetAIDescription() string { + return `Emit a zsh completion script for jf to standard output. Drop it into a directory on $fpath (usually ~/.zsh/completions/) and add 'autoload -U compinit && compinit' to ~/.zshrc. + +When to use: +- One-time shell setup on a developer machine using zsh. + +Prerequisites: +- zsh with the completion system enabled. + +Common patterns: + $ jf completion zsh > "${fpath[1]}/_jf" + $ jf completion zsh --install + +Gotchas: +- The completion file must be named '_jf' on $fpath for zsh to find it. +- After installing, run 'compinit' or reopen the shell. + +Related: jf completion bash, jf completion fish` +} diff --git a/docs/config/add/help.go b/docs/config/add/help.go index bf4c2715a..cd3956052 100644 --- a/docs/config/add/help.go +++ b/docs/config/add/help.go @@ -6,3 +6,29 @@ var Usage = []string{"config add", func GetDescription() string { return `Adds a server configuration.` } + +func GetAIDescription() string { + return `Add a named JFrog Platform server configuration to the local config store under ~/.jfrog/. Use this once per platform deployment before running commands that need credentials. The server ID is a stable label you reference later via --server-id or as the active default. + +When to use: +- First-time setup on a new machine or CI runner before running any jf command that targets the platform. +- Registering an additional environment (for example a staging server alongside production). + +Prerequisites: +- A JFrog Platform URL (the platform base URL, not the Artifactory subpath). +- One of: access token, username and password, or interactive prompts. +- Write access to ~/.jfrog/ on the local machine. + +Common patterns: + $ jf c add my-server --url=https://mycorp.jfrog.io --user=admin --password=secret --interactive=false + $ jf c add my-server --url=https://mycorp.jfrog.io --access-token=eyJ... --interactive=false + $ jf c add my-server --overwrite + +Gotchas: +- The command is interactive by default. Pass --interactive=false in scripts and CI. +- Re-adding an existing server ID fails unless --overwrite is set; use 'jf c edit' to modify in place. +- Server IDs cannot be "delete", "use", "show", or "clear" (reserved names). +- --basic-auth-only is incompatible with --access-token. + +Related: jf c edit, jf c show, jf c use, jf login` +} diff --git a/docs/config/edit/help.go b/docs/config/edit/help.go index cded2b5b7..54b1e1f79 100644 --- a/docs/config/edit/help.go +++ b/docs/config/edit/help.go @@ -5,3 +5,26 @@ var Usage = []string{"config edit "} func GetDescription() string { return `Edits a server configuration.` } + +func GetAIDescription() string { + return `Update an existing server configuration in place. The server ID is required and must already exist; this command does not create new entries. + +When to use: +- Rotating credentials (new access token, new password). +- Changing the platform URL after a migration. +- Toggling --basic-auth-only or updating client cert paths. + +Prerequisites: +- A previously added server ID (see 'jf c show' to list them). + +Common patterns: + $ jf c edit my-server --access-token=eyJ... --interactive=false + $ jf c edit my-server --user=newadmin --password=newsecret --interactive=false + +Gotchas: +- Errors if the server ID does not exist; use 'jf c add' for new entries. +- Interactive mode is on by default. Use --interactive=false for scripts. +- Only the fields you pass are updated; omitted fields keep their previous values. + +Related: jf c add, jf c show, jf c use, jf c rm` +} diff --git a/docs/config/exportcmd/help.go b/docs/config/exportcmd/help.go index 187465b34..d90af2451 100644 --- a/docs/config/exportcmd/help.go +++ b/docs/config/exportcmd/help.go @@ -7,3 +7,24 @@ var Usage = []string{"config export [server ID]"} func GetDescription() string { return `Creates a server configuration token. The generated Config Token can be imported by the "` + coreutils.GetCliExecutableName() + ` config import " command.` } + +func GetAIDescription() string { + return `Emit a server configuration as an opaque Config Token string. Pipe the output to 'jf c import' on another machine to transfer the configuration in one step. If no server ID is provided, the default server is exported. + +When to use: +- Provisioning identical configurations across multiple machines or CI runners. +- Backing up a configuration before a rotation or migration. + +Prerequisites: +- At least one configured server (see 'jf c show'). + +Common patterns: + $ jf c export my-server + $ jf c export # exports default server + +Gotchas: +- The token embeds credentials; redact or treat as secret. Do not paste into logs or commit to version control. +- The token is not human-readable but is reversible; security is "obfuscated", not encrypted. + +Related: jf c import, jf c show` +} diff --git a/docs/config/importcmd/help.go b/docs/config/importcmd/help.go index 96421ab0e..a14070b38 100644 --- a/docs/config/importcmd/help.go +++ b/docs/config/importcmd/help.go @@ -7,3 +7,23 @@ var Usage = []string{"config import "} func GetDescription() string { return `Imports a server configuration from a Config Token. A Config Token is generated by the "` + coreutils.GetCliExecutableName() + ` config export " command.` } + +func GetAIDescription() string { + return `Restore a server configuration from a Config Token string produced by 'jf c export'. The token bundles URL and credentials so a new machine can be provisioned in one step. + +When to use: +- Bootstrapping a CI runner or new dev machine without re-prompting for credentials. +- Migrating configurations between hosts. + +Prerequisites: +- A Config Token created with 'jf c export ' on the source machine. + +Common patterns: + $ jf c import eyJ2ZXJzaW9uIjoxLCJjb2RlIjoiLi4uIn0= + +Gotchas: +- The token contains credentials; treat it like a password and never commit it. +- The imported server ID inherits from the original; if it collides with an existing one, the import fails. + +Related: jf c export, jf c add, jf c show` +} diff --git a/docs/config/remove/help.go b/docs/config/remove/help.go index f2ed79346..d1cfa632d 100644 --- a/docs/config/remove/help.go +++ b/docs/config/remove/help.go @@ -11,3 +11,27 @@ func GetArguments() string { return ` server ID A unique ID for an existing JFrog configuration.` } + +func GetAIDescription() string { + return `Delete a stored server configuration from ~/.jfrog/. With a server ID, removes only that entry. Without one, asks to clear ALL configurations (destructive). + +When to use: +- Decommissioning a server profile that is no longer needed. +- Cleaning up CI runner state at job end. +- Wiping all credentials before reinstalling. + +Prerequisites: +- A previously added server ID (omit to clear all). + +Common patterns: + $ jf c rm my-server + $ jf c rm my-server --quiet + $ jf c rm --quiet + +Gotchas: +- Without a server ID, the command prompts to clear ALL configurations. Use --quiet to skip the prompt (still destructive). +- No undo; re-add via 'jf c add' if removed by mistake. +- Removing the active server leaves no default until you run 'jf c use'. + +Related: jf c add, jf c show, jf c use` +} diff --git a/docs/config/show/help.go b/docs/config/show/help.go index ed0cef558..852ebe9de 100644 --- a/docs/config/show/help.go +++ b/docs/config/show/help.go @@ -5,3 +5,28 @@ var Usage = []string{"config show "} func GetDescription() string { return `Shows the stored configuration. In case this argument is followed by a configured server ID, then only this server's configurations is shown.` } + +func GetAIDescription() string { + return `Print stored server configurations from ~/.jfrog/. With a server ID, prints only that entry; without one, prints all. Sensitive fields (password, access token, refresh token, SSH passphrase) are masked as "***" in both table and JSON output. + +When to use: +- Listing configured server IDs before picking one with --server-id. +- Confirming which server is the default after 'jf c use'. +- Inspecting URLs and which auth method is configured for a given environment. + +Prerequisites: +- At least one server added via 'jf c add' or 'jf login'. + +Common patterns: + $ jf c show + $ jf c show my-server + $ jf c show --format=json + $ jf c show my-server --format=table + +Gotchas: +- Without --format, output uses the legacy format (different from table/json). +- Credentials are always masked; this command cannot dump real secrets. +- Returns nothing silently if no servers are configured. + +Related: jf c add, jf c edit, jf c use, jf c export` +} diff --git a/docs/config/use/help.go b/docs/config/use/help.go index 9bcf0b24c..024d4d72e 100644 --- a/docs/config/use/help.go +++ b/docs/config/use/help.go @@ -5,3 +5,23 @@ var Usage = []string{"config use "} func GetDescription() string { return "Set the active server by its ID." } + +func GetAIDescription() string { + return `Mark a previously configured server as the active default. Commands that do not specify --server-id will target this server. + +When to use: +- Switching between staging and production targets in a shell session. +- Setting the default after 'jf c add' so subsequent commands need no --server-id. + +Prerequisites: +- A previously added server ID (see 'jf c show' for the list). + +Common patterns: + $ jf c use my-server + +Gotchas: +- Fails silently from the user's perspective if the server ID does not exist; check with 'jf c show' first. +- Setting an active server is per-machine, not per-shell; affects all subsequent jf invocations. + +Related: jf c add, jf c show` +} diff --git a/docs/general/api/help.go b/docs/general/api/help.go index f80c21b20..a9af3c0e5 100644 --- a/docs/general/api/help.go +++ b/docs/general/api/help.go @@ -61,3 +61,30 @@ REFERENCES SEE ALSO Use 'jf config' to add or select a server. Use --server-id to target a specific configuration.` } + +func GetAIDescription() string { + return `Invoke any JFrog Platform REST endpoint using the configured server URL and credentials. Acts as an authenticated curl: paths are relative to the platform base URL, and the response body goes to stdout. Use this when no dedicated jf subcommand exists for the operation you need. + +When to use: +- Calling REST APIs that don't have a first-class CLI wrapper (Access user/group APIs, repository CRUD, GraphQL, etc.). +- Scripting platform admin tasks where 'jf rt' or 'jf c' don't cover the operation. +- Debugging API responses with full visibility into status code and body. + +Prerequisites: +- A configured server (jf c add or jf login) or explicit --url / --access-token / --server-id. +- The caller's identity must have the privileges the target endpoint requires. + +Common patterns: + $ jf api /access/api/v2/users + $ jf api /artifactory/api/repositories -X POST -H "Content-Type: application/json" --input ./repo.json + $ jf api /artifactory/api/repositories/my-repo -X DELETE + $ jf api /access/api/v2/users -X POST -d '{"username":"newuser","email":"u@example.com","password":"S3cret!"}' -H "Content-Type: application/json" + +Gotchas: +- The endpoint path must start with /; the platform base URL is prepended. +- -d/--data and --input are mutually exclusive. +- HTTP status goes to stderr (one line), body to stdout. Non-2xx exits with status 1 but still prints the body. +- Some APIs require trailing slashes or specific Accept headers; check the API reference before scripting. + +Related: jf c add, jf rt, jf c show` +} diff --git a/docs/general/login/help.go b/docs/general/login/help.go index c2b4a8750..8c6774bd2 100644 --- a/docs/general/login/help.go +++ b/docs/general/login/help.go @@ -5,3 +5,25 @@ var Usage = []string{"login"} func GetDescription() string { return "Log in to a JFrog Platform via your web browser. Available for Artifactory 7.64.0 and above" } + +func GetAIDescription() string { + return `Authenticate to a JFrog Platform interactively via your default web browser. Returns an access token and persists a server configuration under ~/.jfrog/. Works for Artifactory 7.64.0+. Headless environments (CI, agents) should prefer 'jf c add' with --access-token instead. + +When to use: +- First-time setup on a developer workstation where a browser is available. +- Quickly authenticating without manually managing tokens. + +Prerequisites: +- A default browser configured on the host. +- Network access to the platform URL. + +Common patterns: + $ jf login + +Gotchas: +- Requires Artifactory 7.64.0 or newer; older targets must use 'jf c add'. +- Does not work in CI/headless environments — no browser to open. +- The flow stores credentials locally under ~/.jfrog/. + +Related: jf c add, jf c show, jf eot, jf atc` +} diff --git a/docs/general/oidc/help.go b/docs/general/oidc/help.go index 91287363d..6f2f34ec0 100644 --- a/docs/general/oidc/help.go +++ b/docs/general/oidc/help.go @@ -7,7 +7,7 @@ func GetDescription() string { } func GetArguments() string { - return ` + return ` --oidc-provider-name (mandatory) The provider name. @@ -17,3 +17,28 @@ func GetArguments() string { ` } + +func GetAIDescription() string { + return `Exchange an OIDC ID token from a trusted external provider (GitHub Actions, GitLab CI, generic OIDC) for a JFrog Platform access token. Removes the need to store long-lived JFrog credentials in CI secrets. + +When to use: +- Authenticating CI/CD jobs (GitHub Actions, GitLab pipelines) without storing static JFrog tokens. +- Federated identity setups where the OIDC provider issues short-lived tokens. + +Prerequisites: +- An OIDC identity mapping configured in the JFrog Platform (Admin > User Management > OIDC). +- An OIDC ID token from the provider (usually injected by the CI environment via ACTIONS_ID_TOKEN_REQUEST_TOKEN or equivalent). +- --platform-url or a configured server. + +Common patterns: + $ jf eot --oidc-provider-name=my-gh-provider --oidc-token-id=$ACTIONS_ID_TOKEN --platform-url=https://mycorp.jfrog.io + $ jf eot --oidc-provider-name=my-provider --oidc-token-id=$ID_TOKEN --oidc-provider-type=github --application-key=my-app + +Gotchas: +- The OIDC provider mapping must exist on the platform first; the exchange fails otherwise. +- The returned access token is short-lived; do not cache it across jobs. +- Some CI environments (GitHub Actions) auto-inject the token id when JFROG_CLI_OIDC_EXCHANGE_TOKEN_ID is set. +- --oidc-audience is required when the provider mapping enforces an audience claim. + +Related: jf c add (--oidc-provider), jf atc, jf login` +} diff --git a/docs/general/stats/help.go b/docs/general/stats/help.go index 193dfa157..5be2959db 100644 --- a/docs/general/stats/help.go +++ b/docs/general/stats/help.go @@ -10,7 +10,7 @@ func GetDescription() string { } func GetArguments() string { - return ` + return ` Product (Mandatory) The Product name for which you want to display statistics for now, only artifactory(rt) is supported. @@ -24,3 +24,27 @@ func GetArguments() string { The access token using which you want statistics will be fetched from jfrog instance. By default, logged user access token is used. For some products, like JFrog Platform Deployments and projects, you need to provide an admin token. ` } + +func GetAIDescription() string { + return `Display platform statistics for a given JFrog product on the configured server. Currently only the 'rt' (Artifactory) product is supported. Useful for inspecting storage, repository counts, and similar metrics. + +When to use: +- Auditing platform usage from a script. +- Capturing structured metrics for dashboards (--format=json). + +Prerequisites: +- A configured server (jf c add or jf login) or --server-id, --access-token. +- For some metrics (JPDs, projects), an admin-scoped token. + +Common patterns: + $ jf st rt + $ jf st rt --format=json + $ jf st rt --server-id=my-prod --access-token=eyJ... + +Gotchas: +- Only 'rt' is accepted as the product argument today. +- Some metrics require admin privileges; a user-scoped token returns partial or empty data. +- Default output is text; pass --format for json or table. + +Related: jf api, jf c show` +} diff --git a/docs/general/summary/help.go b/docs/general/summary/help.go index a48d0964e..ac38d29cc 100644 --- a/docs/general/summary/help.go +++ b/docs/general/summary/help.go @@ -5,3 +5,22 @@ var Usage = []string{"gsm"} func GetDescription() string { return `Generate a summary of recorded CLI commands that were executed on the current machine. The report is generated in Markdown format and saved in the directory stored in the JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR environment variable.` } + +func GetAIDescription() string { + return `Finalize and render a Markdown summary of CLI commands executed during the current run. Designed for CI integration: the report can be picked up by GitHub Actions $GITHUB_STEP_SUMMARY or similar systems. Reads recorded command artifacts from the directory specified in JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR. + +When to use: +- At the end of a CI job to publish a human-readable summary of uploads, builds, scans, and other tracked operations. + +Prerequisites: +- The JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR environment variable must be set during the prior jf commands so they record summary data. + +Common patterns: + $ JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR=$RUNNER_TEMP/jfrog-summary jf gsm + +Gotchas: +- If JFROG_CLI_COMMAND_SUMMARY_OUTPUT_DIR was not set during the recorded commands, there is nothing to summarize and the output is empty. +- Output is always Markdown; no JSON or table format option. + +Related: jf rt upload, jf rt build-publish` +} diff --git a/docs/general/token/help.go b/docs/general/token/help.go index 5cef2c3e1..27cddf10c 100644 --- a/docs/general/token/help.go +++ b/docs/general/token/help.go @@ -10,3 +10,30 @@ func GetArguments() string { return ` username The username for which this token is created. If not specified, the token will be created for the current user.` } + +func GetAIDescription() string { + return `Mint a JFrog Platform access token. Defaults to a user-scoped token for the calling identity. Admins can broaden the scope with --scope (raw scope string) or --groups (comma-separated group names) plus --grant-admin for admin-scoped tokens. + +When to use: +- Generating a long-lived service token for CI runners. +- Issuing a short-lived, narrowly scoped token for an agent or automation. +- Refreshing a token before it expires. + +Prerequisites: +- A configured server (jf c add or jf login). +- Sufficient privileges to mint the requested scope (admin for cross-user / group scopes). + +Common patterns: + $ jf atc # user-scoped token for current user + $ jf atc alice --expiry=3600 # 1-hour token for user alice + $ jf atc --groups=readers,writers # group-scoped (admin) + $ jf atc --grant-admin --expiry=86400 # admin-scoped (24h) + +Gotchas: +- --grant-admin requires admin privileges and may be disabled by platform policy. +- --refreshable produces a token that can be renewed; otherwise the token is one-shot. +- --expiry is in seconds. Platform policy may cap the maximum lifetime. +- The plaintext token is printed once; capture it immediately. + +Related: jf eot, jf c add, jf login` +} diff --git a/docs/missioncontrol/jpdadd/help.go b/docs/missioncontrol/jpdadd/help.go index e4abe4b34..31e6f5f74 100644 --- a/docs/missioncontrol/jpdadd/help.go +++ b/docs/missioncontrol/jpdadd/help.go @@ -10,3 +10,26 @@ func GetArguments() string { return ` Config Path to a JSON configuration file containing the JPD details.` } + +func GetAIDescription() string { + return `Register a JFrog Platform Deployment (JPD) with a Mission Control server. The JPD definition is read from a local JSON file (URL, location, type, token, etc.). + +When to use: +- Onboarding a new platform deployment to a Mission Control fleet. +- Scripting JPD registration during platform provisioning. + +Prerequisites: +- A configured Mission Control server (jf c add captures the mission control URL). +- Admin privileges on the Mission Control side. +- A JSON file matching the JPD schema (name, url, location, token, type). + +Common patterns: + $ jf mc ja ./jpd-config.json + $ jf mc ja ./jpd-config.json --format=json + +Gotchas: +- The JSON file must match the JPD schema exactly; common omissions are 'location' and 'token'. +- The Mission Control URL must be set in the active server configuration; missing URL produces a confusing error. + +Related: jf mc jd, jf mc la, jf mc ld, jf mc lr` +} diff --git a/docs/missioncontrol/jpddelete/help.go b/docs/missioncontrol/jpddelete/help.go index 65f404084..ad4e2c524 100644 --- a/docs/missioncontrol/jpddelete/help.go +++ b/docs/missioncontrol/jpddelete/help.go @@ -10,3 +10,24 @@ func GetArguments() string { return ` JPD ID The ID of the JPD to be removed from Mission Control.` } + +func GetAIDescription() string { + return `Remove a JFrog Platform Deployment (JPD) registration from Mission Control. The remote platform itself is not affected; only the Mission Control entry is removed. + +When to use: +- Decommissioning a JPD that has been retired. +- Cleaning up a stale Mission Control entry. + +Prerequisites: +- A configured Mission Control server (jf c add captures the mission control URL). +- Admin privileges on Mission Control. + +Common patterns: + $ jf mc jd my-jpd-id + +Gotchas: +- No undo. Re-register with 'jf mc ja' if needed. +- Removing a JPD does NOT release acquired licenses; release them with 'jf mc lr' first if applicable. + +Related: jf mc ja, jf mc lr` +} diff --git a/docs/missioncontrol/licenseacquire/help.go b/docs/missioncontrol/licenseacquire/help.go index 15bf47b6a..4b6af1f8f 100644 --- a/docs/missioncontrol/licenseacquire/help.go +++ b/docs/missioncontrol/licenseacquire/help.go @@ -13,3 +13,26 @@ func GetArguments() string { Name A custom name used to mark the license as taken. Can be a JPD ID or a temporary name. If the license does not end up being used by a JPD, this is the name that should be used to release the license.` } + +func GetAIDescription() string { + return `Reserve a license from a Mission Control bucket and tag it with a holder name. The license is checked out but not yet deployed to a JPD; use 'jf mc ld' for that. + +When to use: +- Pre-allocating a license before standing up a new JPD. +- Reserving a license for a specific deployment workflow. + +Prerequisites: +- A configured Mission Control server. +- A bucket containing available licenses. +- Admin privileges on Mission Control. + +Common patterns: + $ jf mc la my-bucket my-new-jpd + $ jf mc la my-bucket placeholder-1 --format=json + +Gotchas: +- The license remains tagged until 'jf mc lr' releases it; abandoned acquisitions leak licenses. +- The 'name' is a free-form label, not necessarily a real JPD ID. Use 'jf mc lr ' to return it. + +Related: jf mc ld, jf mc lr, jf mc ja` +} diff --git a/docs/missioncontrol/licensedeploy/help.go b/docs/missioncontrol/licensedeploy/help.go index 41aa028a3..c10933068 100644 --- a/docs/missioncontrol/licensedeploy/help.go +++ b/docs/missioncontrol/licensedeploy/help.go @@ -13,3 +13,27 @@ func GetArguments() string { JPD ID An existing JPD's ID.` } + +func GetAIDescription() string { + return `Push one or more licenses from a Mission Control bucket onto an existing JPD. For Artifactory HA deployments, use --license-count to seat multiple licenses at once. + +When to use: +- Activating a freshly registered JPD with a license. +- Adding HA seats by deploying additional licenses to the same JPD. + +Prerequisites: +- A configured Mission Control server. +- A bucket with sufficient available licenses. +- The target JPD must already be registered (see 'jf mc ja'). + +Common patterns: + $ jf mc ld my-bucket my-jpd + $ jf mc ld my-bucket my-ha-jpd --license-count=3 + $ jf mc ld my-bucket my-jpd --format=json + +Gotchas: +- --license-count must be at least 1; the default is 1 if unset. +- Deploying more licenses than available in the bucket fails fast. + +Related: jf mc la, jf mc lr, jf mc ja` +} diff --git a/docs/missioncontrol/licenserelease/help.go b/docs/missioncontrol/licenserelease/help.go index 9815247ee..ea9ba11c9 100644 --- a/docs/missioncontrol/licenserelease/help.go +++ b/docs/missioncontrol/licenserelease/help.go @@ -13,3 +13,25 @@ func GetArguments() string { JPD ID If the license is used by a JPD, pass the JPD's ID. If the license was only acquired but is not used, pass the name it was acquired with.` } + +func GetAIDescription() string { + return `Return a license from a JPD (or acquisition placeholder) back to its Mission Control bucket. Use the JPD ID if the license is deployed, or the acquisition name from 'jf mc la' if it was only reserved. + +When to use: +- Decommissioning a JPD and reclaiming its license. +- Cleaning up abandoned 'jf mc la' acquisitions. + +Prerequisites: +- A configured Mission Control server. +- Admin privileges on Mission Control. + +Common patterns: + $ jf mc lr my-bucket my-jpd + $ jf mc lr my-bucket placeholder-1 # release an unused acquisition + +Gotchas: +- The second argument is the holder identifier: JPD ID for deployed licenses, acquisition name for unused ones. +- Releasing a license used by a running JPD will invalidate that JPD's licensing. + +Related: jf mc la, jf mc ld` +} diff --git a/docs/pipelines/status/help.go b/docs/pipelines/status/help.go index 842e5d88d..4f2086e49 100644 --- a/docs/pipelines/status/help.go +++ b/docs/pipelines/status/help.go @@ -5,3 +5,27 @@ var Usage = []string{"pl status"} func GetDescription() string { return "Fetch the latest pipeline run status." } + +func GetAIDescription() string { + return `Show the latest run status for one or more JFrog Pipelines. Filters by pipeline name and/or branch. Useful for polling a build from CI or surfacing the last run from a shell. + +When to use: +- Verifying a pipeline finished before triggering a downstream job. +- Checking the latest status without opening the UI. + +Prerequisites: +- A configured server with the pipelines URL set (jf c add captures it from the platform URL). +- Pipelines must be reachable from the calling network. + +Common patterns: + $ jf pl status --pipeline-name=my-pipeline --branch=main + $ jf pl status --pipeline-name=my-pipeline --monitor + $ jf pl status --pipeline-name=my-pipeline --format=json + +Gotchas: +- Without --pipeline-name the command lists all pipelines visible to the caller, which can be slow. +- --monitor blocks until status changes; use carefully in CI. +- --single-branch limits to a single-branch pipeline; default is multi-branch. + +Related: jf pl trigger, jf pl sync, jf pl sync-status` +} diff --git a/docs/pipelines/sync/help.go b/docs/pipelines/sync/help.go index dec19601e..3decc53e6 100644 --- a/docs/pipelines/sync/help.go +++ b/docs/pipelines/sync/help.go @@ -12,3 +12,25 @@ func GetArguments() string { branch name Branch name to trigger sync on.` } + +func GetAIDescription() string { + return `Trigger a sync of a pipeline resource (re-read the pipeline definition from the source repository for the given branch). Used after editing pipeline YAML or moving branches. + +When to use: +- Forcing a re-load of pipelines.yml after a configuration change. +- Recovering from a stale sync (pipeline UI shows old config). + +Prerequisites: +- A configured server with the pipelines URL set. +- The repository and branch must already be wired into Pipelines as a pipeline source. + +Common patterns: + $ jf pl sync my-org/my-repo main + $ jf pl sync my-org/my-repo feature/x --format=json + +Gotchas: +- The repository argument must be the full / form, matching how the source is registered. +- Sync runs asynchronously. Use 'jf pl sync-status' to confirm completion. + +Related: jf pl sync-status, jf pl status, jf pl trigger` +} diff --git a/docs/pipelines/syncstatus/help.go b/docs/pipelines/syncstatus/help.go index a95f03581..99e20eeb7 100644 --- a/docs/pipelines/syncstatus/help.go +++ b/docs/pipelines/syncstatus/help.go @@ -5,3 +5,25 @@ var Usage = []string{"pl sync-status"} func GetDescription() string { return "Fetch pipeline resource sync status." } + +func GetAIDescription() string { + return `Report the last sync status for a pipeline resource (repository + branch). Use after 'jf pl sync' to confirm the new definition is loaded, or to inspect a stuck sync. + +When to use: +- Confirming a 'jf pl sync' completed cleanly. +- Diagnosing why a pipeline is running an old definition. + +Prerequisites: +- A configured server with the pipelines URL set. +- --branch and --repository are both mandatory. + +Common patterns: + $ jf pl sync-status --repository=my-org/my-repo --branch=main + $ jf pl sync-status --repository=my-org/my-repo --branch=main --format=json + +Gotchas: +- Both --branch and --repository must be passed; the command errors otherwise. +- The status reflects the last sync attempt, not the current pipeline run state (use 'jf pl status' for that). + +Related: jf pl sync, jf pl status, jf pl trigger` +} diff --git a/docs/pipelines/trigger/help.go b/docs/pipelines/trigger/help.go index cfc935234..e0f42a7e6 100644 --- a/docs/pipelines/trigger/help.go +++ b/docs/pipelines/trigger/help.go @@ -12,3 +12,26 @@ func GetArguments() string { branch name Branch name to trigger the manual run on.` } + +func GetAIDescription() string { + return `Trigger a manual run of a JFrog Pipeline on a specific branch. Returns 200 OK on success (the actual run executes asynchronously on the pipelines server). + +When to use: +- Kicking off a build from a script or chat-ops automation. +- Re-running a pipeline after a configuration change. + +Prerequisites: +- A configured server with the pipelines URL set. +- The pipeline must be visible to the caller and configured for manual triggering on the specified branch. + +Common patterns: + $ jf pl trigger my-pipeline main + $ jf pl trigger my-pipeline feature/foo --single-branch + $ jf pl trigger my-pipeline main --format=json + +Gotchas: +- The CLI returns immediately once the trigger request is accepted; the run is not awaited. Poll 'jf pl status' to track it. +- --single-branch must match the pipeline's branch model; mismatched values produce a 4xx from the server. + +Related: jf pl status, jf pl sync, jf pl version` +} diff --git a/docs/pipelines/version/help.go b/docs/pipelines/version/help.go index c649969d8..4ce9f1911 100644 --- a/docs/pipelines/version/help.go +++ b/docs/pipelines/version/help.go @@ -5,3 +5,22 @@ var Usage = []string{"pl version"} func GetDescription() string { return "Show the version of JFrog Pipelines." } + +func GetAIDescription() string { + return `Print the version string reported by the configured JFrog Pipelines server. Useful as a quick connectivity and auth smoke test before running other 'pl' commands. + +When to use: +- Verifying the pipelines URL and credentials are correct after configuration changes. +- Capturing the server version for compatibility checks. + +Prerequisites: +- A configured server with the pipelines URL set. + +Common patterns: + $ jf pl version + +Gotchas: +- Returns the Pipelines service version, NOT the JFrog Platform version. + +Related: jf pl status, jf c show` +} diff --git a/docs/plugin/install/help.go b/docs/plugin/install/help.go index ac9d1bccf..2f30bc46d 100644 --- a/docs/plugin/install/help.go +++ b/docs/plugin/install/help.go @@ -16,3 +16,26 @@ func GetArguments() string { The version should be specified after a '@' separator, such as: 'hello-frog@1.0.0'. To download the latest version, specify the plugin name only.` } + +func GetAIDescription() string { + return `Install or upgrade a JFrog CLI plugin from the configured plugins registry into the local plugins pool (~/.jfrog/plugins/). Plugins extend the jf binary with custom subcommands. By default, the official JFrog plugins server is used; private registries can be set via JFROG_CLI_PLUGINS_SERVER / JFROG_CLI_PLUGINS_REPO. + +When to use: +- Adding a JFrog community or custom plugin (for example 'hello-frog'). +- Upgrading an installed plugin to a newer version. + +Prerequisites: +- Network access to the plugins registry. +- For private registries: JFROG_CLI_PLUGINS_SERVER (server ID) and JFROG_CLI_PLUGINS_REPO (repo key). + +Common patterns: + $ jf plugin install hello-frog # latest version + $ jf plugin install hello-frog@1.0.0 # pinned version + +Gotchas: +- Installing the same name without @ upgrades to latest, overwriting the previous binary. +- The plugin binary must match the host OS/arch; older plugins may not be available for all platforms. +- Plugins run in-process under the jf binary; they inherit the active server config. + +Related: jf plugin uninstall, jf plugin publish` +} diff --git a/docs/plugin/publish/help.go b/docs/plugin/publish/help.go index 90aefdf9f..d77f93b14 100644 --- a/docs/plugin/publish/help.go +++ b/docs/plugin/publish/help.go @@ -17,3 +17,25 @@ func GetArguments() string { plugin version Specifies the version of the JFrog CLI Plugin you wish to publish.` } + +func GetAIDescription() string { + return `Build and upload the current directory's JFrog CLI plugin to a plugins registry. Run from the plugin's source directory; the command compiles for multiple OS/arch targets and uploads the resulting binaries. + +When to use: +- Releasing a new version of a custom plugin to a private or public registry. + +Prerequisites: +- A Go toolchain installed locally. +- A configured plugins registry: JFROG_CLI_PLUGINS_SERVER (server ID) and JFROG_CLI_PLUGINS_REPO (target repo key). +- Write access to the target repo. + +Common patterns: + $ jf plugin publish my-plugin 1.2.3 + +Gotchas: +- Must be run from the plugin's repository root (where main.go lives). +- The version string is used as the artifact path; reusing an existing version may overwrite or fail depending on repo policy. +- Cross-compilation requires CGO-free builds; native deps may fail to cross-compile. + +Related: jf plugin install, jf plugin uninstall` +} diff --git a/docs/plugin/uninstall/help.go b/docs/plugin/uninstall/help.go index 6f7bdb6d1..b8e73b214 100644 --- a/docs/plugin/uninstall/help.go +++ b/docs/plugin/uninstall/help.go @@ -10,3 +10,23 @@ func GetArguments() string { return ` plugin name Specifies the name of the JFrog CLI Plugin you wish to uninstall from the local plugins pool.` } + +func GetAIDescription() string { + return `Remove a previously installed JFrog CLI plugin from the local plugins pool (~/.jfrog/plugins/). + +When to use: +- Cleaning up plugins that are no longer needed. +- Removing a broken or incompatible plugin before reinstalling. + +Prerequisites: +- The plugin must already be installed locally. + +Common patterns: + $ jf plugin uninstall hello-frog + +Gotchas: +- No confirmation prompt; the plugin binary is removed immediately. +- Reinstalling requires another 'jf plugin install' against the registry. + +Related: jf plugin install, jf plugin publish` +} diff --git a/go.mod b/go.mod index 1c317b2df..33a8f84e0 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,18 @@ go 1.26.3 replace ( // Should not be updated to 0.2.6 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372) github.com/c-bata/go-prompt => github.com/c-bata/go-prompt v0.2.5 + + // TEMPORARY JGC-473 cross-repo coordination — REMOVE all 4 replaces below before merge. + // Each entry points at the in-flight JGC-473 branch of the respective repo + // (jfrog-cli-core on the org's JGC-473-devbase; the four plugin repos on the + // developer's fork). Once each repo's JGC-473 PR merges to its base branch, + // the umbrella's require pinning that publishes from the merged commit is + // sufficient and these replaces must be removed. + github.com/jfrog/jfrog-cli-application => github.com/ehl-jf/jfrog-cli-application v0.0.0-20260521142732-e69fb616d92f + github.com/jfrog/jfrog-cli-artifactory => github.com/ehl-jf/jfrog-cli-artifactory v0.0.0-20260521142738-1785ceb4cf72 + github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260521114102-d507b5c64941 + github.com/jfrog/jfrog-cli-evidence => github.com/ehl-jf/jfrog-cli-evidence v0.0.0-20260521142727-e5d88f0f6841 + github.com/jfrog/jfrog-cli-security => github.com/ehl-jf/jfrog-cli-security v0.0.0-20260521142736-2e9680a7fc03 // Should not be updated to 0.2.0-beta.2 due to a bug (https://github.com/jfrog/jfrog-cli-core/pull/372) github.com/pkg/term => github.com/pkg/term v1.1.0 ) @@ -20,9 +32,9 @@ require ( github.com/jfrog/gofrog v1.7.6 github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64 github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260515045427-eb0cec44a4e2 - github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260519160146-908527b450ff + github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260521114102-d507b5c64941 github.com/jfrog/jfrog-cli-evidence v0.9.4 - github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260430094150-ce7d9b371c6f + github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260521142729-07c901b77823 github.com/jfrog/jfrog-cli-security v1.29.0 github.com/jfrog/jfrog-client-go v1.55.1-0.20260518073856-78c118beaa69 github.com/jszwec/csvutil v1.10.0 diff --git a/go.sum b/go.sum index ccc99a144..535af010b 100644 --- a/go.sum +++ b/go.sum @@ -200,6 +200,14 @@ github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707/go.mod h1:qssHWj6 github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw= github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/ehl-jf/jfrog-cli-application v0.0.0-20260521142732-e69fb616d92f h1:Bel2GiwZHiP72NzJ+H7YhjNs8CF8wPTafAbpblfEeys= +github.com/ehl-jf/jfrog-cli-application v0.0.0-20260521142732-e69fb616d92f/go.mod h1:7krvgZAIQq4hLRfd9YUcqR4nibZa1maejQvi3fcsJp8= +github.com/ehl-jf/jfrog-cli-artifactory v0.0.0-20260521142738-1785ceb4cf72 h1:NARCpnLWhCnEnAqA5Xoptd5dWHnozVY+3CFy4MBfydI= +github.com/ehl-jf/jfrog-cli-artifactory v0.0.0-20260521142738-1785ceb4cf72/go.mod h1:l8DvjDddSHcCvM85YfDEUCoNIlWC9Iufk+pF2C8as9A= +github.com/ehl-jf/jfrog-cli-evidence v0.0.0-20260521142727-e5d88f0f6841 h1:+aKDm0OUHZW1Eqq0MW0diuMLrmcid0zkUcB4abOEXNM= +github.com/ehl-jf/jfrog-cli-evidence v0.0.0-20260521142727-e5d88f0f6841/go.mod h1:BOnpCmqBxt8iJn1KHIehrPuqcdNEbeWa/x5Z7yVSnnc= +github.com/ehl-jf/jfrog-cli-security v0.0.0-20260521142736-2e9680a7fc03 h1:ASI5WiOXNzehzQVW721NgDCO4HqVVJNcsluMtYoWri4= +github.com/ehl-jf/jfrog-cli-security v0.0.0-20260521142736-2e9680a7fc03/go.mod h1:uUvPwN/LmV0d9Ujf/Xb2DwJA2oD5E4IxRXs/V4MS63g= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -416,18 +424,10 @@ github.com/jfrog/gofrog v1.7.6 h1:QmfAiRzVyaI7JYGsB7cxfAJePAZTzFz0gRWZSE27c6s= github.com/jfrog/gofrog v1.7.6/go.mod h1:ntr1txqNOZtHplmaNd7rS4f8jpA5Apx8em70oYEe7+4= github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY= github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w= -github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64 h1:bxcy1v1LXQV4T0kVU1duWQr3h7vKfHyMD1B+IuFLWUw= -github.com/jfrog/jfrog-cli-application v1.0.2-0.20260511133105-55a0ab56fd64/go.mod h1:cKqb/JgN+XuD4RhOxvSZnyGyXw3cJsTZfQT3rk9MCho= -github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260515045427-eb0cec44a4e2 h1:1nCyNPDxH2EXUz0zx2bFBViYrW/KoqGcQDH9Jm8HHs8= -github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260515045427-eb0cec44a4e2/go.mod h1:XESHQN9MEeje13fJaXtbljidwTqlJO+qhhUHHDxwntQ= -github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260519160146-908527b450ff h1:SrtP+sdTSZjbjLDQ4XVtWCM11Ao+Hrj8OADtR+K2eCQ= -github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260519160146-908527b450ff/go.mod h1:D9afcOJmauUYcQZ3WGDg7HejyoBmCQr2XrwXHeN1YY8= -github.com/jfrog/jfrog-cli-evidence v0.9.4 h1:RAqZYaH2RrzmhW+bGA7dx/yTqa4X1fZ4/5V7VVMSJtc= -github.com/jfrog/jfrog-cli-evidence v0.9.4/go.mod h1:nLSLqLIhQz1Hi2n+KjHZTyK1mcmPLevv41LjItLswmE= -github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260430094150-ce7d9b371c6f h1:M1cesbKYSznwPA76dNctjCELxGx34TSSjwoYnJm9/6Y= -github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260430094150-ce7d9b371c6f/go.mod h1:JUdq/dQoNscpta62FDCAcaSVbvcCOr5VkH8UeGTG1HQ= -github.com/jfrog/jfrog-cli-security v1.29.0 h1:TN2OCA5i/iPbikQWzSwVqGvySvIvw1P6rPga+DbVBOI= -github.com/jfrog/jfrog-cli-security v1.29.0/go.mod h1:q38TPlxortIJvbyD3u9P9UhHwyx007tEb9WbXlXw2E0= +github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260521114102-d507b5c64941 h1:+IcNl7eGzY35UaaS/IoK7G2C+xfq9r2H5kbhSCV1eP8= +github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260521114102-d507b5c64941/go.mod h1:D9afcOJmauUYcQZ3WGDg7HejyoBmCQr2XrwXHeN1YY8= +github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260521142729-07c901b77823 h1:NK64DQyt1lIP/G7dcFAK8dgRbmsWBhWcvN0OopnvwY8= +github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260521142729-07c901b77823/go.mod h1:62sExcHFlHJ0CIqGXbtHEmQrHEAIkXBsMRcN6gmn1j4= github.com/jfrog/jfrog-client-go v1.55.1-0.20260518073856-78c118beaa69 h1:ARMrNOd2lp3LjjnH7h1xzaHarrutEUrH4VUF84R/dJE= github.com/jfrog/jfrog-client-go v1.55.1-0.20260518073856-78c118beaa69/go.mod h1:k3PqoFpS6XDt9/4xg3pS8J8JUvxtaz1w2vdTdodknGk= github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= diff --git a/main.go b/main.go index ce11d0c4d..2546b0c18 100644 --- a/main.go +++ b/main.go @@ -263,42 +263,54 @@ func searchSimilarCmds(cmds []cli.Command, toCompare string) (bestSimilarity []s const otherCategory = "Other" const commandNamespacesCategory = "Command Namespaces" +// AI-mode usage strings for namespace shells. These commands have no Action; they +// only host subcommands. The strings appear in `jf --help` and `jf rt --help`. +const ( + rtAIUsage = "Artifactory operations namespace: upload, download, search, copy, move, build-info, repository CRUD, transfer-files, RBAC. Most commands need 'jf c add' first. Use 'jf rt --help' for details." + mcAIUsage = "Mission Control namespace: register JPDs, manage license buckets, acquire/deploy/release licenses across a fleet of Artifactory deployments. Requires a mission-control URL in the active config." + plAIUsage = "JFrog Pipelines namespace: status, trigger, sync, sync-status, version. Requires a pipelines URL in the active config." + completionAIUsage = "Emit shell completion scripts. Subcommands: bash, zsh, fish. Pipe the output into your shell init file, or use --install to write a system path." + pluginAIUsage = "JFrog CLI plugin management: install, uninstall, publish. Plugins are external Go binaries that extend the jf binary with custom subcommands." + configAIUsage = "Server configuration namespace under ~/.jfrog/: add, edit, show, use, rm, import, export. Run 'jf c add' first to bootstrap a server profile." + optionsAIUsage = "Print all JFrog CLI environment variables and their effects. Useful when scripting jf without flags." +) + func getCommands() ([]cli.Command, error) { cliNameSpaces := []cli.Command{ { Name: cliutils.CmdArtifactory, - Usage: "Artifactory commands", + Usage: corecommon.ResolveDescription("Artifactory commands", rtAIUsage), Subcommands: artifactory.GetCommands(), Category: commandNamespacesCategory, }, { Name: cliutils.CmdMissionControl, - Usage: "Mission Control commands", + Usage: corecommon.ResolveDescription("Mission Control commands", mcAIUsage), Subcommands: missioncontrol.GetCommands(), Category: commandNamespacesCategory, }, { Name: cliutils.CmdPipelines, - Usage: "Pipelines commands", + Usage: corecommon.ResolveDescription("Pipelines commands", plAIUsage), Subcommands: pipelines.GetCommands(), Category: commandNamespacesCategory, }, { Name: cliutils.CmdCompletion, - Usage: "Generate autocomplete scripts", + Usage: corecommon.ResolveDescription("Generate autocomplete scripts", completionAIUsage), Subcommands: completion.GetCommands(), Category: otherCategory, }, { Name: cliutils.CmdPlugin, - Usage: "Plugin commands", + Usage: corecommon.ResolveDescription("Plugin commands", pluginAIUsage), Subcommands: plugins.GetCommands(), Category: commandNamespacesCategory, }, { Name: cliutils.CmdConfig, Aliases: []string{"c"}, - Usage: "Server configuration commands", + Usage: corecommon.ResolveDescription("Server configuration commands", configAIUsage), Subcommands: config.GetCommands(), Category: commandNamespacesCategory, }, @@ -317,7 +329,7 @@ func getCommands() ([]cli.Command, error) { }, { Name: cliutils.CmdOptions, - Usage: "Show all supported environment variables", + Usage: corecommon.ResolveDescription("Show all supported environment variables", optionsAIUsage), Category: otherCategory, Action: func(*cli.Context) { fmt.Println(common.GetGlobalEnvVars()) @@ -325,8 +337,8 @@ func getCommands() ([]cli.Command, error) { }, { Name: "login", - Usage: loginDocs.GetDescription(), - HelpName: corecommon.CreateUsage("login", loginDocs.GetDescription(), loginDocs.Usage), + Usage: corecommon.ResolveDescription(loginDocs.GetDescription(), loginDocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("login", corecommon.ResolveDescription(loginDocs.GetDescription(), loginDocs.GetAIDescription()), loginDocs.Usage), BashComplete: corecommon.CreateBashCompletionFunc(), Category: otherCategory, Action: login.LoginCmd, @@ -335,8 +347,8 @@ func getCommands() ([]cli.Command, error) { Name: "access-token-create", Aliases: []string{"atc"}, Flags: cliutils.GetCommandFlags(cliutils.AccessTokenCreate), - Usage: tokenDocs.GetDescription(), - HelpName: corecommon.CreateUsage("atc", tokenDocs.GetDescription(), tokenDocs.Usage), + Usage: corecommon.ResolveDescription(tokenDocs.GetDescription(), tokenDocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("atc", corecommon.ResolveDescription(tokenDocs.GetDescription(), tokenDocs.GetAIDescription()), tokenDocs.Usage), UsageText: tokenDocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -346,8 +358,8 @@ func getCommands() ([]cli.Command, error) { { Name: "api", Flags: cliutils.GetCommandFlags(cliutils.Api), - Usage: apiDocs.GetDescription(), - HelpName: corecommon.CreateUsage("api", apiDocs.GetDescription(), apiDocs.Usage), + Usage: corecommon.ResolveDescription(apiDocs.GetDescription(), apiDocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("api", corecommon.ResolveDescription(apiDocs.GetDescription(), apiDocs.GetAIDescription()), apiDocs.Usage), UsageText: apiDocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -358,8 +370,8 @@ func getCommands() ([]cli.Command, error) { Name: "exchange-oidc-token", Aliases: []string{"eot"}, Flags: cliutils.GetCommandFlags(cliutils.ExchangeOidcToken), - Usage: oidcDocs.GetDescription(), - HelpName: corecommon.CreateUsage("eot", oidcDocs.GetDescription(), oidcDocs.Usage), + Usage: corecommon.ResolveDescription(oidcDocs.GetDescription(), oidcDocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("eot", corecommon.ResolveDescription(oidcDocs.GetDescription(), oidcDocs.GetAIDescription()), oidcDocs.Usage), UsageText: oidcDocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -369,8 +381,8 @@ func getCommands() ([]cli.Command, error) { { Name: "generate-summary-markdown", Aliases: []string{"gsm"}, - Usage: summaryDocs.GetDescription(), - HelpName: corecommon.CreateUsage("gsm", summaryDocs.GetDescription(), summaryDocs.Usage), + Usage: corecommon.ResolveDescription(summaryDocs.GetDescription(), summaryDocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("gsm", corecommon.ResolveDescription(summaryDocs.GetDescription(), summaryDocs.GetAIDescription()), summaryDocs.Usage), Category: otherCategory, Action: summary.FinalizeCommandSummaries, }, @@ -378,8 +390,8 @@ func getCommands() ([]cli.Command, error) { Name: "stats", Aliases: []string{"st"}, Flags: cliutils.GetCommandFlags(cliutils.Stats), - Usage: statsDocs.GetDescription(), - HelpName: corecommon.CreateUsage("st", statsDocs.GetDescription(), statsDocs.Usage), + Usage: corecommon.ResolveDescription(statsDocs.GetDescription(), statsDocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("st", corecommon.ResolveDescription(statsDocs.GetDescription(), statsDocs.GetAIDescription()), statsDocs.Usage), UsageText: statsDocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), diff --git a/main_test.go b/main_test.go index 6be36a0b3..1d9d986e6 100644 --- a/main_test.go +++ b/main_test.go @@ -18,6 +18,7 @@ import ( commandUtils "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/utils" "github.com/jfrog/jfrog-cli-core/v2/common/commands" "github.com/jfrog/jfrog-cli-core/v2/common/format" + corecommon "github.com/jfrog/jfrog-cli-core/v2/docs/common" "github.com/jfrog/jfrog-cli-core/v2/common/project" "github.com/jfrog/jfrog-cli-core/v2/common/spec" "github.com/jfrog/jfrog-cli-core/v2/utils/config" @@ -60,6 +61,15 @@ func setupIntegrationTests() { clientlog.Error(fmt.Sprintf("Couldn't set env: JFROG_CLI_CI_VCS_PROPS_DISABLED. Error: %s", err.Error())) os.Exit(1) } + // Force AI-help mode off so tests that assert on help-text content are + // deterministic regardless of whether the test runner inherits an AI + // agent's env (e.g. CLAUDECODE=1 from Claude Code, CURSOR_AGENT=1 from + // Cursor) that would otherwise auto-flip JGC-473's AIHelpEnabled to true. + err = os.Setenv(corecommon.EnvAIHelp, "false") + if err != nil { + clientlog.Error(fmt.Sprintf("Couldn't set env: %s. Error: %s", corecommon.EnvAIHelp, err.Error())) + os.Exit(1) + } flag.Parse() log.SetDefaultLogger() validateCmdAliasesUniqueness() diff --git a/missioncontrol/cli.go b/missioncontrol/cli.go index e04067d09..e20c9c1ff 100644 --- a/missioncontrol/cli.go +++ b/missioncontrol/cli.go @@ -34,8 +34,8 @@ func GetCommands() []cli.Command { { Name: "license-acquire", Flags: cliutils.GetCommandFlags(cliutils.LicenseAcquire), - Usage: licenseacquire.GetDescription(), - HelpName: corecommon.CreateUsage("mc license-acquire", licenseacquire.GetDescription(), licenseacquire.Usage), + Usage: corecommon.ResolveDescription(licenseacquire.GetDescription(), licenseacquire.GetAIDescription()), + HelpName: corecommon.CreateUsage("mc license-acquire", corecommon.ResolveDescription(licenseacquire.GetDescription(), licenseacquire.GetAIDescription()), licenseacquire.Usage), UsageText: licenseacquire.GetArguments(), ArgsUsage: common.CreateEnvVars(), Aliases: []string{"la"}, @@ -45,8 +45,8 @@ func GetCommands() []cli.Command { { Name: "license-deploy", Flags: cliutils.GetCommandFlags(cliutils.LicenseDeploy), - Usage: licensedeploy.GetDescription(), - HelpName: corecommon.CreateUsage("mc license-deploy", licensedeploy.GetDescription(), licensedeploy.Usage), + Usage: corecommon.ResolveDescription(licensedeploy.GetDescription(), licensedeploy.GetAIDescription()), + HelpName: corecommon.CreateUsage("mc license-deploy", corecommon.ResolveDescription(licensedeploy.GetDescription(), licensedeploy.GetAIDescription()), licensedeploy.Usage), UsageText: licensedeploy.GetArguments(), ArgsUsage: common.CreateEnvVars(), Aliases: []string{"ld"}, @@ -56,8 +56,8 @@ func GetCommands() []cli.Command { { Name: "license-release", Flags: cliutils.GetCommandFlags(cliutils.LicenseRelease), - Usage: licenserelease.GetDescription(), - HelpName: corecommon.CreateUsage("mc license-release", licenserelease.GetDescription(), licenserelease.Usage), + Usage: corecommon.ResolveDescription(licenserelease.GetDescription(), licenserelease.GetAIDescription()), + HelpName: corecommon.CreateUsage("mc license-release", corecommon.ResolveDescription(licenserelease.GetDescription(), licenserelease.GetAIDescription()), licenserelease.Usage), UsageText: licenserelease.GetArguments(), ArgsUsage: common.CreateEnvVars(), Aliases: []string{"lr"}, @@ -67,8 +67,8 @@ func GetCommands() []cli.Command { { Name: "jpd-add", Flags: cliutils.GetCommandFlags(cliutils.JpdAdd), - Usage: jpdadd.GetDescription(), - HelpName: corecommon.CreateUsage("mc jpd-add", jpdadd.GetDescription(), jpdadd.Usage), + Usage: corecommon.ResolveDescription(jpdadd.GetDescription(), jpdadd.GetAIDescription()), + HelpName: corecommon.CreateUsage("mc jpd-add", corecommon.ResolveDescription(jpdadd.GetDescription(), jpdadd.GetAIDescription()), jpdadd.Usage), UsageText: jpdadd.GetArguments(), ArgsUsage: common.CreateEnvVars(), Aliases: []string{"ja"}, @@ -78,8 +78,8 @@ func GetCommands() []cli.Command { { Name: "jpd-delete", Flags: cliutils.GetCommandFlags(cliutils.JpdDelete), - Usage: jpddelete.GetDescription(), - HelpName: corecommon.CreateUsage("mc jpd-delete", jpddelete.GetDescription(), jpddelete.Usage), + Usage: corecommon.ResolveDescription(jpddelete.GetDescription(), jpddelete.GetAIDescription()), + HelpName: corecommon.CreateUsage("mc jpd-delete", corecommon.ResolveDescription(jpddelete.GetDescription(), jpddelete.GetAIDescription()), jpddelete.Usage), UsageText: jpddelete.GetArguments(), ArgsUsage: common.CreateEnvVars(), Aliases: []string{"jd"}, diff --git a/pipelines/cli.go b/pipelines/cli.go index 48dcc0c48..4d19fee63 100644 --- a/pipelines/cli.go +++ b/pipelines/cli.go @@ -35,8 +35,8 @@ func GetCommands() []cli.Command { Name: "status", Flags: cliutils.GetCommandFlags(cliutils.Status), Aliases: []string{"s"}, - Usage: status.GetDescription(), - HelpName: corecommon.CreateUsage("pl status", status.GetDescription(), status.Usage), + Usage: corecommon.ResolveDescription(status.GetDescription(), status.GetAIDescription()), + HelpName: corecommon.CreateUsage("pl status", corecommon.ResolveDescription(status.GetDescription(), status.GetAIDescription()), status.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Action: fetchLatestPipelineRunStatus, @@ -45,8 +45,8 @@ func GetCommands() []cli.Command { Name: "trigger", Flags: cliutils.GetCommandFlags(cliutils.Trigger), Aliases: []string{"t"}, - Usage: trigger.GetDescription(), - HelpName: corecommon.CreateUsage("pl trigger", trigger.GetDescription(), trigger.Usage), + Usage: corecommon.ResolveDescription(trigger.GetDescription(), trigger.GetAIDescription()), + HelpName: corecommon.CreateUsage("pl trigger", corecommon.ResolveDescription(trigger.GetDescription(), trigger.GetAIDescription()), trigger.Usage), UsageText: trigger.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -56,8 +56,8 @@ func GetCommands() []cli.Command { Name: "version", Flags: cliutils.GetCommandFlags(cliutils.Version), Aliases: []string{"v"}, - Usage: version.GetDescription(), - HelpName: corecommon.CreateUsage("pl version", version.GetDescription(), version.Usage), + Usage: corecommon.ResolveDescription(version.GetDescription(), version.GetAIDescription()), + HelpName: corecommon.CreateUsage("pl version", corecommon.ResolveDescription(version.GetDescription(), version.GetAIDescription()), version.Usage), BashComplete: corecommon.CreateBashCompletionFunc(), Action: getVersion, }, @@ -65,8 +65,8 @@ func GetCommands() []cli.Command { Name: "sync", Flags: cliutils.GetCommandFlags(cliutils.Sync), Aliases: []string{"sy"}, - Usage: sync.GetDescription(), - HelpName: corecommon.CreateUsage("pl sync", sync.GetDescription(), sync.Usage), + Usage: corecommon.ResolveDescription(sync.GetDescription(), sync.GetAIDescription()), + HelpName: corecommon.CreateUsage("pl sync", corecommon.ResolveDescription(sync.GetDescription(), sync.GetAIDescription()), sync.Usage), UsageText: sync.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -76,8 +76,8 @@ func GetCommands() []cli.Command { Name: "sync-status", Flags: cliutils.GetCommandFlags(cliutils.SyncStatus), Aliases: []string{"ss"}, - Usage: syncstatus.GetDescription(), - HelpName: corecommon.CreateUsage("pl sync-status", syncstatus.GetDescription(), syncstatus.Usage), + Usage: corecommon.ResolveDescription(syncstatus.GetDescription(), syncstatus.GetAIDescription()), + HelpName: corecommon.CreateUsage("pl sync-status", corecommon.ResolveDescription(syncstatus.GetDescription(), syncstatus.GetAIDescription()), syncstatus.Usage), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), Action: getSyncPipelineResourcesStatus, diff --git a/plugins/cli.go b/plugins/cli.go index 39ca4cf03..b7475b3bd 100644 --- a/plugins/cli.go +++ b/plugins/cli.go @@ -48,8 +48,8 @@ func GetCommands() []cli.Command { Name: "install", Aliases: []string{"i"}, Flags: cliutils.GetCommandFlags(cliutils.PluginInstall), - Usage: installdocs.GetDescription(), - HelpName: corecommon.CreateUsage("plugin install", installdocs.GetDescription(), installdocs.Usage), + Usage: corecommon.ResolveDescription(installdocs.GetDescription(), installdocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("plugin install", corecommon.ResolveDescription(installdocs.GetDescription(), installdocs.GetAIDescription()), installdocs.Usage), UsageText: installdocs.GetArguments(), ArgsUsage: common.CreateEnvVars(installdocs.EnvVar...), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -58,8 +58,8 @@ func GetCommands() []cli.Command { { Name: "uninstall", Aliases: []string{"ui"}, - Usage: uninstalldocs.GetDescription(), - HelpName: corecommon.CreateUsage("plugin uninstall", uninstalldocs.GetDescription(), uninstalldocs.Usage), + Usage: corecommon.ResolveDescription(uninstalldocs.GetDescription(), uninstalldocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("plugin uninstall", corecommon.ResolveDescription(uninstalldocs.GetDescription(), uninstalldocs.GetAIDescription()), uninstalldocs.Usage), UsageText: uninstalldocs.GetArguments(), ArgsUsage: common.CreateEnvVars(), BashComplete: corecommon.CreateBashCompletionFunc(), @@ -69,8 +69,8 @@ func GetCommands() []cli.Command { Name: "publish", Aliases: []string{"p"}, Flags: cliutils.GetCommandFlags(cliutils.PluginPublish), - Usage: publishdocs.GetDescription(), - HelpName: corecommon.CreateUsage("plugin publish", publishdocs.GetDescription(), publishdocs.Usage), + Usage: corecommon.ResolveDescription(publishdocs.GetDescription(), publishdocs.GetAIDescription()), + HelpName: corecommon.CreateUsage("plugin publish", corecommon.ResolveDescription(publishdocs.GetDescription(), publishdocs.GetAIDescription()), publishdocs.Usage), UsageText: publishdocs.GetArguments(), ArgsUsage: common.CreateEnvVars(publishdocs.EnvVar...), BashComplete: corecommon.CreateBashCompletionFunc(),