Skip to content

Conversation

JR-1991
Copy link
Member

@JR-1991 JR-1991 commented Oct 8, 2025

This pull request introduces a new, flexible file picker system to the CLI, allowing users to select files for upload using either a GUI dialog or a command-line prompt. It refactors the dataset and file upload logic to use this picker, supporting both single and multiple file selection and improving user experience across platforms.

File Picker System Integration

  • Added a new module file_picker with the FilePickerOptions struct and related logic to support both GUI and TTY-based file selection, including multi-file support. This uses the rfd and inquire crates for GUI dialogs and command-line prompts, respectively. [1] [2] [3]

Refactoring CLI Upload Workflows

  • Updated DatasetSubCommand and FileSubCommand in dataset.rs and file.rs to use the new file picker, allowing users to select files interactively or via pre-supplied paths, with support for both single and multiple uploads. [1] [2] [3] [4] [5] [6]

Direct Upload Logic Improvements

  • Refactored the direct upload logic to operate on the new UploadFile type, ensuring robust filename extraction and MIME type inference, and restricting direct uploads to local files only.

Dependency Additions

  • Added new dependencies rfd (for GUI file dialogs) and inquire (for interactive command-line prompts) to Cargo.toml.

These changes collectively improve the flexibility and usability of file selection in the CLI, making uploads more user-friendly and robust across different environments.

Added 'rfd' and 'inquire' crates to Cargo.toml and updated Cargo.lock with their dependencies. This enables new functionality that relies on these libraries.
Updated dataset and file CLI commands to use the new file_picker utility for selecting upload files, supporting both single and multiple file uploads. Refactored direct upload body creation to work with UploadFile objects and improved error handling for file selection and MIME type inference.
Introduces src/cli/file_picker.rs, providing FilePickerOptions, FilePickerResult, and functions for selecting files via GUI or TTY. Also registers the new file_picker module in src/lib.rs. This enables flexible file selection for CLI workflows, supporting both single and multiple file picking.
@JR-1991 JR-1991 self-assigned this Oct 8, 2025
@JR-1991 JR-1991 added the enhancement New feature or request label Oct 8, 2025
Moved the rfd dependency to only build on macOS and Windows, and updated file picker logic to only use the GUI picker on those platforms. On other platforms, file selection now always falls back to TTY prompts.
@JR-1991 JR-1991 merged commit b3e88eb into master Oct 8, 2025
7 checks passed
@JR-1991 JR-1991 deleted the cli-file-picker branch October 8, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

1 participant