CliSAK class - 2020/07/31 - a121

Share the finished AutoHotkey v2 Scripts and libraries you made here. Please put the current version of AutoHotkey v2 you used in Square Brackets at the start of the topic title.
User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

CliSAK class - 2020/07/31 - a121

Post by TheArkive » 31 Jul 2020, 06:17

Cli - Swiss Army Knife v3 (CliSAK)


This cli class does/allows the following:
  • captures command line output
  • easy collection of "one-time" command line output
  • easy collection of streaming output with callback functions, can handle multiple CLI sessions simultaneously
  • creates a hidden console window so that CTRL+C and CTRL+Break can still be passed to halt execution with hotkey, button, etc.
  • interactive cli mode in the background, write to StdIn, use mode "s"
  • Capture StdErr separately, if desired, and pass data to optional callback
  • Batch mode, pass a large, dynamically created, multi-line batch, commands executed in succession
  • Define a callback for when a command returns and the prompt is displayed again
  • Capture console animations like incrementing percent, or progress bar
The following CLI environment prompts (shells) can be detected for use with cliPromptCallback() function:
  • Windows batch prompt
  • netsh prompt
  • telnet prompt
  • Android ADB prompt
  • SSH prompt
If you would like support for a new shell prompt, post a msg with details so I can research and add the new environment.

=======================================================================
UPDATES:
=======================================================================

:arrow: Download on GitHub

Huge thanks to the following users:
@segalion , @Sweeet, @sean , @maraksan_user, @SKAN , @HotKeyIt , @maz_1, @lexikos , @TheGood, @just me, @joedf
Details of their contributions are in the comments of the CLI class library. They have done a LOT. Without their contributions, I would not have gained the knowledge or the means to make this.

I'm happy to hear any commets/critiques to make this library more useful, fast, and memory-efficient.
Last edited by TheArkive on 11 Aug 2020, 15:15, edited 1 time in total.

User avatar
joedf
Posts: 7734
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: CliSAK class - 2020/07/31 - a119

Post by joedf » 06 Aug 2020, 16:52

Neat-o! :+1:

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CliSAK class - 2020/07/31 - a119

Post by TheArkive » 07 Aug 2020, 13:30

@joedf
thanks for the encouragement man :) ... if you do any in-depth testing and find any issues please let me know

burque505
Posts: 1357
Joined: 22 Jan 2017, 19:37

Re: CliSAK class - 2020/07/31 - a119

Post by burque505 » 07 Aug 2020, 13:46

:D Better and better!
The examples are really helpful.
Regards,
burque505

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CliSAK class - 2020/07/31 - a119

Post by TheArkive » 07 Aug 2020, 13:55

Thanks @burque505
Fortunately not much as changed with all the alpha updates (that i know of) ... i haven't managed to test much more than the examples lately. I have some bigger projects that will put this library to the test.

Post Reply

Return to “AutoHotkey v2 Scripts and Functions”