An async jujutsu (jj) prompt plugin for Fish shell.
- ⚡ Fully async - Non-blocking prompt that stays responsive
- 🎨 Rich info display - Shows change ID, bookmarks, descriptions, and status flags
- 🔄 Smart detection - Automatically detects jj repos
- 🚀 Zero impact - Background processing keeps your shell zippy
- 🎯 Universal compatibility - Works with any Fish prompt
Install with Fisher:
fisher install dacuna/fish-jj-prompt-pluginThe plugin provides two main functions for integration with any Fish prompt:
Returns the formatted jj prompt string with all information:
function fish_prompt
set --local jj_prompt (fish_jj_prompt 2>/dev/null)
if test -n "$jj_prompt"
echo -n $jj_prompt
end
endReturns 0 (success) if in a jj repository, 1 otherwise. Use this to conditionally show jj vs git prompts:
function fish_prompt
if jj_prompt_is_repo
echo -n (fish_jj_prompt)
else
echo -n (fish_git_prompt)
end
endIf you're using Hydro prompt, modify your fish_prompt function to conditionally show jj or git info:
function fish_prompt --description Hydro
# Use jj prompt in jj repos, otherwise use Hydro's git prompt
set --local vcs_info ""
if jj_prompt_is_repo
set vcs_info (fish_jj_prompt)
else
set vcs_info $_hydro_color_git$_hydro_git$hydro_color_normal
end
echo -e "$_hydro_color_start$hydro_symbol_start$hydro_color_normal$_hydro_color_pwd$_hydro_pwd$hydro_color_normal $vcs_info $_hydro_color_duration$_hydro_cmd_duration$hydro_color_normal$_hydro_status$hydro_color_normal "
endIn jj repositories, the prompt displays:
- Change ID in bold magenta (e.g.,
[k]) - Bookmarks with sync status (* indicates unsynced)
- Description if no bookmarks exist
- Status flags like conflict, empty, divergent, hidden
- Visual history showing commits from trunk fork point to current
Example prompt in a jj repo:
The plugin uses Fish's event system to:
- Check if you're in a jj repo on directory changes (
PWD) - Spawn background processes to fetch jj info asynchronously
- Update the prompt without blocking when data is ready
- Fish shell 3.0+
- jujutsu (jj) CLI tool
MIT