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)
| 1196 | // suggested commands include --allow-hidden-dirs so previewing hidden-dir |
| 1197 | // skills works without an extra manual step. |
| 1198 | func 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 |