You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: enhance prompt management with column selection and JSON output
This commit introduces enhancements to the prompt management commands, allowing users to select specific columns for display and output results in JSON format.
The following changes were made:
- Added column selection functionality to `src prompts list` and `src prompts tags list` commands using the `-c` flag. Users can now specify a comma-separated list of columns to display.
- Implemented JSON output functionality for `src prompts list` and `src prompts tags list` commands using the `-json` flag.
- Updated `src prompts update`, `src prompts tags update`, `src prompts delete`, and `src prompts tags delete` commands to accept the ID as a positional argument instead of a flag.
- Updated `src prompts export` to fetch all tags with pagination.
includeBuiltinFlag=flagSet.Bool("include-builtin", false, "Whether to include builtin prompts")
53
181
limitFlag=flagSet.Int("limit", 100, "Maximum number of prompts to list")
54
182
afterFlag=flagSet.String("after", "", "Cursor for pagination (from previous page's endCursor)")
183
+
columnsFlag=flagSet.String("c", strings.Join(defaultPromptColumns, ","), "Comma-separated list of columns to display. Available: id,name,description,draft,visibility,mode,tags")
184
+
jsonFlag=flagSet.Bool("json", false, "Output results as JSON for programmatic access")
55
185
apiFlags=api.NewFlags(flagSet)
56
186
)
57
187
@@ -171,24 +301,18 @@ Examples:
171
301
returnerr
172
302
}
173
303
174
-
fmt.Printf("Showing %d of %d prompts\n\n", len(result.Prompts.Nodes), result.Prompts.TotalCount)
304
+
// Parse columns
305
+
columns:=parsePromptColumns(*columnsFlag)
175
306
176
-
for_, p:=rangeresult.Prompts.Nodes {
177
-
tagNames:= []string{}
178
-
for_, tag:=rangep.Tags.Nodes {
179
-
tagNames=append(tagNames, tag.Name)
180
-
}
307
+
fmt.Printf("Showing %d of %d prompts\n\n", len(result.Prompts.Nodes), result.Prompts.TotalCount)
0 commit comments