Skip to content

Commit f6e3616

Browse files
udaykb2cursoragent
andcommitted
Add AI help descriptions for APM commands (install, publish, update)
Create help.go files with GetDescription() and GetAIDescription() for each APM command: - install: Install APM packages with Artifactory authentication - publish: Publish APM packages to Artifactory - update: Refresh package dependencies with build-info collection Update agent/apm/cli/cli.go to wire up AIDescription fields so commands are discoverable by static analysis tests and AI tools. Fixes: TestAIHelpCoverageGenerated test failure (3 visible APM commands missing AI help) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 700376f commit f6e3616

4 files changed

Lines changed: 121 additions & 0 deletions

File tree

agent/apm/cli/cli.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,23 @@ func GetSubCommands() []components.Command {
2323
// RunInstall extracts jf's own flags manually via ExtractApmSubcommandOptions.
2424
SkipFlagParsing: true,
2525
Description: "Install APM packages with JFrog Artifactory authentication.",
26+
AIDescription: install.GetAIDescription(),
2627
Action: install.RunInstall,
2728
},
2829
{
2930
Name: "publish",
3031
Flags: flagkit.GetCommandFlags(flagkit.AgentApm),
3132
SkipFlagParsing: true,
3233
Description: "Publish an APM package to JFrog Artifactory.",
34+
AIDescription: publish.GetAIDescription(),
3335
Action: publish.RunPublish,
3436
},
3537
{
3638
Name: "update",
3739
Flags: flagkit.GetCommandFlags(flagkit.AgentApm),
3840
SkipFlagParsing: true,
3941
Description: "Refresh APM dependencies to their latest matching refs, with build-info collection.",
42+
AIDescription: update.GetAIDescription(),
4043
Action: update.RunUpdate,
4144
},
4245
}

agent/apm/commands/install/help.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package install
2+
3+
func GetDescription() string {
4+
return "Install APM packages with JFrog Artifactory authentication."
5+
}
6+
7+
func GetAIDescription() string {
8+
return `Install packages declared in apm.yml with authenticated access to JFrog Artifactory registries.
9+
10+
When to use:
11+
- Installing packages into an agent project that has apm.yml configured.
12+
- Accessing private or curated packages from Artifactory via registry credentials.
13+
- Collecting build-info about package dependencies in CI/CD pipelines.
14+
15+
Prerequisites:
16+
- apm CLI (>= 0.1.0) installed and in PATH.
17+
- A registry declared in apm.yml's registries: block or configured via jf setup agent-apm.
18+
- Read permission on the source Artifactory agentpackages repository.
19+
20+
Common patterns:
21+
$ jf agent apm install
22+
$ jf agent apm install --build-name=my-build --build-number=1
23+
24+
Build info:
25+
- Enabled with --build-name and --build-number flags.
26+
- Captures installed packages and their transitive dependencies.
27+
- Published to Artifactory for traceability and compliance.
28+
29+
Environment:
30+
- Credentials injected via APM_REGISTRY_TOKEN_<NAME>, APM_REGISTRY_USER_<NAME>, APM_REGISTRY_PASS_<NAME>.
31+
- Registry configuration sourced from ~/.apm/config.json (set by jf setup agent-apm).
32+
- Lockfile apm.lock.yaml created in working directory.
33+
34+
Related: jf agent apm publish, jf agent apm update, jf setup agent-apm`
35+
}

agent/apm/commands/publish/help.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package publish
2+
3+
func GetDescription() string {
4+
return "Publish an APM package to JFrog Artifactory."
5+
}
6+
7+
func GetAIDescription() string {
8+
return `Publish an agent package to a JFrog Artifactory agentpackages repository with authenticated access.
9+
10+
When to use:
11+
- Publishing custom agent packages for installation across multiple projects.
12+
- Packaging skills, tools, or other agent extensions for organizational use.
13+
- Creating reproducible, versioned deployments of agent components.
14+
15+
Prerequisites:
16+
- apm CLI (>= 0.1.0) installed and in PATH.
17+
- An apm.yml file in the package directory (or parent directories).
18+
- Write permission on the Artifactory agentpackages repository.
19+
- Registry configured via jf setup agent-apm or apm.yml's registries: block.
20+
21+
Common patterns:
22+
$ jf agent apm publish my-org/my-package
23+
$ jf agent apm publish my-org/my-package --build-name=my-build --build-number=1
24+
$ jf agent apm publish my-org/my-package --build-name=my-build --build-number=1 --module=my-module
25+
26+
Package format:
27+
- Directory with apm.yml declaring name, version, and description.
28+
- Optional skills/ subdirectory containing Cursor Agent Skills.
29+
- Version in apm.yml becomes the published package version.
30+
31+
Build info:
32+
- Enabled with --build-name and --build-number flags.
33+
- Captures package metadata and publishing source.
34+
- Published to Artifactory for traceability and compliance.
35+
- Optional --module to group multiple packages in the same build.
36+
37+
Environment:
38+
- Credentials injected via APM_REGISTRY_TOKEN_<NAME>, APM_REGISTRY_USER_<NAME>, APM_REGISTRY_PASS_<NAME>.
39+
- Registry configuration sourced from ~/.apm/config.json (set by jf setup agent-apm).
40+
41+
Related: jf agent apm install, jf agent apm update, jf setup agent-apm`
42+
}

agent/apm/commands/update/help.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package update
2+
3+
func GetDescription() string {
4+
return "Refresh APM dependencies to their latest matching refs, with build-info collection."
5+
}
6+
7+
func GetAIDescription() string {
8+
return `Update packages in apm.yml to their latest matching versions and refresh the lockfile with authenticated access to JFrog Artifactory.
9+
10+
When to use:
11+
- Keeping agent package dependencies up-to-date within declared version constraints.
12+
- Re-resolving dependencies when new versions are published to the registry.
13+
- Collecting updated build-info about package dependencies in CI/CD pipelines.
14+
15+
Prerequisites:
16+
- apm CLI (>= 0.1.0) installed and in PATH.
17+
- An apm.yml file in the working directory with dependencies declared.
18+
- A lockfile apm.lock.yaml already created (e.g., via jf agent apm install).
19+
- Read permission on the source Artifactory agentpackages repository.
20+
- Registry configured via jf setup agent-apm or apm.yml's registries: block.
21+
22+
Common patterns:
23+
$ jf agent apm update
24+
$ jf agent apm update --build-name=my-build --build-number=1
25+
26+
Version constraints:
27+
- Respects version constraints in apm.yml's dependencies section.
28+
- Fetches latest versions matching declared constraints.
29+
- Updates apm.lock.yaml with resolved versions and checksums.
30+
31+
Build info:
32+
- Enabled with --build-name and --build-number flags.
33+
- Captures updated packages and their transitive dependencies.
34+
- Published to Artifactory for traceability and compliance.
35+
36+
Environment:
37+
- Credentials injected via APM_REGISTRY_TOKEN_<NAME>, APM_REGISTRY_USER_<NAME>, APM_REGISTRY_PASS_<NAME>.
38+
- Registry configuration sourced from ~/.apm/config.json (set by jf setup agent-apm).
39+
40+
Related: jf agent apm install, jf agent apm publish, jf setup agent-apm`
41+
}

0 commit comments

Comments
 (0)