sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
11.61k stars 270 forks source link

Introduce a standalone CLI program #914

Open sxyazi opened 2 months ago

sxyazi commented 2 months ago

Please describe the problem you're trying to solve

For a long time, Yazi has been designed as a TUI application. But as Yazi continues to evolve, new needs arise, and these needs can be more efficiently met as a CLI program.

When Yazi starts, it needs to read all configuration files, check and merge these configurations, and detect the operating system and terminal type for correct image rendering. These are time-consuming operations, especially detecting the terminal type, which requires sending CSI sequences to the terminal and waiting for a response.

This requires Yazi to have the ability to read from stdin. But this is not suitable when integrating externally, such as calling Yazi in a shell script to perform the following tasks:

The new CLI program will use ya as its name because it is short enough and will be more convenient when executing commands like ya cp or ya mv.

The only issue might be potential name conflicts with shell wrappers, but I don't think this is a big problem - I renamed the shell wrapper to yy last month, and it does not interfere with existing users since shell functions should always take precedence over CLI programs.

For new users who want to use the new CLI, I will note in the documentation that it may conflict with the name of the shell wrapper they set before.

Would you be willing to contribute this feature?

Describe the solution you'd like

.

Additional context

No response

raffaem commented 1 month ago
  • ya cp: A faster alternative to cp with the powerful async task scheduling system, providing a progress bar and more beautiful. This is part of future plans.

  • ya mv: A faster alternative to mv with the powerful async task scheduling system, providing a progress bar and more beautiful. This is part of future plans.

What would be the difference with advcpmv?

eljamm commented 1 week ago

Sorry for all the reference spam 😓

I learned that it might not always be appropriate to link issues in commits, especially if GitHub's gonna reference it again after every rebase.