| 113 | } |
| 114 | |
| 115 | func cmdHelp(_ string) { |
| 116 | names := make([]string, 0, len(commands)) |
| 117 | for n := range commands { |
| 118 | names = append(names, n) |
| 119 | } |
| 120 | sort.Strings(names) |
| 121 | fmt.Println(ui.Dimmed("available commands:")) |
| 122 | for _, n := range names { |
| 123 | c := commands[n] |
| 124 | display := "/" + n |
| 125 | if c.usage != "" { |
| 126 | display = c.usage |
| 127 | } |
| 128 | fmt.Printf(" %-22s %s\n", display, ui.Dimmed(c.description)) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | // knownModels are suggestions shown by /model when no model is passed. |
| 133 | // Keyed by provider short name (see ProviderKind in main.go). Any model id |