Improve CLI User Experience

Hi everyone, @NeoNacho @abertelrud @tomerd

I'm Hemanth, I completed Bachelor of Engineering in Information Science in August 2021.

I am proficient with Swift and also have basic knowledge of command line. I have made couple apps with SwiftUI.

This year for GSoC 2022 I am interested in the project "Improve CLI User Experience" for Swift Package Manager. This is my first time participating in GSoC and I'm new to open source contributions. So please let me know what I need to do for this project.

Here's my GitHub profile: hemanthpulimi (Hemanth) · GitHub

Thank you.


Hi @hemanthpulimi and thank you for your interest in the project.

SwiftPM is Swift's dependency management tool and can be used from the command line and from IDEs.
The project focus is on improving the command line experience which boils down to two parts:

  1. Input: How users pass arguments, options, flags and get help around these.
  2. Output: How SwiftPM emits output to users which includes direct output, indirect output (side effects), progress, errors and warnings.

For user input, SwiftPM uses Swift Argument Parser (GitHub - apple/swift-argument-parser: Straightforward, type-safe argument parsing for Swift) - a library that helps parse command line arguments.
Potential improvements in this context are mostly optimizing the definition of available command line arguments:

  • Audit inputs for consistency on language and style
  • Making options type safe
  • Logical grouping
  • Expanding and improving the help and usage explanations

For user output, SwiftPM outputs to the stdout and stderr, including progress indicators for operations like downloading or fetching dependencies.

When stdout is connected to a tty and the terminal supports it, SwiftPM uses ANSI escape codes to provide interactive progress-oriented output. When connected to a pipe, the output tends to be more focused on the actions taken and less on progress, since plain output is primarily used in Continuous Integration environments where issues have to be investigated after-the-fact.

Potential improvements is this context include:

  • Audit output options for consistency (e.g. output format option)
  • Improved progress indicators
  • Improved duration tracking and reporting
  • For concurrent work, present output from active task per worker / thread
  • Provide additional contextual information for warnings and errors
  • Graphical output for dependency graphs
  • General modernization the output - adopting modern CLI UX/UI best practices
1 Like