Skip to content

Conversation

azzazzel
Copy link

Problem

While the CLI now supports intelligent value inference and model discovery, users still need to know the exact flags and parameters to create indexes. The command-line interface can be intimidating for new users who are unfamiliar with vector database concepts or the specific configuration options available. There was no guided way to walk users through the index creation process step by step.

Solution

This PR introduces an interactive mode for index creation that guides users through the configuration process with a user-friendly interface. The changes include:

  • Interactive Mode Flag: Added --interactive/-i flag to enable guided index creation
  • Step-by-Step Configuration: Interactive prompts guide users through all necessary configuration options
  • Smart Defaults: Pre-fills sensible defaults based on previous selections and available models
  • Model Integration: Dynamically fetches and displays available models for selection during interactive mode
  • Input Validation: Real-time validation and error handling for user inputs
  • Graceful Exit: Users can exit interactive mode at any time using Esc or Ctrl+C
  • Interactive Components: Added reusable interactive components for choice selection, text input, and integer input
  • Consistent Styling: All interactive components use the centralized style system for consistent appearance

The interactive mode makes the CLI accessible to users of all skill levels while maintaining the power and flexibility of the command-line interface for advanced users.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

  1. Interactive Mode Testing: Test the new interactive mode for index creation:

    # Test interactive serverless index creation
    pc index create my-index --interactive
       
    # Test with existing flags (should use as defaults)
    pc index create my-index --interactive --cloud aws
  2. Backward Compatibility Testing: Ensure non-interactive mode still works:

    # Test all existing command patterns
    pc index create my-index --dimension 1536 --metric cosine --cloud aws --region us-east-1
    pc index create my-index --model llama-text-embed-v2
  3. Integration with Other Features: Test interactive mode with other features:

    # Test with --assume-yes flag (should skip confirmations)
    pc index create my-index --interactive -y

This PR completes this series of user experience improvements. It builds on top of #37 and contains all the changes from the previous branches in the series.

# Conflicts:
#	internal/pkg/cli/command/index/create.go
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