MCPcopy Create free account
hub / github.com/cli/cli / printReviewHint

Function printReviewHint

pkg/cmd/skills/install/install.go:1198–1221  ·  view source on GitHub ↗

printReviewHint warns the user to review installed skills and suggests preview commands. When sha is non-empty the suggested commands include @SHA so the user previews exactly the version that was installed. When allowHiddenDirs is true, the suggested commands include --allow-hidden-dirs so previewi

(w io.Writer, cs *iostreams.ColorScheme, repo, sha string, skillNames []string, allowHiddenDirs bool)

Source from the content-addressed store, hash-verified

1196// suggested commands include --allow-hidden-dirs so previewing hidden-dir
1197// skills works without an extra manual step.
1198func printReviewHint(w io.Writer, cs *iostreams.ColorScheme, repo, sha string, skillNames []string, allowHiddenDirs bool) {
1199 if len(skillNames) == 0 {
1200 return
1201 }
1202 fmt.Fprintf(w, "\n%s Skills may contain prompt injections or malicious scripts.\n", cs.WarningIcon())
1203 if repo == "" {
1204 fmt.Fprintln(w, " Review the installed files before use.")
1205 return
1206 }
1207 fmt.Fprintln(w, " Review installed content before use:")
1208 fmt.Fprintln(w)
1209 hiddenFlag := ""
1210 if allowHiddenDirs {
1211 hiddenFlag = " --allow-hidden-dirs"
1212 }
1213 for _, name := range skillNames {
1214 if sha != "" {
1215 fmt.Fprintf(w, " gh skill preview %s %s@%s%s\n", repo, name, sha, hiddenFlag)
1216 } else {
1217 fmt.Fprintf(w, " gh skill preview %s %s%s\n", repo, name, hiddenFlag)
1218 }
1219 }
1220 fmt.Fprintln(w)
1221}
1222
1223// printHostHints prints any agent-specific post-install guidance for the
1224// hosts that were installed to. Most agents need no extra steps; this is

Callers 3

installRunFunction · 0.85
runLocalInstallFunction · 0.85
Test_printReviewHintFunction · 0.85

Calls 1

WarningIconMethod · 0.80

Tested by 1

Test_printReviewHintFunction · 0.68