Repository navigation
Releases
Releases · mnaoumov/headless-run
v2.0.0
Breaking changes
--windows-powershellis gone: use--engine powershell.- A
.jsfile now runs undernode; before, it went toCreateProcessWand failed. The same holds for.mjs,.cjs,.ts,.mts,.cts,.py,.pyw,.pl,.rb,.php,.lua,.r,.tcl,.sh,.vbsand.wsf, each under its own engine.
New
- Engines: the extension of the program picks the interpreter from one table of engines:
cmd,pwsh,powershell,node,deno,bun,python,perl,ruby,php,lua,rscript,tclsh,bashandcscript.--engine NAMEpicks one explicitly; an engine that does not accept the program's extension is refused unless--force-engineis passed. A missing interpreter fails with 125 and says how to point the engine at it. - Node runs TypeScript (
.ts,.mts,.cts) directly; a Node older than 22.18.0, or 23.0 to 23.5, fails with 125 naming the version. - Config files register new engines or change built-in ones:
%ProgramData%\headless-run\config.jsonfor every account,%APPDATA%\headless-run\config.jsonfor yours, and--config FILEfor one run. A JSON schema validates them in an editor. headless-run configreads and writes those files aftergit config:--list [--show-origin],--edit, get, set,--add,--unset, with--global,--systemand--filescopes..exeand.comprograms are documented and tested. A file that is no Windows program and that no engine runs fails with a diagnostic naming the setting that would run it.--elevateruns the child as an administrator. From an unelevated caller, Windows shows its UAC prompt and an elevated copy of the launcher runs the child, relaying standard input, output and error, the environment, the working directory and the exit code back, so the call behaves as it would without the option; killing the caller still ends the whole tree. Already elevated, the option does nothing, so a script can pass it unconditionally. A declined prompt, or a session that cannot show one (a service, a standard user's S4U task, session 0), fails with 125 and runs nothing.- The documentation's PowerShell section notes that assigning the launcher's output to a variable neither waits nor captures it, and that
| Write-Outputdoes both. --trayshows a notification-area icon while the job runs. Its menu shows the command line, start time and process id, shows or hides a window with the job's output, opens the--stdoutand--stderrfiles, and stops the job, which then returns 130. When the job ends, a notification shows the exit code. It works with--timeoutand--elevate;--detachrefuses it. The default is--tray=auto: the icon is shown for a run started on a desktop, and not under Task Scheduler, a service, session 0 or--detach, so scheduled tasks stay invisible with no flag;--tray=trueand--tray=falseforce it either way. Only an explicit--traykeeps the icon for 5 seconds after the job with its exit code.--event-logwrites one event per run to the Windows Application log, under the sourceheadless-run: the outcome (exit code, timeout, tray stop, launcher failure with its diagnostic, or detached start) with its own event id, the command line, working directory and duration. A failed scheduled run is then visible in Event Viewer with no log file. Writing it never fails the job.--echostarts nothing and shows what the launcher received: its command line split into arguments, the child tail, the engine and interpreter, and the exact child command line with the arguments a program would receive. The text goes to--stdout FILE, a redirected stdout or the calling console, and to a window when there is no console, as from a shortcut or the Run dialog, so any caller's quoting can be checked where it runs. In that window the received command line can be edited, and its arguments are split again as you type, so a variant of the line can be tried where it actually runs.- The documentation moved from the README to a site, mnaoumov.dev/headless-run, with one page per topic. The README keeps the usage, install and a link to each page.
- The documentation shows how to call the launcher from a
cmdprompt, a batch file, PowerShell 7, Windows PowerShell 5.1, Git Bash, WSL, Task Scheduler, Node, Python and .NET, with each shell's quoting, waiting and--handling, and a list of pitfalls. Every example is run as written byscripts/test-shell-examples.ps1, which the test script includes. - A quoting playground on the documentation site: type the arguments a program should receive and get the line to write in
cmd, a batch file, PowerShell 7, Windows PowerShell 5.1, Git Bash, WSL, a shortcut, Task Scheduler, the Run dialog, a raw command line, Node, Python or C#, or type a line and see the arguments it becomes. Each caller's model is checked against the real caller byscripts/test-quoting-models.ps1, which the test script includes. --max-size SIZEcaps the--stdoutand--stderrfiles of an--appendrun: before the child starts, a file larger thanSIZE(such as10M) moves toFILE.1, replacing the older backup, so a job that runs every few minutes for months keeps its logs bounded and still has the run that crossed the cap. Theoutput.maxSizeconfig key sets a default for every run, and--max-size noneturns it off for one. The idea isSilentCMD's/LOGSIZE, which truncates instead.--stdoutand--stderrpaths can hold<date>,<time>,<program>and<pid>, filled in when the launcher starts, so a scheduled job writes one file per run, such as--stdout "C:\Logs\<program>.<date>.<time>.log", with no wrapper script. Task Scheduler expands nothing in its arguments, so this was not possible before.<and>cannot appear in a Windows file name, so a placeholder never collides with a real path; an unknown one fails with 125. The idea ishide-win32-console-window's per-run log name.- The executable's file properties name the publisher (
mnaoumov) and the copyright, instead of repeatingheadless-runas the company.
Full Changelog: v1.0.0...v2.0.0
v1.0.0
Breaking changes
--below-normalis gone: use--priority below-normal.- A
.cmd,.bator.ps1program now runs under its interpreter, with that interpreter's argument rules. A native executable still gets its raw command line unchanged. - A missing
--cwddirectory is now a launcher failure unless--create-cwdis passed.
New
--priority idle|below-normal|normal|above-normal|high|realtimechooses the child's priority class. Omitted, Windows' default applies..cmdand.batrun ascmd.exe /d /s /c "<command line>";.ps1runs aspwsh -NoProfile -NonInteractive -File <command line>, failing clearly whenpwshis missing.--windows-powershellruns a.ps1under Windows PowerShell 5.1 instead.--create-cwdcreates a missing working directory.- Missing parent directories of
--stdoutand--stderrfiles are created. - Every option that takes a value also accepts
--name=VALUE. - A native x86 executable ships beside the x64 and ARM64 ones.
Full Changelog: v0.1.0...v1.0.0
v0.1.0
First release.
- Launch a Windows console program without a console window, forwarding its raw command line unchanged and returning its full 32-bit exit code.
- Redirect standard output and standard error to files with
--stdout,--stderr,--appendand--overwrite. - Set the child's working directory, environment variables and priority with
--cwd,--envand--below-normal. - Stop the child and its descendants after
--timeout, returning 124. - Contain the child and its descendants in a kill-on-close job, or leave it running with
--detach. - Native, self-contained x64 and ARM64 executables with SHA-256 checksums.
Full Changelog: https://github.com/mnaoumov/headless-run/commits/v0.1.0