-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
Consolidate list and search commands into a single list [term] command with --all flag for pagination control.
Parent: #668 (ls-prompt-ux milestone)
Phase: 3 of 4 (Breaking Change)
Design: docs/implementation/ls-prompt-ux-command-redesign.md (section: Phase 3)
Depends on: #727 (Phase 1), #728 (Phase 2)
Goals
Eliminate the duplicate functionality between list and search by:
- Making
listaccept optional search term:list [term] - Adding
--allflag to control pagination (default: first page only) - Deprecating
searchcommand with clear migration path
Current Problem
Users are confused about when to use list vs search:
langstar prompt list # Lists all prompts
langstar prompt search rag # Searches for promptsBoth do essentially the same thing (query the LangSmith API), but with different pagination defaults.
Proposed Solution
Single command with optional search:
langstar prompt list # First page of all prompts
langstar prompt list rag # First page of "rag" search results
langstar prompt list --all # All prompts (paginate till end)
langstar prompt list "structured output" --all # All search resultsImplementation Tasks
1. Update list command
- Add optional
[search-term]positional argument - Add
--allflag for pagination control- Default (no flag): Fetch first page only
- With
--all: Paginate until no more results
- Support multi-word search terms (quoted)
- Update help documentation for new behavior
- Add progressive disclosure help
2. Deprecate search command
- Add deprecation warning to
searchcommand- "Warning:
searchis deprecated. Uselist [term]instead."
- "Warning:
- Hide
searchfrom main help output - Keep
searchfunctional for backward compatibility - Document migration path
3. Update documentation
- Update README with new
listusage - Update CLI help for
listcommand - Document migration from
searchtolist - Update examples in docs
Example Usage
List all prompts (first page):
langstar prompt listList all prompts (all pages):
langstar prompt list --allSearch prompts (first page):
langstar prompt list rag
langstar prompt list "structured output"Search prompts (all results):
langstar prompt list rag --all
langstar prompt list "structured output" --allMigration Path
Document how to migrate from search to list:
# Old: langstar prompt search "term"
# New: langstar prompt list "term"
# Old: langstar prompt search "term" --limit 100
# New: langstar prompt list "term" --all
# Old: langstar prompt list
# New: langstar prompt list (unchanged)Testing Requirements
Integration Tests
- Test
listwithout arguments (first page, no search) - Test
list --all(all pages, no search) - Test
list <term>(first page, with search) - Test
list <term> --all(all pages, with search) - Test multi-word search terms (quoted)
- Test empty results handling
- Test pagination exhaustion
Deprecation Tests
- Test
searchshows deprecation warning - Test
searchstill works functionally - Test
searchis hidden from main help
Output Tests
- Verify output format is consistent (table with Handle, Type, Downloads, Description)
- Verify "Type" indicator shows "Regular" or "Structured"
- Test JSON output format (
--output json) - Test text output format (
--output text)
Success Criteria
-
listcommand accepts optional search term -
list --allpaginates until exhaustion -
searchcommand is deprecated but functional - Migration path is clearly documented
- Help documentation reflects new behavior
- Tests verify all functionality
- Output format is consistent with design
Breaking Change Notice
This is a breaking change because it changes the default pagination behavior:
Before:
list- First page onlysearch <term>- All results (paginate till end)
After:
list- First page only (unchanged)list --all- All pages (new flag required)list <term>- First page of search results (changed default)list <term> --all- All search results (new flag required)
Users who relied on search fetching all results by default will need to add --all flag.
Version Planning
This should be released as a minor version (not major) because:
searchcommand is deprecated but not removed (backward compatible)listbehavior without arguments is unchanged- New functionality (
--allflag) is additive
Actual removal of search will happen in Phase 4 (major version).
References
- Design document: docs/implementation/ls-prompt-ux-command-redesign.md (section: "Phase 3: Consolidate List/Search")
- Parent issue: ls-prompt-ux milestone - Improve UX consistency across prompt commands #668