A filename-based Windows executable that emulates the specified command in a terminal, similar to bash
aliases.
This allows you to create command aliases or command macros on windows, or execute shell scripts (.bat
/.ps1
) using an executable (.exe
).
- Same return code as executing the command manually
- Forwards commandline arguments
- Filename-based configuration allows you to have any number of aliases in the same directory
- Live-updating output
- Download the latest release.
- Rename the executable to whatever you want.
- Run the executable once, which will create the default configuration file in the same directory as the executable.
- Edit the generated
.ini
file & set the command to execute.
Say you wanted to create an alias lsf
for the PowerShell command Get-ChildItem -Force
.
- Download (or copy-paste)
alias.exe
& move it to a directory on your PATH. - Rename
alias.exe
tolsf.exe
, then run it once to generate the config file. - Edit
lsf.ini
:Now you can run the[target] command = "PowerShell -Command 'Get-ChildItem -Force'" forward_args = true
lsf
command to executeGet-ChildItem -Force
When the program is called, it finds its current location and searches that directory for an ini
file with the same name.
It then uses the popen function to open a process pipe that it uses to emulate that process.
The executed command's return code is forwarded by the program when it exits as well.
Note: popen uses cmd.exe
by default; to execute PowerShell commands you must prepend powershell -Command
to the command string in the config.