Feature Indicate that something is running in gCLI

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
A feature I only realised recently is that you can know the status of a running task by the colour of the character pane. Obviously I knew green and red showed the result of the last command, but I hadn't appreciated that i can tell if a command has finished because it has transitioned from grey to either green or red.

I use the gCLI a lot and it would be really nice to have this feature replicated there. I'd be happy to write the code to do so but not sure how we'd like to do the UI. Perhaps a coloured box, or background colour of the text input div?
 

fronobulax

Developer
Staff member
I'm not sure I understand your request or use case. Vocabulary problem on my part, perhaps?

Specifically how do you have your screen arranged/mafia windows tabbed so that you can interact with the gCLI but not see the character pane and status? Perhaps the relay browser is involved and you are running on one screen but hosting mafia elsewhere (which I think is possible)?

Thanks.
 

Crowther

Active member
I'm going to use Occum's Razor and guess gausie means CLI, not gCLI. My gCLI (graphical command line interface) has a colored character pane. My CLI doesn't have any color, but could in theory.
 

fronobulax

Developer
Staff member
I'm going to use Occum's Razor and guess gausie means CLI, not gCLI. My gCLI (graphical command line interface) has a colored character pane. My CLI doesn't have any color, but could in theory.

Ah... Running headless? "text input div" sort of threw me off.

If I had a cli command that told me scripts were running, I might find it useful, especially if it were coupled with a Stop command for those times when bashing the abort button didn't work because the scriptwriter was too clever and restarted on an abort.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Nope, I meant the relay CLI. Sorry, I somehow got it into my head that gCLI meant relay CLI which it of course doesn't. And yeah, using it over the internet while it's running headless on a different computer.
 
Last edited:

Crowther

Active member
Ah... Running headless? "text input div" sort of threw me off.

If I had a cli command that told me scripts were running, I might find it useful, especially if it were coupled with a Stop command for those times when bashing the abort button didn't work because the scriptwriter was too clever and restarted on an abort.
Ha! Yeah, that's the terrifying part of running it over CLI. If worse comes to worse, you hit control-C and kill the mafia process.
Nope, I meant the relay CLI. Sorry, I somehow got it into my head that gCLI meant relay CLI which it of course doesn't. And yeah, using it over the internet while it's running headless on a different computer.
Now I'm confused again. There's a relay browser, a gCLI and a CLI, but I don't know any relay CLI.
 

fronobulax

Developer
Staff member
I'm guessing it is Preferences->Look & Feel-> Relay Browser -> Add command-line interface to right side pane

although checking it didn't do anything I could see in 15 seconds of playing. (My browser is locked down and the character I just checked does not have access to chat which may b a factor).

That said, what is wrong with positioning the GUI so only the char pane is visible? Are you allowing network devices to access relay browser and thus on a different device?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I've probably had that preference enabled for 10 years so I may have forgotten it wasn't baked in!

Yes, I am running an nginx configuration that lets me do a basic HTTP auth and access it from another device. I realise this is not what most people do, and I don't do it all the time, but I'm also very happy to write the code to support it.
 

fronobulax

Developer
Staff member
Now that we understand...

This is really niche but if you feel like writing the code I will at least look at it.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Patch attached!

Its immediate requirement is niche but it's a pretty nice feature for anyone who uses the Relay CLI I think.
 

Attachments

  • relay-cli-status.patch
    3.2 KB · Views: 18
Last edited:

Rinn

Developer
I've probably had that preference enabled for 10 years so I may have forgotten it wasn't baked in!

Yes, I am running an nginx configuration that lets me do a basic HTTP auth and access it from another device. I realise this is not what most people do, and I don't do it all the time, but I'm also very happy to write the code to support it.

Mind sharing the relevant nginx config? I was trying to reverse proxy the relay browser from my server a while ago and I was having trouble getting it to work.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Mind sharing the relevant nginx config? I was trying to reverse proxy the relay browser from my server a while ago and I was having trouble getting it to work.

Mine is part of some other config so I might share it later, but it's essentially this.
 

fronobulax

Developer
Staff member
It compiles. I discovered the wonder that is the gCLI in the relay browser. I observed that the relay gCLI is does not appear as an option (in the relay RHS) for a character that has not visited the Temple of Literacy. But what I am not seeing is any indication in the relay gCLI that mirrors KoLmafia's status. What am I looking for? Specifically I want to decide whether: a) it is working once I know what to look for; b) it is not working because of something in my environment; or c) it is just not working. :)
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Yeah it seems that mafia copies "cli.html" into the relay folder and doesn't check to update it, so you need to remove that manually to get it repopulated by the mafia default. Once you're running the new version it should be fairly obvious!
 

fronobulax

Developer
Staff member
Yeah it seems that mafia copies "cli.html" into the relay folder and doesn't check to update it, so you need to remove that manually to get it repopulated by the mafia default. Once you're running the new version it should be fairly obvious!

OK. Will check tomorrow. But raises the question, how will it happen automatically for "regular"users?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
It's a good question but I figured since it seems to be a niche feature anyway, users who want it can find this thread and find out?
 

AlbinoRhino

Active member
I already have a customized cli.html too. I'm sure it can be reconciled with any changes made to it but I don't think I'd like if mafia overwrote my changes every time I re-build.

Edit: Nevermind, I see that I merged my changes into the local repo at some point....doh
 
Last edited:

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I guess with this feature you can also now build a bridge to kolmafia's CLI (and thus ASH) over HTTP, which is pretty cool
 

heeheehee

Developer
Staff member
I've had for some years now a mchat (tabbed-chat) relay override that adds a CLI tab which pretty much just does that. I think cheesecookie made some edits to it or something?

Either way, Mafia also has integration with chat proper where you can type /cli foo, which is what that code apparently uses.

https://sourceforge.net/projects/mchatoverrides/
https://sourceforge.net/p/ccascend/code/1411/tree/mchatoverridesfork/

(the fork makes me sad in that it adds hardcoding instead of taking advantage of the extensible framework I'd put in place, but that's irrelevant)
 

AlbinoRhino

Active member
I tend to use Javascript in the browser rather than relay overrides. Some time ago I added a bit of code to RelayRequest.java to return property values to an xhr request. I thinks it's my favorite "improvement" in my local build.
 
Top