gorilla-devs / ferium

Fast and multi-source CLI program for managing Minecraft mods and modpacks from Modrinth, CurseForge, and GitHub Releases
Mozilla Public License 2.0
1.15k stars 49 forks source link

Search functionality #189

Open astridos2go opened 2 years ago

astridos2go commented 2 years ago

The problem

It can be a pain to search for your mods on Modrinth/CurseForge in the broswer to just to get the ID to install using Ferium

My solutions

theRookieCoder commented 2 years ago

I would prefer a UI interface that updates results as you type, and as usual there will be a option-based interface too.

noahdotpy commented 2 years ago

I think this search functionality would need to be added to ferinth and furse as there is not currently a binding for searching for projects in either afaik.

khuongduy354 commented 1 year ago

So it's ferium search then pop up a TUI. As we type, it fetches both modrinth and curseforge, combines into a sorted list, and display to us?

This seems like a big feature. Is it started yet? Im a beginner, but let me join if possible, I'll do my best.

theRookieCoder commented 1 year ago
  1. As Noah mentioned, search APIs haven't been implemented in furse and ferinth (ferinth's search API is being worked on at gorilla-devs/ferinth#9)
  2. As I mentioned in a duplicate issue, this feature is low-priority at the moment
BinToss commented 1 month ago

I would prefer a UI interface that updates results as you type, and as usual there will be a option-based interface too.

I don't think I've ever seen a CLI app have that feature. It might be impossible without an interactive mode to "take over" the console. A hacky solution would clear and rewrite the buffer on user input, but that's slow and isn't supported by all terminal emulators (e.g. xterm.js) The closest thing is an argument completer (sometimes called Tab Completion) which could be implemented for shells that support it. WinGet's Search command is an example of an argument completer that returns web-fetched results. If you have PowerShell 7 or later, winget search gi, CTRL+SPACE would show a list like (see image below) while TAB would complete the current "word" with the first result from that list. image

Non-windows shells like Bash, Fish, Zsh, et cetera have their own APIs for argument completions, so it would have to be implemented for every shell this project's hypothetical argument completion chooses to support.


I realized a few days after posting this that the ferium complete <SHELL> command for per-shell integrations already exists so the contents of its outputs would need to be updated if/when ferium search <query> is completed...or perhaps as part of its development.

theRookieCoder commented 1 month ago

so it would have to be implemented for every shell

I don't think so, I was thinking of tab completions too for things like selecting profiles or game versions. I recall finding a wip library for cross-shell dynamic completion for clap, if I can find it again I'll link to it.