/ps-bash:ps-bash-hooksfrom ps-bash
Extend the ps-bash shell: prompt and on-cd hooks (direnv/fnm style), ~/.psbashrc, custom ls providers for synthetic paths, complete -W word lists and flag completers. ps-bash 鉤子與擴展。 Use when: running code on every prompt or directory change, making ls list a virtual path (myfs:, an API), adding tab completion to a command, writing a .psbashrc.
Ships in ps-bash. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
All of these work in module mode and in the interactive shell, from a .psm1, a profile or ~/.psbashrc.
Register-BashPromptHook -Name clock -ScriptBlock { $Host.UI.RawUI.WindowTitle = "ps-bash " + (Get-Date -f HH:mm) }
Register-BashChpwdHook -Name fnm -ScriptBlock { param($OldPath, $NewPath) fnm use --silent-if-unchanged }
Get-BashHook # what is registered
Unregister-BashChpwdHook -Name fnm # and Unregister-BashPromptHook
prompt rather than replacing it: an existing prompt (oh-my-posh,
Starship) is kept in $global:__BashOriginalPrompt and still runs.$PWD changed, in the global scope ($env:/$global:
changes persist), in name order. A throwing hook is caught and appended to $global:BashHookErrors;
it never ends the shell. Re-registering a name replaces it.PROMPT_COMMAND=… in .psbashrc becomes a prompt hook.Sourced when the interactive shell starts (PSBASH_HOME moves home; --rcfile FILE replaces it,
--norc skips it). alias, unalias and complete lines go to the shell's tables; everything else
is transpiled and run. Interactive source FILE takes the same path. Example:
examples/02-interactive-shell/psbashrc.example.
ls list anythingRegister-BashLsProvider -Name s3 -Detect { param($path) $path.StartsWith('s3:') } -List {
param($path, $flags)
foreach ($o in (Get-MyS3Objects $path)) {
[PSCustomObject]@{ PSTypeName = 'PsBash.LsEntry'; Name = $o.Key; FullPath = "s3:$($o.Key)"
IsDirectory = $false; IsSymlink = $false; SizeBytes = $o.Size; Permissions = '-rw-r--r--'
LinkCount = 1; Owner = ''; Group = ''; LastModified = $o.Modified; BashText = '' }
}
}
ls -la s3:bucket/logs
Providers are asked first, for any target that is not a real file or directory; PowerShell
providers (Registry:, Cert:, PSDrives) are the fallback. Emit PsBash.LsEntry objects so
ls's formatting, sorting and browse apply.
complete -W 'start stop status' svc (static word lists). complete -F func
registers but never runs the function, by design.Register-BashCompletions registers flag completers for every mapped command from
its flag specs; your own commands use PowerShell's Register-ArgumentCompleter.docs/specs/plugin-architecture.md,
config-format.md) but not built: do not look for PluginLoader or ICompletionProvider.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub standardbeagle/standardbeagle-tools --plugin ps-bash7 skills in this plugin
/ps-bash-browseBuild object workbenches on ps-bash's browse: adapters keyed by type name, display columns, actions with a destructive-preview gate, scripted -List/-Select/-Action/-Exec. ps-bash browse 物件工作台。 Use when: an interactive picker or TUI over objects from a .psm1, adding actions for a PSTypeName, scripting browse non-interactively from an agent./ps-bash-embedHost ps-bash in your own .NET app: PsBash.Core NuGet, BashTranspiler.Transpile, importing the embedded version-matched module, keeping objects for object cmdlets, IHostTerminal. ps-bash 嵌入 .NET 應用。 Use when: a GUI, daemon or agent tool runs bash in-process, transpiling bash to PowerShell, vim/less hang or say TERM not set in an embedding./ps-bash-objectsOther plugins' skills for the same job