Skip to content

feat(shell): add fish shell plugin#2779

Open
tivris wants to merge 13 commits intotailcallhq:mainfrom
tivris:fish-shell-plugin
Open

feat(shell): add fish shell plugin#2779
tivris wants to merge 13 commits intotailcallhq:mainfrom
tivris:fish-shell-plugin

Conversation

@tivris
Copy link
Copy Markdown
Contributor

@tivris tivris commented Apr 1, 2026

Full port of the zsh shell plugin to fish, giving fish users the same :command experience.

What's included

Fish scripts (fish-plugin/, 57 files):

  • Dispatcher bound to Enter key — parses :command [args] and routes to action handlers
  • Tab completion for :commands (via fzf) and @[file] references (via fd/bat)
  • Right prompt showing agent, model, token count, and cost
  • All action handlers: conversation management, agent/model/provider selection, git integration, editor, workspace sync, etc.
  • Doctor diagnostics and keyboard shortcut reference adapted for fish
  • Setup template for config.fish injection

Rust integration (crates/forge_main/src/fish/, 4 files):

  • FishCommandGroup with plugin, theme, doctor, rprompt, setup, keyboard subcommands
  • FishRPrompt using ANSI escapes instead of zsh's %F{} prompt escapes
  • Plugin generation via include_dir! embedding + clap_complete::shells::Fish
  • Setup targeting ~/.config/fish/config.fish with XDG_CONFIG_HOME support

Usage

# one-time setup
forge fish setup

# or manually
forge fish plugin | source
forge fish theme | source

# then just use it
: hello world
:conversation
:new
:commit

Testing

  • All 57 .fish files pass fish -n syntax validation (tested on fish 4.6.0)
  • 27 Rust tests covering rprompt output, style escapes, CLI parsing, setup/marker logic, plugin/theme generation
  • Functional test: plugin loads in fish, all 54 _forge_* functions register, logging/doctor work end-to-end

Closes #2765

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 1, 2026
Comment thread crates/forge_main/src/fish/plugin.rs
@tusharmath
Copy link
Copy Markdown
Collaborator

@tivris have you tried this PR? Does it work? Too big of a PR to review 🙈.

tivris and others added 4 commits April 2, 2026 11:36
Port the existing zsh shell plugin to fish shell, covering all
commands, tab completion, right prompt, fzf pickers, session state
management, and background sync.

Fish-side (fish-plugin/):
- conf.d/forge.fish: init, variables, key bindings (Enter/Tab)
- 54 function files: dispatcher, actions, helpers, completion
- Theme with fish_right_prompt integration
- Doctor diagnostics and keyboard shortcut reference
- Setup template for config.fish injection

Rust-side (crates/forge_main/src/fish/):
- FishCommandGroup with plugin/theme/doctor/rprompt/setup/keyboard
- FishRPrompt using ANSI escapes (vs zsh's %F{} prompt escapes)
- Plugin generation embedding fish-plugin/ via include_dir
- Setup targeting ~/.config/fish/config.fish with XDG support
- clap_complete::shells::Fish for CLI completions

Tested with fish 4.6.0, all 57 scripts pass fish -n syntax
validation, 27 Rust tests pass.

Closes tailcallhq#2765
Add missing else branches to remove HOME and XDG_CONFIG_HOME
when they weren't set before the test, preventing test pollution.
fish's command substitution () splits output on newlines, so
eval (forge fish plugin) collapses the entire script into a single
line, breaking if/end block parsing. Pipe to source instead.
@tivris tivris force-pushed the fish-shell-plugin branch from 7e5f506 to 0091180 Compare April 2, 2026 08:49
@tivris
Copy link
Copy Markdown
Contributor Author

tivris commented Apr 2, 2026

@tivris have you tried this PR? Does it work? Too big of a PR to review 🙈.

Tested it locally with fish 4.6.0 on macOS (Ghostty). Setup, plugin loading, theme, completions, key bindings, and : commands all work, ran forge fish setup, reloaded the shell, and confirmed with : Hi. It's a bit fishy

Comment thread crates/forge_main/src/fish/plugin.rs
test_run_fish_doctor_streaming mutates FORGE_SKIP_INTERACTIVE without
holding the shared mutex, unlike every other env-mutating test in the
file. Acquire ENV_LOCK to prevent concurrent test interference.
@tusharmath
Copy link
Copy Markdown
Collaborator

Related to #2839

A thought:

  • Expose fish unofficially via a user plugin
  • Setup discord specifically for ZSH, FISH and Powershell for people to collaborate and provide feedback until is stable enough to become a member of the forgecode ecosystem officially.

This way we don't need to bloat our repos/releases and we can support them independently.

@guptakanishka90
Copy link
Copy Markdown

Desperately waiting for this feature.

@iosif2
Copy link
Copy Markdown

iosif2 commented Apr 7, 2026

Related to #2839

A thought:

  • Expose fish unofficially via a user plugin
  • Setup discord specifically for ZSH, FISH and Powershell for people to collaborate and provide feedback until is stable enough to become a member of the forgecode ecosystem officially.

This way we don't need to bloat our repos/releases and we can support them independently.

I’ve been experimenting with a possible unofficial fish shell integration on my side.

It tries to mirror the general approach of the existing zsh integration, but it’s still very early and likely incomplete.

Sharing in case it helps inform how external shell integrations might be structured:
https://github.com/iosif2/forge.fish

@github-actions
Copy link
Copy Markdown

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support for fish shell

5 participants