Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
134 stars 2 forks source link

Bot Commands via Command Line #1491

Open Geenz opened 6 months ago

Geenz commented 6 months ago

Is your feature request related to a problem? Please describe.

It's not convenient to run commands directly from the Resonite client, especially when you do not have the ability to launch the full graphical client. Sometimes it's more convenient, and flexible more broadly, to run commands from the command line instead via some sort of "ResoniteCMD" application or set of PowerShell commandlets.

There's a myriad of use cases for this, for example:

Describe the solution you'd like

The ability to run commands for the bot via command line. Preferably something scriptable, e.g., through PowerShell.

Describe alternatives you've considered

Using the client. Sometimes this is not accessible.

Additional Context

I'm mainly logging this one since I want to eventually add this. However additional discussion and proposals would be appreciated (for example, PowerShell commandlets vs. a dotnet CLI tool).

Requesters

Geenz, Veer, Dante, Git

DanteTucker commented 6 months ago

I made my own personal tool for running commands out of the client, among other things. I’ll share it here in case it’s useful to anyone else in the meantime. https://github.com/DanteTucker/everchat

Geenz commented 6 months ago

Yee, was gonna note that there's a bunch of community provided tools for this (such as ReCon) that can be used that function as chat applications. This would just be more formal version you could have the ability to script for your specific purposes.

gentlecolts commented 6 months ago

Why the choice of powershell? I imagine many users looking to perform tasks like will be interested in doing so on Unix systems, and powereshell is perfectly capable of running bash scripts naively

Geenz commented 6 months ago

@gentlecolts Main reason is we'd be looking to bootstrap FrooxEngine to handle some of this stuff. PowerShell Core is available on pretty much every platform people would typically use - even for administrative purposes. We'd be targeting that. The rest would be just be ensuring that we have the specific commandlets (which are well supported by .NET and the like) defined, and sorting out the credential end of this (which is something we could build in- possibly even into the client itself so this becomes just an extension of the client).

stiefeljackal commented 6 months ago

Although having both is a good thing, I do believe PowerShell should be the priority due to one major benefit: the ability to interact with .NET objects via PowerShell scripting and CLI. Since you can interact with .NET objects within PowerShell, you can call the object's methods and interact with fields and properties of the object. Because FrooxEngine is built on .NET, it makes it easier to just add references to the libraries and build the necessary PowerShell cmdlets.

I have been working on a PowerShell module to interact with Resonite's API and other libraries before Resonite was released. With the current library setup (FrooxEngine, Elements, and SkyFrost), you can easily create the necessary cmdlets to perform simple tasks such as retriving records, downloading assets, compress and decompress the data tree, and traversing down the data tree to name a few.

I'll share the link to the project in case you are curious.

https://github.com/stiefeljackal/Jworkz.ResonitePowerShellModule

The project has been placed on a hiatus since I am involved with the majority of Creator Jam events (from October to January) and MMC activities, so it is still in an alpha-ish state since there is only a few cmdlets. I do hope to resume it after the MMC Awards Ceremony.

Geenz commented 6 months ago

@stiefeljackal Yeah- that's another thing about PowerShell from the start. Going from .NET to PowerShell is pretty easy. Sure it makes the requirement that you need PowerShell to use these cmdlets, but I don't see that as problematic when it means we can add new commands to the core codebase, and have them instantly available to users through this method as well.