Skip to content

Add AI-agent help text to platform-services commands#58

Merged
ehl-jf merged 2 commits into
mainfrom
JGC-473-ai-context-help
Jun 1, 2026
Merged

Add AI-agent help text to platform-services commands#58
ehl-jf merged 2 commits into
mainfrom
JGC-473-ai-context-help

Conversation

@ehl-jf
Copy link
Copy Markdown
Collaborator

@ehl-jf ehl-jf commented May 21, 2026

Summary

Adds AI-agent-oriented help text (AIDescription) so commands render richer help when JFROG_CLI_AI_HELP is truthy or an AI agent is auto-detected. Empty AIDescription falls back to Description; human-mode output is unchanged.

Scope: 10 worker components.Command literals + 1 namespace, inline in commands/*.go and cli/cli.go.

Dependency on jfrog-cli-core

jfrog-cli-core's JGC-473 PR (#1563) has MERGED. This PR's go.mod now requires the merged core master pseudo-version v2.60.1-0.20260601130310-8d52a530da18 directly — no temporary replace directive. Ready to merge on its own.

Linked

Comment thread commands/show_execution_history_cmd.go Outdated
AIDescription: `Fetch the recent execution history of a deployed worker. Each entry includes start/end times, status, who triggered it, the executed version, and a trace ID for cross-referencing platform logs.

When to use:
- Investigating why a scheduled or event-driven worker failed.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: also valid HTTP Triggered Workers

Comment thread commands/edit_schedule_cmd.go Outdated

Gotchas:
- The command refuses to run if manifest.action is not SCHEDULED_EVENT.
- Cron expressions must have exactly 5 fields (minute hour day month dow); 6-field (with seconds) expressions are rejected.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Cron expressions must have exactly 5 fields (minute hour day month dow); 6-field (with seconds) expressions are rejected.
- Cron expressions must have exactly 5 fields (minute hour day month dow); 6-field (with seconds) or less than 5 digits expressions are rejected.

AIDescription: `List the action / event types supported by the target server. Use this to discover the valid 'action' values for 'jf worker init' and 'jf worker list'.

When to use:
- Looking up the exact name of an action (e.g. BEFORE_UPLOAD, GENERIC_EVENT, SCHEDULED_EVENT) before scaffolding a worker.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it return also the types definitions ? If so could be worth mentionning it in this description.

@ehl-jf ehl-jf force-pushed the JGC-473-ai-context-help branch from 07c901b to 77979b3 Compare May 27, 2026 08:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Unit Tests Results

257 tests  ±0   257 ✅ ±0   1m 19s ⏱️ ±0s
  3 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit aeb8b92. ± Comparison against base commit ce7d9b3.

♻️ This comment has been updated with latest results.

Populate components.Command.AIDescription on commands. The new field
(added in jfrog-cli-core JGC-473) makes the conversion layer render
agent-oriented text when JFROG_CLI_AI_HELP is truthy or an AI agent is
auto-detected. Empty AIDescription falls back to Description, so
command output is unchanged in human mode.

Scope: 10 worker commands (commands/*_cmd.go) + 1 namespace in cli/cli.go with AIDescription added inline.

TEMPORARY go.mod pin: the require for github.com/jfrog/jfrog-cli-core/v2
points at JGC-473-devbase (commit d507b5c6) - a coordination branch
that cherry-picks JGC-473 onto core's pinned commit 908527b4 (the last
commit before core master removed yarn.IsVersionSupported and
IsInstalledYarnVersionSupported, which downstream callers in
jfrog-cli-artifactory still depend on). This require MUST be updated to
the merged master commit's pseudo-version after the jfrog-cli-core
JGC-473 PR merges. Do not merge this PR until the require is re-pinned.
@ehl-jf ehl-jf force-pushed the JGC-473-ai-context-help branch from 77979b3 to 9cc43c1 Compare June 1, 2026 13:06
Addresses review comments from @christophermiJfrog:
- edit-schedule: clarify cron validation gotcha (6-field with-seconds and
  under-5-field expressions are both rejected).
- execution-history: include HTTP-triggered workers in the "when to use" guidance.
- list-event: note that --format json also returns each action's TypeScript
  type definitions.

Also runs gofumpt across cli/ and commands/ to fix the Static-Check failure
(struct-field alignment in the AIDescription literals).
@ehl-jf ehl-jf changed the title JGC-473 - Add AI-agent help text to platform-services commands Add AI-agent help text to platform-services commands Jun 1, 2026
@ehl-jf
Copy link
Copy Markdown
Collaborator Author

ehl-jf commented Jun 1, 2026

Thanks @christophermiJfrog — addressed all three in aeb8b92:

  • edit-schedule (cron gotcha): applied your suggested wording — now reads "6-field (with seconds) or less than 5 digits expressions are rejected."
  • execution-history: broadened the "when to use" guidance to include HTTP-triggered workers, not just scheduled/event-driven.
  • list-event (type definitions): yes, --format json returns each action's TypeScript type definitions — called that out in the description now.

Also ran gofumpt across cli/ and commands/ to fix the Static-Check failure (struct-field alignment in the new AIDescription literals).

@ehl-jf ehl-jf merged commit 4cefb6a into main Jun 1, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants