promptui
TF
promptui | TF | |
---|---|---|
8 | 3 | |
5,913 | 134 | |
0.3% | - | |
0.0 | 10.0 | |
12 days ago | over 3 years ago | |
Go | AutoHotkey | |
BSD 3-clause "New" or "Revised" License | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
promptui
-
...and now gh-i to search for issues interactively!
The navigation is dealt with by the promptui framework, so in this respect the extension does not touch/re-defines it. This said, let's move the conversation on GitHub, I am sure we can find a way to make it work :)
- Best interactive cli library?
-
Interactive CLI prompts in Go
View on GitHub
-
Hey guys, why is the character ‘w’ missing?
The fmt.Scan family of functions exist because there are similar functions in C, but they really aren't suitable for any purpose. I would recommend beginners to just avoid them completely because the way they work is endlessly surprising. In this case, the problem you're running into is that Scanln expects a line, but you had a space instead, but honestly, don't try to debug it, just switch to https://github.com/manifoldco/promptui.
-
Building an interactive CLI app with Go, Cobra & promptui
This tutorial will guide us through building an interactive CLI app with Go, Cobra and promptui. We will learn how to prompt the user for input data and persist this data to an SQLite database. Unlike the previous app we built, this experience will feel more like a two way conversation.
-
Tf - A CLI to generate terraform configuration with an interactive prompt
I got into cli applications lately and came across cobra. It was highly intuitive and very much easy to use so I couldn't get enough of it and wanted to create something to make it useful along with promptui.
-
I wanted many SSH logins to be always close at hand, so I made a tool for connecting in just a few keystrokes
It uses this library to create an interactive prompt. Just use the up and down arrows to select the host you want.
- How Does This Cli Tool Accomplish Interactivity
TF
-
Difficulty generating user.ahk.api file for lib function autocomplete in SciTE
`; Written by XeroByte` `; Generates the User.ahk.api file to add custom function & label intellisense!` `; to initate: use BuildUserAhkApi(A_ScriptFullPath,1) from the main script` `; Requires: grep() by Titan/Polyethelene` [`https://github.com/camerb/AHKs/blob/master/thirdParty/titan/grep.ahk`](https://github.com/camerb/AHKs/blob/master/thirdParty/titan/grep.ahk) `; Reqiures: isDir() Function` `; Optionally include TF_Wrap() from the TF Library` [`https://github.com/hi5/TF/blob/master/tf.ahk`](https://github.com/hi5/TF/blob/master/tf.ahk) `TF_Wrap := "TF_Wrap" ; This is for a workaround to make the script still work even without the TF library - need to call the function dynamically.` `if(isDir(AhkScriptPath)){` `Loop, %AhkScriptPath%\*.ahk,0,1` `AhkApiText .= BuildUserAhkApi(A_LoopFileLongPath, 0, RecurseIncludes, Labels, WrapWidth, AhkApiPath, 1)` `}else{` `FileRead, ThisScriptTxt, %AhkScriptPath%` `; Retrieve Functions` `grep(ThisScriptTxt, "m)^\s*[a-zA-Z0-9_-]*\([^\)]*\)\s*\{(\s*;.*?$)*", MatchCollection,1,0,"§")` `loop, parse, MatchCollection, §` `{`
-
Does file append/copy/write require admin privilege's? Am I doing something wrong?
; Generated by Auto-GUI 3.0.1 #SingleInstance Force #NoEnv SetWorkingDir %A_ScriptDir% SetBatchLines -1 #Include, %A_ScriptDir%\skins\tf.ahk ;https://github.com/hi5/TF#TF_ReplaceInLines ;https://github.com/hi5/TF#TF_ReplaceInLines if !(A_IsUnicode=1 and A_PtrSize=4) { SplitPath, A_AhkPath, , dir Run, %dir%\AutoHotkeyU32.exe "%A_ScriptFullPath%" ExitApp } hSkinH := DllCall("LoadLibrary", "Str", "SkinHu.dll") DllCall("SkinHu\SkinH_AttachEx", "Str", A_ScriptDir "\skins\0021.she") ;If (Gameexe !="") ; SelectedGame := Gameexe ;Else ; SelectedGame := "Selected Game" Logdir := A_AppDataCommon "\GameslistGeo11" FileCreateDir, %Logdir% LogGames := A_AppDataCommon "\GameslistGeo11\Gamename.txt" GamesUpdate := A_AppDataCommon "\GameslistGeo11\GamesUpdate.txt" ColumnNr := [1] delimiter := "," Loop, read, %LogGames% { if (A_LoopReadLine="") continue else { Cell := StrSplit(A_LoopReadLine,delimiter) If (Stored="") Stored := Cell[2] "||" Stored else Stored := Cell[2] "|" Stored } } global GameError := 0 Imagine := A_ScriptDir "\ico\bg.jpg" Gui, Add, Picture, x-8 y0 w610 h385 , % Imagine Gui Font, s9, Segoe UI Gui Add, DropDownList, vVersion x288 y72 w84, x64 game||x32 game Gui Add, Text, x192 y16 w189 h61, Select Game Location and version,`n'Generate' will push the Geo11 files and a Geo11 desktop shortcut. Gui Add, Button, gGenerate x288 y112 w84 h23, Generate Gui Add, Button, gBrowse x184 y72 w85 h23, Browse Gui Add, Button, gUninstall x288 y248 w84 h23, Uninstall Gui Add, ListBox, vStoredforDisplay x176 y176 w102 h95, %Stored% Gui Add, Button, gConfiger x288 y192 w84 h23, Config Game Gui Add, Text, x179 y143 w101 h23, Current Installs Gui Add, Text, x8 y8 w154 h278, This app will take the Geo11 files such as dxd11.dll and move to a "geo" folder in the game's directory. `n`nIt creates a desktop shortcut, when clicked, it will move the game's original "dxd11.dll" files to "/originaldx" and load geo11 dxd11 files. Creating a VR specific launcher/shortcut.`n`nOn game close, the files will return to original locations. ;Gui Add, Edit, x184 y216 w85 h23, %SelectedGame% Gui Show, w390 h295, Mod Manager for Geo11 Return Browse: { FileSelectFile, Selectgame, 32, , Select a game, Application (*.exe) if (Selectgame = "") MsgBox, You didn't select anything. else { SplitPath, Selectgame, Gameexe, Gamepath, Gameextenstion, Gamenameonly if !FileExist(LogGames) { FileAppend,,%LogGames% GameError := 0 msgbox, file doesnt exist Goto, Nextup } Else { Loop, read, %LogGames% { Currentline := A_LoopReadLine If InStr(Currentline, Gameexe) { LineRead := StrSplit(Currentline,delimiter) Gamename := LineRead[2] Msgbox, Error. %Gamename% already has Geo11. GameError := 1 break } Else GameError := 0 } ;Gui Add, ComboBox, vcbx w200 vVersChoice, x32||x64 } } Nextup: ;Gui Add, ComboBox, vcbx w200 vVersChoice, x32||x64 } return Generate: { if (GameError=0) { GuiControlGet,VersionRet,, Version Msgbox, %VersionRet% Dlls for %Gameexe% if (VersionRet="x64 game") { 64or32 := "\Geo3dFilesGoHere\x64\" } Else { 64or32 := "\Geo3dFilesGoHere\x32\" } DllLocal := A_ScriptDir 64or32 ChangeNames := DllLocal ;arraygeo := ["d3d11.geo", "d3dcompiler_47.geo", "d3dx.geo", "d3dxdm.geo", "nvapi64.geo"] FileCreateDir, %Gamepath%\geo ;arraygeo := ["d3d11.geo", "d3dcompiler_47.geo", "d3dx.geo", "d3dxdm.geo", "nvapi64.geo"] arraydll := ["d3d11.dll", "d3dcompiler_47.dll", "d3dx.ini", "d3dxdm.ini", "nvapi64.dll"] For index, value in arraydll { geo := % arraydll[index] FileCopy, %DllLocal%\%geo%, %Gamepath%\geo\%geo%, 1 } FileCopy, %A_ScriptDir%\leaveingamedir.exe, %Gamepath%\leaveingamedir.exe, 1 FileCopyDir, %DllLocal%\ShaderFixes, %Gamepath%\ShaderFixes, 1 Logfile := Gamepath "\Gamename.txt" Random, rand, 1, 12 Localicon := A_ScriptDir "\ico\" rand ".ico" TextforGamelog := Selectgame "," Gameexe "`n" FileDelete, %Logfile% ; FileAppend, %Selectgame%, %Logfile% FileAppend, %TextforGamelog%, %LogGames% msgbox, %TextforGamelog% ShortcutMaker := A_Desktop "\" Gamenameonly " VR.lnk" AHKLocal := Gamepath "\leaveingamedir.exe" FileCreateShortcut, %AHKLocal%, %ShortcutMaker%, %Gamepath%,,,%Localicon% Msgbox, Geo11 Shortcut sent to desktop. Reload } Else Msgbox, Select a game without Geo11 files } return Configer: { GuiControlGet, StoredGet,,StoredforDisplay delimiter := "," Loop, read, %LogGames%, %GamesUpdate% { Currentline := A_LoopReadLine If InStr(Currentline, StoredGet) { LineRead := StrSplit(Currentline,delimiter) GameLocation := LineRead[1] SplitPath, GameLocation, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive Run, %OutDir%\geo\d3dxdm.ini } else Continue } } return Uninstall: { GuiControlGet, StoredGet,,StoredforDisplay Msgbox, 4,, Uninstall Geo11 for %StoredGet%? IfMsgBox Yes { delimiter := "," Loop, read, %LogGames%, %GamesUpdate% { Currentline := A_LoopReadLine If InStr(Currentline, StoredGet) { LineRead := StrSplit(Currentline,delimiter) GameLocation := LineRead[1] SplitPath, GameLocation, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive Filedelete, %OutDir%\geo\*.dll Filedelete, %OutDir%\geo\*.ini Filedelete, %OutDir%\leaveingame*.exe Filedelete, %OutDir%\VRLaun*.exe ;FileAppend %A_LoopReadLine%`n ;FileMove, %GamesUpdate%, %LogGames%, 1 LineNumber := A_Index EndLine := LineNumber + 1 } else Continue } LogTF := "!"LogGames TF_ReplaceLine(LogTF,LineNumber,EndLine,"") Msgbox, Success Reload Goto, Beginning } Else Goto, Beginning } Beginning: return ;arraygeo := ["d3d11.geo", "d3dcompiler_47.geo", "d3dx.geo", "d3dxdm.geo", "nvapi64.geo"] arraydll := ["d3d11.dll", "d3dcompiler_47.dll", "d3dx.ini", "d3dxdm.ini", "nvapi64.dll"] FileCreateDir, %Gamepath%\geo For index, value in arraydll { ;val := % value ;geo := % arraygeo[index] ;FileCopy, %DllLocal%\%val%, %DllLocal%\geo\, 1 ;sleep, 15 ;FileMove, %DllLocal%\geo\%val%, %DllLocal%\geo\%geo%, 1 ;sleep, 10 dll := % arraydll[index] FileCopy, %DllLocal%\%dll%, %Gamepath%\geo\, 1 } ;For index, value in arraygeo ;{ ; geo := % arraygeo[index] ; FileCopy, %DllLocal%\geo\%geo%, %Gamepath%, 1 ;} ;FileCopy, %A_ScriptDir%\leaveingamedir.exe, %Gamepath%\leaveingamedir.exe, 1 ;FileCopyDir, %DllLocal%\ShaderFixes, %Gamepath%\ShaderFixes, 1 ;geo3d: ; { ; FileSelectFolder, OutputVar [, *StartingFolder, 2, Select where you will store], Selectgeo, 32, , Select D3Directory, File (*.dll); *.lnk ; if (Selectgeo = "") ; MsgBox, The user didn't select anything. ; else ; { ; SplitPath, Selectgeo, Geoexe, Geopath, Geoextenstion, Geonameonly ; } ; } ;return ; ;generate: ;{ ; loglocal := "\Logfile.txt" ; Logfile := A_AppDataCommon loglocal ; } GuiEscape: GuiClose: ExitApp
-
How do i include libraries in compiled scripts?
i am using tf (https://github.com/hi5/TF). Its a text editing library.
What are some alternatives?
survey - A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
AHKs - My AHK library
cobra - A Commander for modern Go CLI interactions
prompter - golang utility for easy prompting
interactive-cli-prompts - Code for “Interactive CLI prompts in Go” blog post.
urfave/cli - A simple, fast, and fun package for building command line apps in Go
cli - GitHub’s official command line tool
promptui.
studybuddy - Build an interactive CLI application with Go, Cobra and promptui. Video tutorial available on the Div Rhino YouTube channel.
sshp - SSH login manager
tf - A CLI Tool to easily generate your Terraform configuration
manifold-cli - Manage your services and config from the command line