Compare commits

...

9 Commits

Author SHA1 Message Date
rootiest 0e766b3326 Merge pull request 'feat(deps): add fish-deps unified dependency management command' (#17) from feat/fish-deps into main
Reviewed-on: #17
2026-05-19 03:53:51 +00:00
rootiest a7510cc8ea fix(fish-deps): filter fish-* tags only; fix starship sh -s flag
git tag --list 'fish-*' replaces for-each-ref so old pre-Rust tags like
pre_whitespace_fix (which have no Cargo.toml) are never selected.

starship update: sh -s -- --yes correctly passes --yes to the piped
install script instead of treating it as a filename for sh to open.
2026-05-18 23:46:34 -04:00
rootiest a351e62a17 feat(fish-deps): add uv as managed dep; install before cargo and fish
uv is now listed first in the catalog (before cargo and fish) so it is
installed automatically before the fish source build is attempted.
Install uses the official curl script; update uses `uv self update`.

Catalog order is now: uv → cargo → fish → … ensuring prerequisites are
in place before any dependent install method runs.

README updated: uv and cargo added to the Required table, warning callout
and dependency management note reflect the automatic install flow.
2026-05-18 23:34:49 -04:00
rootiest 7936a0966e feat(fish-deps): build fish from source via git + cargo when upgrading
Adds a git-cargo-fish install method that clones fish-shell, checks out
the latest tag, and runs `uv run --no-managed-python cargo install --path .`.
This is offered first in `fish-deps install` (requires cargo + uv) and
used automatically by `fish-deps update`, falling back to the system PM
when cargo or uv are absent.

Removes the stale `cargo install fish` README note (that crate is a
library, not the shell binary).
2026-05-18 23:29:55 -04:00
rootiest fee2d99bea feat(fish-deps): warn on fish < 4.0 in status; prompt upgrade in install
fish-deps status now shows ⚠ with the current version when fish < 4.0.
fish-deps install prompts to upgrade fish when the installed version is
below 4.0, using the same install methods (cargo/PM) and printing a
restart reminder on success.
2026-05-18 23:17:51 -04:00
rootiest 7d4e33bc7e feat(deps): add curl installer for lazydocker and binary download for wakatime
lazydocker: prefer the official install_update_linux.sh curl script over
system PM. The same script handles updates, so fish-deps update re-runs it.

wakatime: replace pipx with a direct binary download from github releases.
Detects architecture (amd64/arm64/arm) via uname -m, downloads the zip,
extracts the binary to ~/.config/wakatime/wakatime, chmods it, and
symlinks it to ~/.local/bin/wakatime. fish-deps update re-downloads and
replaces the binary in place.

Both new specials are added to the preferred-method block so they appear
before the system PM and are the default when prompted.
2026-05-18 23:04:35 -04:00
rootiest 782ef833c2 fix(deps): correct trash cargo crate name to trashy 2026-05-18 22:48:33 -04:00
rootiest 8917442089 fix(deps): update PATH immediately after rustup install
After the rustup installer runs, add the cargo bin dir to PATH in the
current session so subsequent installs in the same fish-deps run can
find cargo without a shell restart. Checks CARGO_HOME/bin first (set
in config.fish), then falls back to the rustup default ~/.cargo/bin.
Warns the user if cargo still isn't detectable after the path update.
2026-05-18 22:40:35 -04:00
rootiest 8d9e7ae43f fix(deps): validate method choice is numeric before comparing 2026-05-18 22:29:50 -04:00
5 changed files with 233 additions and 34 deletions
+7 -6
View File
@@ -254,7 +254,10 @@ rm -f file.txt # Falls through to standard rm -f
| `fzf-update` | Install or upgrade fzf from git HEAD into `~/.fzf` (guarantees the latest build) | | `fzf-update` | Install or upgrade fzf from git HEAD into `~/.fzf` (guarantees the latest build) |
| `check_fish_deps` | Legacy alias — delegates to `fish-deps status` | | `check_fish_deps` | Legacy alias — delegates to `fish-deps status` |
Install method priority: **cargo** (for Rust tools, gets latest crate) → **system PM** (paru/apt/brew/etc.) → **git clone** (fzf) → **curl installer** (starship, fisher) → **pipx** (Python tools). When multiple methods are available for a tool, you are prompted to choose. Install method priority: **git+cargo source build** (fish) → **cargo** (other Rust tools, gets latest crate) → **system PM** (paru/apt/brew/etc.) → **git clone** (fzf) → **curl installer** (starship, fisher) → **pipx** (Python tools). When multiple methods are available for a tool, you are prompted to choose.
> [!NOTE]
> Upgrading Fish from source requires **cargo** and **[uv](https://docs.astral.sh/uv/)**. Both are managed dependencies — `fish-deps install` will offer to install them before attempting the Fish build. If both are unavailable, `fish-deps update` falls back to the system package manager.
### Docker ### Docker
@@ -493,6 +496,8 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
| Tool | Version | Purpose | | Tool | Version | Purpose |
|---|---|---| |---|---|---|
| [uv](https://docs.astral.sh/uv/) | any | Python runner (needed to build Fish from source) |
| [Rust / cargo](https://www.rust-lang.org/tools/install) | any | Installs Rust-based tools; required to build Fish |
| [Fish](https://fishshell.com/) | **≥ 4.0** | Shell | | [Fish](https://fishshell.com/) | **≥ 4.0** | Shell |
| [Fisher](https://github.com/jorgebucaran/fisher) | any | Plugin manager | | [Fisher](https://github.com/jorgebucaran/fisher) | any | Plugin manager |
| [Starship](https://starship.rs/) | any | Prompt | | [Starship](https://starship.rs/) | any | Prompt |
@@ -502,11 +507,7 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
> [!WARNING] > [!WARNING]
> Fish **4.0 or newer is required.** This config uses `test` syntax and other constructs that are incompatible with Fish 3.x. Older versions will produce errors on startup. > Fish **4.0 or newer is required.** This config uses `test` syntax and other constructs that are incompatible with Fish 3.x. Older versions will produce errors on startup.
> If you are on an older Fish, you can upgrade via cargo (Fish 4.x is a Rust rewrite published to crates.io): > Run `fish-deps install` or `fish-deps update` to upgrade — it will install `uv` and `cargo` automatically if missing, then build the latest Fish from source.
> ```
> cargo install fish
> ```
> Or run `fish-deps update` once cargo is available — it will upgrade Fish via cargo automatically.
### Recommended ### Recommended
+11 -10
View File
@@ -10,34 +10,35 @@
# _fdc_cargo — cargo crate name, or "" if not on crates.io # _fdc_cargo — cargo crate name, or "" if not on crates.io
# _fdc_pm — system PM package name, or "" if not in repos # _fdc_pm — system PM package name, or "" if not in repos
# _fdc_special — special install key: rustup-installer | fisher-bootstrap | # _fdc_special — special install key: rustup-installer | fisher-bootstrap |
# fzf-update | paru-build | pipx | curl-installer | "" (none) # fzf-update | paru-build | pipx | curl-installer |
# git-cargo-fish | curl-uv | "" (none)
# #
# cargo is listed second so it is installed before Rust tools that depend on it. # uv and cargo are listed first so both are available before fish and other Rust tools.
function _fish_deps_catalog function _fish_deps_catalog
set -g _fdc_bins \ set -g _fdc_bins \
fish cargo fisher starship fzf zoxide direnv paru \ uv cargo fish fisher starship fzf zoxide direnv paru \
wakatime tailscale \ wakatime tailscale \
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
set -g _fdc_tiers \ set -g _fdc_tiers \
req req req req req req req rec \ req req req req req req req req rec \
int int \ int int \
rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec rec
set -g _fdc_cargo \ set -g _fdc_cargo \
fish "" "" starship "" zoxide "" "" \ "" "" "" "" starship "" zoxide "" "" \
"" "" \ "" "" \
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trash-cli "" "" eza lsd bat "" du-dust "" "" "" ripgrep "" "" trashy "" ""
set -g _fdc_pm \ set -g _fdc_pm \
fish cargo "" starship fzf zoxide direnv "" \ uv cargo fish "" starship fzf zoxide direnv "" \
wakatime tailscale \ wakatime tailscale \
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
set -g _fdc_special \ set -g _fdc_special \
"" rustup-installer fisher-bootstrap curl-installer fzf-update "" "" paru-build \ curl-uv rustup-installer git-cargo-fish fisher-bootstrap curl-installer fzf-update "" "" paru-build \
pipx "" \ wakatime-binary "" \
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" curl-lazydocker "" "" ""
end end
# Returns the index (1-based) of $argv[1] in the catalog, or "" if not found. # Returns the index (1-based) of $argv[1] in the catalog, or "" if not found.
+121 -12
View File
@@ -11,7 +11,20 @@ function _fish_deps_install
set -l i 1 set -l i 1
for bin in $_fdc_bins for bin in $_fdc_bins
# Determine if this dep needs attention: missing, or fish < 4.0
set -l needs_install 0
set -l upgrade_label Install
if not type -q $bin if not type -q $bin
set needs_install 1
else if test "$bin" = fish
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
if test -n "$_major"; and test "$_major" -lt 4
set needs_install 1
set upgrade_label "Upgrade"
end
end
if test $needs_install -eq 1
set -l cargo_crate $_fdc_cargo[$i] set -l cargo_crate $_fdc_cargo[$i]
set -l pm_pkg $_fdc_pm[$i] set -l pm_pkg $_fdc_pm[$i]
set -l special $_fdc_special[$i] set -l special $_fdc_special[$i]
@@ -32,19 +45,41 @@ function _fish_deps_install
end end
end end
# rustup installer — listed before system PM so it is the default for cargo itself # Preferred special methods — listed before system PM so they are the default
if test "$special" = rustup-installer switch $special
set -a methods special-rustup case curl-uv
set -a method_labels "rustup installer (curl | sh)" set -a methods special-uv
set -a method_labels "curl installer (official script)"
case git-cargo-fish
if type -q cargo; and type -q uv
set -a methods special-git-cargo-fish
set -a method_labels "build from source (git + cargo)"
else
set_color brblack
set -l _need
type -q cargo; or set -a _need cargo
type -q uv; or set -a _need uv
echo " note: "(string join " and " $_need)" not found — install them first to build fish from source"
set_color normal
end
case rustup-installer
set -a methods special-rustup
set -a method_labels "rustup installer (curl | sh)"
case curl-lazydocker
set -a methods special-lazydocker
set -a method_labels "curl installer (official script)"
case wakatime-binary
set -a methods special-wakatime
set -a method_labels "binary download (github releases)"
end end
# System PM — after cargo/rustup so those are always the default when available # System PM — after cargo and preferred specials
if test -n "$pm_pkg"; and test -n "$pm" if test -n "$pm_pkg"; and test -n "$pm"
set -a methods pm set -a methods pm
set -a method_labels "$pm ($pm_pkg)" set -a method_labels "$pm ($pm_pkg)"
end end
# Remaining special methods # Supplemental special methods (fallbacks, Arch-only, etc.)
switch $special switch $special
case fzf-update case fzf-update
set -a methods special-fzf set -a methods special-fzf
@@ -83,8 +118,8 @@ function _fish_deps_install
continue continue
end end
# Prompt: install this dep? # Prompt: install/upgrade this dep?
read -l -P (set_color cyan)"Install $bin?"(set_color normal)" [Y/n] " _reply read -l -P (set_color cyan)"$upgrade_label $bin?"(set_color normal)" [Y/n] " _reply
if test "$_reply" = n; or test "$_reply" = N if test "$_reply" = n; or test "$_reply" = N
set i (math $i + 1) set i (math $i + 1)
continue continue
@@ -101,11 +136,11 @@ function _fish_deps_install
set m (math $m + 1) set m (math $m + 1)
end end
read -l -P " Choose [1-"(count $methods)"] (default 1 = $method_labels[1]): " _choice read -l -P " Choose [1-"(count $methods)"] (default 1 = $method_labels[1]): " _choice
if test -n "$_choice"; and test "$_choice" -ge 1; and test "$_choice" -le (count $methods) if string match -qr '^\d+$' "$_choice"; and test "$_choice" -ge 1; and test "$_choice" -le (count $methods)
set chosen_method $methods[$_choice] set chosen_method $methods[$_choice]
end end
else else
set_color brblack; echo " Installing via $method_labels[1]"; set_color normal set_color brblack; echo " "(string lower $upgrade_label)"ing via $method_labels[1]"; set_color normal
end end
# Execute chosen method # Execute chosen method
@@ -116,6 +151,46 @@ function _fish_deps_install
_fish_deps_pm_install $pm_pkg _fish_deps_pm_install $pm_pkg
case special-rustup case special-rustup
curl https://sh.rustup.rs -sSf | sh curl https://sh.rustup.rs -sSf | sh
# Add cargo to PATH for the rest of this session without restarting.
# Try CARGO_HOME first (set in config.fish), then the rustup default.
for _d in "$CARGO_HOME/bin" "$HOME/.cargo/bin"
if test -d "$_d"
fish_add_path "$_d"
break
end
end
if not type -q cargo
set_color yellow
echo " cargo not yet in PATH — restart your shell if subsequent installs fail."
set_color normal
end
case special-lazydocker
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
case special-wakatime
set -l _arch (uname -m)
switch $_arch
case x86_64
set _arch amd64
case aarch64 arm64
set _arch arm64
case armv7l
set _arch arm
case '*'
set _arch amd64
end
set -l _zip "wakatime-cli-linux-$_arch.zip"
set -l _bin_src "wakatime-cli-linux-$_arch"
set -l _wt_dir "$HOME/.config/wakatime"
set -l _wt_bin "$_wt_dir/wakatime"
set -l _tmpdir (mktemp -d)
curl -L "https://github.com/wakatime/wakatime-cli/releases/latest/download/$_zip" \
-o "$_tmpdir/$_zip"
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
and mkdir -p "$_wt_dir" "$HOME/.local/bin"
and cp "$_tmpdir/$_bin_src" "$_wt_bin"
and chmod +x "$_wt_bin"
and ln -sf "$_wt_bin" "$HOME/.local/bin/wakatime"
rm -rf "$_tmpdir"
case special-fzf case special-fzf
fzf-update fzf-update
case special-fisher case special-fisher
@@ -134,6 +209,35 @@ function _fish_deps_install
and makepkg -si --noconfirm and makepkg -si --noconfirm
and popd and popd
rm -rf $_build_dir rm -rf $_build_dir
case special-uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to PATH for the rest of this session
for _d in "$HOME/.local/bin" "$HOME/.cargo/bin"
if test -d "$_d"
fish_add_path "$_d"
break
end
end
if not type -q uv
set_color yellow
echo " uv not yet in PATH — restart your shell if subsequent installs fail."
set_color normal
end
case special-git-cargo-fish
set -l _tmpdir (mktemp -d)
set -l _build_ok 0
git clone https://github.com/fish-shell/fish-shell "$_tmpdir"
and begin
set -l _tag (git -C "$_tmpdir" tag --list 'fish-*' --sort=version:refname | tail -1)
test -n "$_tag"; and git -C "$_tmpdir" checkout "$_tag"
true
end
and pushd "$_tmpdir"
and uv run --no-managed-python cargo install --path .
and set _build_ok 1
popd 2>/dev/null
rm -rf "$_tmpdir"
test $_build_ok -eq 1
case special-pipx case special-pipx
pipx install $bin pipx install $bin
case special-pip case special-pip
@@ -142,9 +246,14 @@ function _fish_deps_install
if test $status -eq 0 if test $status -eq 0
set installed_any 1 set installed_any 1
set_color green; echo " $bin installed."; set_color normal set_color green; echo " $bin "(string lower $upgrade_label)"ed."; set_color normal
if test "$bin" = fish
set_color yellow
echo " Fish upgraded — restart your shell to use the new version."
set_color normal
end
else else
set_color red; echo " $bin install failed."; set_color normal set_color red; echo " $bin "(string lower $upgrade_label)" failed."; set_color normal
end end
end end
set i (math $i + 1) set i (math $i + 1)
+11
View File
@@ -7,6 +7,17 @@ function _fish_deps_status
function __fds_print_dep --argument-names bin tier function __fds_print_dep --argument-names bin tier
if type -q $bin if type -q $bin
# Special version check: fish < 4.0 is functionally incompatible
if test "$bin" = fish
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
if test -n "$_major"; and test "$_major" -lt 4
set -l _ver (fish --version 2>&1 | string replace 'fish, ' '')
set_color yellow; echo -n " ⚠ "; set_color normal
echo -n "$bin "
set_color brblack; echo "($_ver — upgrade to 4.0+ required)"; set_color normal
return
end
end
set_color green; echo -n " ✓ "; set_color normal set_color green; echo -n " ✓ "; set_color normal
echo -n "$bin " echo -n "$bin "
set_color brblack; echo "(Found at "(type -p $bin)")"; set_color normal set_color brblack; echo "(Found at "(type -p $bin)")"; set_color normal
+83 -6
View File
@@ -48,6 +48,40 @@ function _fish_deps_update
continue continue
end end
# lazydocker: re-run the official install/update script
if test "$special" = curl-lazydocker
echo "Updating $bin..."
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
set updated_any 1
set i (math $i + 1)
continue
end
# wakatime: re-download the binary from github releases
if test "$special" = wakatime-binary
echo "Updating $bin..."
set -l _arch (uname -m)
switch $_arch
case x86_64; set _arch amd64
case aarch64 arm64; set _arch arm64
case armv7l; set _arch arm
case '*'; set _arch amd64
end
set -l _zip "wakatime-cli-linux-$_arch.zip"
set -l _bin_src "wakatime-cli-linux-$_arch"
set -l _wt_bin "$HOME/.config/wakatime/wakatime"
set -l _tmpdir (mktemp -d)
curl -L "https://github.com/wakatime/wakatime-cli/releases/latest/download/$_zip" \
-o "$_tmpdir/$_zip"
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
and cp "$_tmpdir/$_bin_src" "$_wt_bin"
and chmod +x "$_wt_bin"
rm -rf "$_tmpdir"
and set updated_any 1
set i (math $i + 1)
continue
end
# pipx tools # pipx tools
if test "$special" = pipx if test "$special" = pipx
if type -q pipx if type -q pipx
@@ -59,11 +93,59 @@ function _fish_deps_update
continue continue
end end
# uv: use built-in self-updater
if test "$special" = curl-uv
echo "Updating $bin..."
uv self update
set updated_any 1
set i (math $i + 1)
continue
end
# fish: prefer build from source via git + cargo; fall back to PM
if test "$special" = git-cargo-fish
if type -q cargo; and type -q uv
echo "Updating $bin..."
set -l _tmpdir (mktemp -d)
set -l _build_ok 0
git clone https://github.com/fish-shell/fish-shell "$_tmpdir"
and begin
set -l _tag (git -C "$_tmpdir" tag --list 'fish-*' --sort=version:refname | tail -1)
test -n "$_tag"; and git -C "$_tmpdir" checkout "$_tag"
true
end
and pushd "$_tmpdir"
and uv run --no-managed-python cargo install --path .
and set _build_ok 1
popd 2>/dev/null
rm -rf "$_tmpdir"
if test $_build_ok -eq 1
set updated_any 1
set_color yellow
echo " Fish updated — restart your shell to use the new version."
set_color normal
end
else if test -n "$pm_pkg"; and test -n "$pm"
echo "Updating $bin (cargo/uv unavailable, using system PM)..."
_fish_deps_pm_upgrade $pm_pkg
set updated_any 1
set_color yellow
echo " Fish updated — restart your shell to use the new version."
set_color normal
else
set_color yellow
echo " fish: cannot update — install cargo and uv to build from source"
set_color normal
end
set i (math $i + 1)
continue
end
# curl-installer tools (starship etc.): re-run install script, which upgrades in place # curl-installer tools (starship etc.): re-run install script, which upgrades in place
if test "$special" = curl-installer if test "$special" = curl-installer
if test "$bin" = starship if test "$bin" = starship
echo "Updating $bin..." echo "Updating $bin..."
curl -sS https://starship.rs/install.sh | sh -- --yes curl -sS https://starship.rs/install.sh | sh -s -- --yes
set updated_any 1 set updated_any 1
end end
set i (math $i + 1) set i (math $i + 1)
@@ -75,11 +157,6 @@ function _fish_deps_update
echo "Updating $bin..." echo "Updating $bin..."
cargo install --force $cargo_crate cargo install --force $cargo_crate
set updated_any 1 set updated_any 1
if test "$bin" = fish
set_color yellow
echo " Fish updated — restart your shell to use the new version."
set_color normal
end
set i (math $i + 1) set i (math $i + 1)
continue continue
end end