Skip to content

Add Prompt Library support #1168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add Prompt Library support #1168

wants to merge 3 commits into from

Conversation

trly
Copy link
Contributor

@trly trly commented May 22, 2025

Test plan

Changes were manually tested: https://ampcode.com/threads/T-d71803f6-01cb-4655-8150-95a9f4517899

✅ Basic Commands: Help, command structure, and navigation
✅ Tag CRUD: Create, read, update, delete operations for prompt tags
✅ Prompt CRUD: Create, read, update, delete operations for prompts
✅ Export/Import: Full workflow including data integrity verification
✅ Advanced Filtering: Owner, affiliated, built-in, recommended, draft filtering
✅ Search & Pagination: Query search, column selection, cursor pagination
✅ Long Content: Handles large prompt content (2.7KB+ tested)
✅ Unicode Support: Full Unicode in descriptions/content, restricted in names
✅ Empty Libraries: Graceful handling of empty prompt collections
✅ Malformed Data: Robust JSON validation and error reporting
✅ Character Validation: Database constraints properly enforced

trly added 2 commits May 22, 2025 15:04
The following subcommands are included:

- `list`: lists prompts
- `get`: gets a prompt by ID
- `create`: creates a prompt
- `update`: updates a prompt
- `delete`: deletes a prompt
- `tags`: manages prompt tags (with subcommands: list, create, update, delete)
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.
@trly trly requested a review from peterguy May 22, 2025 20:20
This commit modifies the `src prompts create` command to default the prompt owner to the current user if no owner is explicitly specified via the `-owner` flag.
@trly
Copy link
Contributor Author

trly commented May 23, 2025

documentation updates are in
sourcegraph/docs#1155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant