feat: add fish shell and PowerShell Core plugins#2563
Open
arvindcr4 wants to merge 3 commits intoantinomyhq:mainfrom
Open
feat: add fish shell and PowerShell Core plugins#2563arvindcr4 wants to merge 3 commits intoantinomyhq:mainfrom
arvindcr4 wants to merge 3 commits intoantinomyhq:mainfrom
Conversation
Port the ForgeCode ZSH plugin to fish shell, providing the same `:` command interface for interacting with Forge from fish. Includes: - forge.fish: main plugin with 47 functions covering all commands (new, agent, model, provider, conversation, commit, suggest, etc.) - fish_right_prompt.fish: right prompt showing active model/agent - README.md: installation and usage documentation Uses fish-native idioms (commandline, bind, set, string match) instead of ZLE widgets. Auto-loads via conf.d/. Co-Authored-By: claude-flow <ruv@ruv.net>
- Use `string collect` to preserve blank lines in editor content, commit messages, and suggest output (prevents list-splitting) - Unquote $filtered in provider selection so all matching providers are written back, not just the first - Escape workspace_path and _FORGE_BIN in background fish -c strings to handle paths with special characters - Use `string collect` on rprompt output to prevent list-splitting - Use idiomatic fish [2] indexing instead of tail -1 for regex groups - Use $fish_key_bindings check for vi-mode instead of fragile bind test - Use `string escape --style=script` for commit message shell safety - Add comments explaining zsh subcommand usage from fish plugin Co-Authored-By: claude-flow <ruv@ruv.net>
Comment on lines
+93
to
+96
| if not test -s "$_FORGE_COMMANDS_CACHE" | ||
| CLICOLOR_FORCE=0 command $_FORGE_BIN list commands --porcelain 2>/dev/null >"$_FORGE_COMMANDS_CACHE" | ||
| end | ||
| command cat "$_FORGE_COMMANDS_CACHE" |
Contributor
There was a problem hiding this comment.
Race condition in commands cache initialization. Multiple fish sessions for the same user could simultaneously detect the cache file as missing/empty and attempt to write to it concurrently, potentially corrupting the cache file.
function _forge_get_commands --description "Lazy-load command list from forge (outputs to stdout)"
if not test -s "$_FORGE_COMMANDS_CACHE"
set -l tmpfile (mktemp "$_FORGE_COMMANDS_CACHE.XXXXXX")
CLICOLOR_FORCE=0 command $_FORGE_BIN list commands --porcelain 2>/dev/null >"$tmpfile"
command mv -f "$tmpfile" "$_FORGE_COMMANDS_CACHE" 2>/dev/null
end
command cat "$_FORGE_COMMANDS_CACHE"
endUse atomic write via temporary file + move to prevent corruption when multiple sessions initialize simultaneously.
Suggested change
| if not test -s "$_FORGE_COMMANDS_CACHE" | |
| CLICOLOR_FORCE=0 command $_FORGE_BIN list commands --porcelain 2>/dev/null >"$_FORGE_COMMANDS_CACHE" | |
| end | |
| command cat "$_FORGE_COMMANDS_CACHE" | |
| if not test -s "$_FORGE_COMMANDS_CACHE" | |
| set -l tmpfile (mktemp "$_FORGE_COMMANDS_CACHE.XXXXXX") | |
| CLICOLOR_FORCE=0 command $_FORGE_BIN list commands --porcelain 2>/dev/null >"$tmpfile" | |
| command mv -f "$tmpfile" "$_FORGE_COMMANDS_CACHE" 2>/dev/null | |
| end | |
| command cat "$_FORGE_COMMANDS_CACHE" | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
Port the ForgeCode shell plugin to PowerShell Core (pwsh 7+), providing the same `:` command interface on Windows, macOS, and Linux. Includes: - ForgeCode.psm1: 1547 lines, all 30+ commands with aliases, fzf pickers, PSReadLine Enter/Tab handlers, right prompt, background sync/update via Start-Job - ForgeCode.psd1: module manifest (PowerShell 7.0+) - README.md: installation, usage, command reference, troubleshooting Uses PSReadLine RevertLine+Insert+AcceptLine pattern for Enter key interception. Cross-platform clipboard via Set-Clipboard with fallbacks. Script-scoped state variables for conversation/agent tracking. Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the ForgeCode ZSH shell plugin to fish shell and PowerShell Core (pwsh 7+), providing the same
:command interface across all major shells.Fish Shell Plugin
:commandsand@filereferencesbind+commandlinebuiltins,string collectfor safe multi-line handlingconf.d/PowerShell Core Plugin
Start-JobSet-Clipboardwith fallbacksFiles
shell-plugin/fish/forge.fishshell-plugin/fish/fish_right_prompt.fishshell-plugin/fish/README.mdshell-plugin/powershell/ForgeCode.psm1shell-plugin/powershell/ForgeCode.psd1shell-plugin/powershell/README.mdInstallation
Fish
PowerShell
Notes
Test plan
🤖 Generated with claude-flow