Skip to content

668.2-crud-commands Implement CRUD command structure (create, get, update) #728

@codekiln

Description

@codekiln

Summary

Implement CRUD vocabulary for prompt commands, replacing git-like terminology with standard create/read/update operations.

Parent: #668 (ls-prompt-ux milestone)
Phase: 2 of 4 (Non-Breaking)
Design: docs/implementation/ls-prompt-ux-command-redesign.md (section: Phase 2)
Depends on: #727 (Phase 1 - help system)

Goals

Replace git-like terms (pull, push) with CRUD verbs:

  • Create: langstar prompt create <name> (replaces push for new prompts)
  • Read: langstar prompt get <name> (with modifiers for different aspects)
  • Update: langstar prompt update <name> (replaces push for updates)

Implementation Tasks

1. Implement get command with modifiers

  • Add langstar prompt get <name> (default: text only)
  • Add langstar prompt get metadata <name> (metadata only)
  • Add langstar prompt get model <name> (model info only)
  • Add langstar prompt get structured-output <name> (schema only)
  • Add langstar prompt get <name> --all (everything)
  • Support all handle formats (short, full, UUID)
  • Add progressive disclosure help for get command

2. Implement create command

  • Add langstar prompt create <name> command
  • Support --text <TEXT> for inline template
  • Support --text-file <FILE> for file-based template
  • Support --metadata <JSON> for metadata
  • Support --model <MODEL> for model configuration
  • Support --structured-output <FILE> for JSON schema
  • Support --public flag (default: private)
  • Add progressive disclosure help for create command

3. Implement update command

  • Add langstar prompt update <name> for text updates
  • Add langstar prompt update metadata <name> for metadata updates
  • Add langstar prompt update model <name> for model updates
  • Add langstar prompt update structured-output <name> for schema updates
  • Support --text <TEXT> and --text-file <FILE>
  • Add progressive disclosure help for update command

4. Deprecation notices

  • Mark push as deprecated (but keep functional)
  • Mark pull as deprecated (but keep functional)
  • Add deprecation warnings to push and pull
  • Hide push and pull from main help output
  • Document migration path: pullget, pushcreate/update

Example Usage

Create new prompt:

# Simple prompt
langstar prompt create my-prompt --text "Hello {name}"

# From file
langstar prompt create my-prompt --text-file template.txt

# With model
langstar prompt create my-prompt \
  --text "Answer: {question}" \
  --model claude-3-5-sonnet-20241022

# Structured prompt
langstar prompt create data-extractor \
  --text-file template.txt \
  --structured-output schema.json \
  --model claude-3-5-sonnet-20241022

Read prompt content:

# Get text only (default)
langstar prompt get my-prompt

# Get metadata
langstar prompt get metadata my-prompt

# Get model info
langstar prompt get model my-prompt

# Get schema
langstar prompt get structured-output my-prompt

# Get everything
langstar prompt get my-prompt --all

Update prompt:

# Update text
langstar prompt update my-prompt --text "New template"
langstar prompt update my-prompt --text-file new-template.txt

# Update metadata
langstar prompt update metadata my-prompt --public

# Update model
langstar prompt update model my-prompt --model claude-opus-4-5

# Update schema
langstar prompt update structured-output my-prompt --schema new-schema.json

Testing Requirements

Integration Tests

  • Test create with inline text
  • Test create with text file
  • Test create with model
  • Test create with structured output (schema)
  • Test get default (text only)
  • Test get metadata
  • Test get model
  • Test get structured-output
  • Test get --all
  • Test update text
  • Test update metadata
  • Test update model
  • Test update structured-output
  • Test all commands with all handle formats (short, full, UUID)

Deprecation Tests

  • Test push shows deprecation warning
  • Test pull shows deprecation warning
  • Test push and pull still work functionally
  • Test deprecated commands are hidden from main help

Migration Path

Document how to migrate from old commands to new:

# Old: langstar prompt pull my-prompt
# New: langstar prompt get my-prompt

# Old: langstar prompt pull -- "-/my-prompt"
# New: langstar prompt get my-prompt

# Old: langstar prompt push -r my-prompt -t "template"
# New: langstar prompt create my-prompt --text "template"

# Old: langstar prompt push -r my-prompt -t "updated" (update)
# New: langstar prompt update my-prompt --text "updated"

Success Criteria

  • CRUD commands (create, get, update) fully functional
  • All commands support progressive disclosure help
  • All handle formats work consistently
  • Deprecated commands show warnings but still work
  • Migration path is clearly documented
  • Tests verify all functionality

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions