Skip to content

Clone Integration - Clone repositories directly from TUI/CLI #1

@shreeshjha

Description

@shreeshjha

Feature Description

Implement repository cloning functionality directly from RepoScout, completing the workflow from search to local development.

Priority

High - Completes the core user workflow

Effort Estimate

Easy - ~2-3 hours

User Stories

As a developer, I want to:

  • Clone a repository with a single keypress in TUI
  • Clone from CLI without switching to my shell
  • Choose between SSH and HTTPS clone URLs
  • Configure a default clone directory
  • See clone progress in real-time
  • Optionally open the cloned repo in my editor

Acceptance Criteria

CLI Commands

  • reposcout clone <repo> - Clone repository to current/default directory
  • reposcout clone <repo> --path <dir> - Clone to specific directory
  • reposcout clone <repo> --ssh - Use SSH URL instead of HTTPS
  • reposcout clone <repo> --open - Open in default editor after clone
  • Show progress indicator during clone operation
  • Handle errors gracefully (network, permissions, existing directory)

TUI Integration

  • Press `c` to clone selected repository
  • Show modal dialog with clone options:
    • Destination directory (with default)
    • Protocol selection (SSH/HTTPS)
    • Open in editor checkbox
  • Show progress indicator during clone
  • Display success/error message
  • Return to results list after completion

Configuration Support

  • `clone.default_directory` - Default clone location (e.g., ~/Projects)
  • `clone.protocol` - Default protocol (ssh/https)
  • `clone.editor_command` - Command to open editor (e.g., `code`, `nvim`)
  • Config via `~/.config/reposcout/config.toml`

Edge Cases

  • Directory already exists - prompt or error
  • Network failure - retry logic
  • Insufficient disk space - clear error message
  • SSH key not configured - fallback to HTTPS or clear error
  • Private repositories - handle authentication

Testing Checklist

  • Clone public GitHub repository (HTTPS)
  • Clone public GitLab repository (HTTPS)
  • Clone with SSH protocol
  • Clone to custom directory
  • Clone and open in editor
  • Handle existing directory error
  • Cancel clone operation mid-transfer
  • Clone with network interruption

UI/UX Considerations

  • Keep clone operation async/non-blocking in TUI
  • Show estimated time remaining if possible
  • Provide clear feedback on success/failure
  • Allow user to continue browsing while cloning

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions