PsBash.psd1
|
# # Module manifest for module 'PsBash' # # Generated by: Andy Brummer # # Generated on: 04/02/2026 # @{ # Script module or binary module file associated with this manifest. RootModule = 'PsBash.psm1' # Version number of this module. ModuleVersion = '0.10.11' # ID used to uniquely identify this module GUID = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' # Author of this module Author = 'Andy Brummer' # Company or vendor of this module CompanyName = 'Unknown' # Copyright statement for this module Copyright = '(c) Andy Brummer. All rights reserved.' # Description of the functionality provided by this module Description = 'Real bash commands for PowerShell with typed objects. 76 commands (ls, grep, sort, awk, sed, jq, find, ps, du, tar, etc.) that accept real bash flags and return structured PowerShell objects while producing identical text output. Pipeline bridge pattern preserves typed objects through grep, sort, head, tail.' # Supported PSEditions CompatiblePSEditions = 'Core' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '7.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @() # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module FormatsToProcess = 'PsBash.Format.ps1xml' # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @( 'Compare-Version', 'Complete-BashBgJob', 'ConvertFrom-AwkProgram', 'ConvertFrom-BashArgs', 'ConvertFrom-HumanNumeric', 'ConvertFrom-MonthName', 'ConvertFrom-SimpleYaml', 'ConvertFrom-YamlValue', 'ConvertTo-BrowseRow', 'ConvertTo-JqJson', 'ConvertTo-PermissionString', 'ConvertTo-SimpleYaml', 'Disable-BashHookPrompt', 'Emit-BashLine', 'Enable-BashHookPrompt', 'Expand-AwkString', 'Expand-EscapeSequences', 'Find-JqBranchKeyword', 'Find-JqKeyword', 'Find-JqTopLevelChar', 'Find-JqTopLevelStr', 'Format-AwkPrintf', 'Format-BashDate', 'Format-BashSize', 'Format-LsGrid', 'Format-LsLine', 'Format-PsAuxLine', 'Format-PsCustomLine', 'Get-BashBgRunspacePool', 'Get-BashFileInfo', 'Get-BashItem', 'Get-BashLsProviderEntries', 'Get-BashPlatform', 'Get-BashText', 'Get-BrowseDisplayProperties', 'Get-BrowseTargetText', 'Get-DotNetProcEntry', 'Get-JqMatchingBracket', 'Get-LinuxProcEntry', 'Get-LsDisplayName', 'Get-LsEntryFromFsi', 'Get-LsEntryFromPsItem', 'Initialize-BrowseAdapters', 'Invoke-AwkAction', 'Invoke-BashAwk', 'Invoke-BashBackground', 'Invoke-BashBg', 'Invoke-BashEcho', 'Invoke-BashFg', 'Invoke-BashJobs', 'Invoke-BashKill', 'Invoke-BashRedirect', # Wrapper: normalizes 'sed -e A -e B' to '-e @(A,B)' so the underlying # binary cmdlet's array Expression parameter accepts repeated -e. 'Invoke-BashSed', 'Invoke-BashWait', 'Invoke-BrowseAction', 'Invoke-BrowseCommand', 'Invoke-BrowseInteractive', 'Invoke-JqFilter', 'Invoke-JqIf', 'Invoke-JqRecurse', 'Invoke-JqSelect', 'Invoke-ProcessSub', 'Invoke-ProcessSubPipeline', 'Invoke-ProcessSubString', 'New-BashObject', 'New-BrowseAction', 'New-BrowseAdapter', 'New-BrowseBinding', 'New-BrowseSafetyPreview', 'New-FlagDefs', 'Open-BashFileReader', 'Read-AwkBlock', 'Read-BashFileBytes', 'Read-BashFileLines', 'Read-BashFileRaw', 'Read-BashFileStreaming', 'Register-BashCompletions', 'Register-BashLsProvider', 'Resolve-AwkExpression', 'Resolve-AwkStringFunc', 'Resolve-BashGlob', 'Resolve-BrowseAdapter', 'Resolve-JqDotPath', 'Resolve-JqStringInterpolation', 'Set-BashDisplayProperty', 'Set-BashErrorMode', 'Show-BashHelp', 'Split-AwkFields', 'Split-AwkFuncArgs', 'Split-AwkStatements', 'Split-JqComma', 'Split-JqPipe', 'Test-AwkPattern', 'Test-BashCondition', 'Test-BashHelpFlag', 'Test-BrowseCommandRequiresConfirmation', 'Write-BashError', 'Write-BashFileRaw', 'Write-BashFileText', 'Write-BashHostStderr' ) # Cmdlets to export from this module. The psm1 imports PsBash.Cmdlets.dll # via -Global; its exported cmdlets propagate to this module's session state # and need to be re-exported through this entry to be Get-Command-resolvable. # Wildcard form keeps the manifest in sync with the binary surface without a # per-cmdlet list duplicating PsBash.Cmdlets.psd1. CmdletsToExport = '*' # Variables to export from this module # VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = 'echo', 'printf', 'ls', 'cat', 'grep', 'sort', 'head', 'tail', 'wc', 'find', 'stat', 'cp', 'mv', 'rm', 'mkdir', 'rmdir', 'touch', 'ln', 'ps', 'sed', 'awk', 'cut', 'tr', 'uniq', 'rev', 'nl', 'diff', 'comm', 'column', 'join', 'paste', 'tee', 'xargs', 'jq', 'date', 'seq', 'expr', 'du', 'tree', 'env', 'printenv', 'basename', 'dirname', 'pwd', 'hostname', 'whoami', 'uname', 'fold', 'expand', 'unexpand', 'strings', 'split', 'tac', 'base64', 'md5sum', 'sha1sum', 'sha256sum', 'file', 'rg', 'gzip', 'gunzip', 'zcat', 'tar', 'yq', 'xan', 'sleep', 'time', 'which', 'unalias', 'readlink', 'mktemp', 'type', 'bash', 'wait', 'jobs', 'fg', 'bg', 'shift', 'realpath', 'command', 'source', 'unset', 'pushd', 'popd', 'dirs', 'yes', 'tput', 'shopt', # NB: the '[' alias (the bash `test` builtin) is intentionally NOT # listed here. A bare '[' is an invalid wildcard pattern that breaks # Test-ModuleManifest and Publish-Module ("wildcard character pattern # is not valid: ["). The psm1 registers '[' via a global AllScope # Set-Alias on import, so the command is still available to users. 'kill', 'test', 'let', 'id', 'shuf', 'balias', 'install', 'browse', 'more', 'less', 'trap', 'alias', 'mapfile', 'readarray', 'ping', 'tracert', 'traceroute' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ Tags = @('bash', 'linux', 'cross-platform', 'cli', 'grep', 'awk', 'sed', 'jq', 'pipeline', 'typed-objects', 'powershell-module', 'devops', 'unix', 'shell', 'commands', 'windows', 'macos', 'PSEdition_Core') LicenseUri = 'https://github.com/standardbeagle/ps-bash/blob/main/LICENSE' ProjectUri = 'https://github.com/standardbeagle/ps-bash' # ReleaseNotes of this module ReleaseNotes = 'v0.10.11: jq operators and the v0.10.10 publish fix. jq gains the non-arithmetic operator set — sort, unique, reverse, min, max, first, last, flatten, sort_by(e), unique_by(e), group_by(e), to_entries, from_entries, has(k), @csv/@tsv/@base64/@base64d/@json, and string builtins join/split/startswith/endswith/ltrimstr/rtrimstr — plus binary arithmetic (+ - * / %) with jq type overloads and boolean and/or. v0.10.10 binaries failed to publish because a Pester test still asserted printf %s "first arg only"; printf now correctly recycles its format over multiple args (bash semantics), and the test was corrected. v0.10.10: Command flag-coverage sweep (prioritized by utility and complexity). Correctness fixes for wrong/destructive behavior: kill -0 was killing the process (now an existence probe); cut open ranges (-f2-) threw; env NAME=VAL cmd (run-a-command-with-modified-environment) was unimplemented; cp -p leaked as a filename operand; paste -d emitted a literal backslash-n; md5sum -b was treated as a filename; realpath -e was a no-op. New flag support across ~25 commands: cut -s/--output-delimiter; cp -a/-u; wc -m/-L; stat --format; touch -r; du --max-depth; tree --noreport/-f; sort -o; nl -w/-s/-v/-i/-n/-b; uniq -D; grep -f/--exclude-from; find -type l/-print; date format codes (%I %R %D %z %u ...) and -d @EPOCH; printf format recycling and %i/%u/%e/%g; ls --group-directories-first; rg -S/-s/-x (smart-case/line-regexp); jq add/tostring/tonumber/ascii_downcase/ascii_upcase; tar --strip-components/-O; gzip -t; md5sum/sha* -c (verify); join -a/-v/-j/-i; split -b/--additional-suffix; xargs -d. Each comes with regression tests. Still pending: jq operators (group_by, @csv, arithmetic) and awk control flow (if/for/while) are engine-level projects. v0.10.9: Interactive shell features and runtime bug fixes. (1) cd - returns to the previous directory ($OLDPWD) and echoes it like bash; every successful cd now records $OLDPWD, and cd - with no prior directory reports "cd: OLDPWD not set" instead of failing on an empty path. (2) Bash history expansion in the interactive shell: !! (previous command), !n / !-n (by session index), !str / !?str? (prefix / substring search), the !$ / !^ / !* word designators and :n suffixes, and ^old^new quick substitution; expansion is suppressed inside single quotes and after a backslash, leaving the ! negation operator untouched. (3) ln -sf no longer destroys a populated directory tree: when the link name is a real directory the link is created inside it (basename of the target) and -f only removes a file or symlink, matching GNU ln (the old code ran a recursive delete). (4) awk file-operand mode: awk ''{...}'' file.txt now reads the named file(s) instead of silently dropping the operand and reading nothing. (5) kill fixes: named-signal short forms (kill -KILL / -TERM / -SIGTERM pid) are honored, and the pid loop no longer collides with the read-only $PID automatic variable, which silently broke every kill. (6) Stale-host fix: the daemon build identity now folds the host binary file stamp, so a recompiled host (same version, new code) replaces a running daemon instead of being silently reused. (7) Docs: new Interactive Shell guide and a Windows coreutils (uutils) comparison. v0.10.8: Robustness and interactive performance. (1) Interactive typing latency: keystrokes echo before the history/flag prediction runs, and prediction is fully async/debounced so a busy or IO-bound system never stalls input (set PSBASH_NO_PREDICT to disable it); the prompt is now drawn before the runspace finishes starting (startup type-ahead). (2) Hash-based transpile cache: startup .sh scripts transpile once and are cached on disk by content hash, with an in-memory LRU for repeated longer commands. (3) Bash-tool dogfood fixes: if/while/until conditions now test the command EXIT CODE rather than its output, so "if grep -q ..." and "if ! cmd" branch correctly; [ ... ] / test are silent (no stray True/False on stdout); every command resets the exit code on success (a trailing pwd no longer reports a stale 127); piping into "while read" now feeds the loop body; /dev/null as a file operand is an empty file instead of a crash; "cp -rf" bundled short flags are honored; and rm -rf / cp / mv / find -delete clear the read-only attribute so they no longer fail partway on Windows .git and node_modules trees. (4) grep gained --include / --exclude / --exclude-dir, -L/--files-without-match, -x/--line-regexp, -s/--no-messages, and -P/--perl-regexp. (5) "<cmd> --version" now identifies ps-bash across all commands. (6) Internals: emitted PowerShell is built through one shared builder and destructive filesystem operations through shared OS helpers, eliminating a class of one-off seam bugs (e.g. a negated-condition that took the wrong branch). v0.10.7: Fix path and pipeline gaps that broke the Claude Code Bash tool on Windows. (1) Piping a compound command — a for/while/until loop, if, case, subshell, or brace group — into another command (e.g. "for f in a b; do echo $f; done | sort") emitted a bare PowerShell statement before the pipe, which PowerShell rejects with "An empty pipe element is not allowed". Such pipeline stages are now wrapped in & { ... } at any position. (2) Windows path mapping is centralized in one shared WindowsPath utility used by BOTH the transpiler and the runtime cmdlets, handling /c/.. (MSYS/git-bash), /mnt/c/.. (WSL), and c:/.. (native, any separator/case) variants. Unix-style drive paths in command operands and cd targets — previously only redirect targets — are now translated (cat /c/Users/x and cd /mnt/c/work no longer resolve against the current drive as C:\c\..). When PSBASH_UNIX_PATHS is set (the Claude Code / wrapper case) the transpiler rewrites them ahead of time; the runtime also normalizes them on Windows as a safety net for direct, non-wrapper use. v0.10.4: Fix two bash-tokenization gaps. (1) A # in the middle of a word was wrongly treated as a comment, so abc#def and URLs like http://x/p#section lost everything from the #. (2) Bracket/quote scanning was not quote-aware, so a ) inside a string closed a $(...) early and a $(...) inside double quotes terminated at the wrong quote — e.g. echo $(grep ")" f) and echo "$(echo "hi")" mangled. The lexer now uses one set of mutually-recursive, quote-aware region scanners, and the parser reuses them instead of its own duplicate copies. v0.10.3: Fix heredoc body corruption. A here-document body was rebuilt by space-joining lexer tokens, so punctuation was mangled (best-ranked (score-desc, newest-first) became best-ranked ( score-desc, newest-first )), runs of whitespace collapsed, and lines beginning with # were dropped as comments. This broke piping multi-line text (e.g. git commit messages) through ps-bash. Heredoc bodies are now sliced verbatim from the original source. v0.10.2: Interactive Ctrl-R history search now collapses duplicate command strings. History stores one row per invocation, so re-running the same command filled the reverse-i-search list with repeats; the search now shows one row per unique command, keeping the best-ranked (most recent / CWD-matching) occurrence. v0.10.1: Fix Claude Code Bash-tool integration. A multi-variable bare assignment in a && / || chain (e.g. the TEMP/TMP env-setup Claude Code prepends to every command) emitted [void]($env:A = ..; $env:B = ..), which PowerShell rejects ("Missing closing )") — so every Bash-tool command failed with "ps-bash: parse error". The emitter now uses [void]$(...) for multi-statement assignments. Regression coverage: BashTranspilerTests, ShellArgsTests, an end-to-end launcher test, and a PowerShell parse-oracle over the wrapper shapes. v0.10.0: Interactive shell features. AI command assist (Ctrl-^) turns a natural-language prompt into a reviewed shell command via an external AI CLI, with a dangerous-command safety classifier (now also flags Invoke-Expression / iex). New opt-in compact-output mode (--compact-output / PSBASH_COMPACT_OUTPUT) replaces raw output with a bounded digest for agent contexts. Completion parameter-value rows now split on the ASCII unit separator so ValidateSet values containing a pipe are no longer truncated. v0.9.13: Fix broken module install. Install-Module PsBash now bundles PsBash.Cmdlets.dll (and its PsBash.Transpiler.dll / Parlot.dll deps) so a plain Install-Module PsBash is self-contained. Previously the registered aliases (ls, cat, grep, ...) resolved to binary cmdlets that were never loaded ("Invoke-BashLs is not recognized"); the module now warns instead of failing silently if the binary companion is absent. v0.9.12: Interactive shell fixes. Auto-loadable PowerShell aliases (tnc, gip) now resolve in the host runspace, and the interactive line editor no longer redraws erratically after launching a node-based GUI CLI such as code. Full version history: https://github.com/standardbeagle/ps-bash/releases' } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } |