Question Details

No question body available.

Tags

design user-interface cli

Answers (1)

Accepted Answer Available
Accepted Answer
July 2, 2025 Score: 5 Rep: 79,059 Quality: Expert Completeness: 80%

For your design goals of the system being modular, intuitive and fault-resistant you should avoid any temporal coupling between the sub-commands (temporal coupling = you need to run command A before command B to get reliable results).

To avoid temporal coupling between new-session and find-repos, you must make sure that the output of find-repos + any filtering/selection is good enough for new-session to get all the data it needs. That probably means that find-repos needs to output the full paths and not just the repo names.

Some options here are:

  • Just output the full paths from find-repos and let the user select from that. This would be easiest to implement, but probably a less convenient UX.
  • Output a list of space-separated pairs of repo name + path from find-repos. new-session will need to be adapted to accept such a pair as argument(s). In the filtering/selection, the user can focus more easily on the repo name, while the path information is also available for disambiguation if needed.
  • If you absolutely don't want to show the paths to the user, you can make the filtering/selection an integral part of find-repos. You can add an extra command-line option to specify the fitering/selection command to run from within find-repos. Then you can pass a list of only repo names to the filtering/selection command and use the output of that command to find the path that find-repos needs to return.