diff --git a/functions/__auto_source_fallback_venv.fish b/functions/__auto_source_fallback_venv.fish index 1ac3b8e..0cc180c 100644 --- a/functions/__auto_source_fallback_venv.fish +++ b/functions/__auto_source_fallback_venv.fish @@ -1,6 +1,17 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# SYNOPSIS +# __auto_source_fallback_venv +# +# DESCRIPTION +# Event handler that auto-activates a .venv Python virtual environment when +# entering a directory. Deactivates when leaving the project tree. Skipped +# when direnv is already managing the directory. +# +# EXAMPLE +# # Triggered automatically on directory change; not called directly. +# cd ~/myproject # activates .venv if present function __auto_source_fallback_venv --on-variable PWD status --is-command-substitution; and return diff --git a/functions/__fish_variable_check.fish b/functions/__fish_variable_check.fish index 0ec27fd..0a00a9e 100644 --- a/functions/__fish_variable_check.fish +++ b/functions/__fish_variable_check.fish @@ -6,24 +6,23 @@ # # DESCRIPTION # Evaluates a given variable's value to determine its truthiness or falsiness. -# It safely dereferences the variable name and performs case-insensitive matching. +# Safely dereferences the variable name and performs case-insensitive matching. +# Pass the variable name (without $), not its value. # # ARGUMENTS -# variable_name The name of the variable to check (e.g., __fish_config_strict_mode) -# Do NOT pass the value directly (do not use the $ prefix). +# variable_name Name of the variable to check (without $ prefix) # # RETURNS -# 0 True (Opt-In) : Matches 1, true, yes, on, y -# 1 False (Opt-Out) : Matches 0, false, no, off, n -# 2 Empty : Variable is unset or contains an empty string -# 3 Garbage : Variable contains an unrecognized value +# 0 True (opt-in): value matches 1, true, yes, on, or y +# 1 False (opt-out): value matches 0, false, no, off, or n +# 2 Empty: variable is unset or empty +# 3 Garbage: value is unrecognized # # EXAMPLE # __fish_variable_check __fish_config_strict_mode # if test $status -eq 0 # echo "Strict mode enabled!" # end -# function __fish_variable_check --description "Check if a variable is set to a truthy or falsy value." set -l var_name $argv[1] diff --git a/functions/__fzf_inline_picker.fish b/functions/__fzf_inline_picker.fish index 3485b0b..7b40345 100644 --- a/functions/__fzf_inline_picker.fish +++ b/functions/__fzf_inline_picker.fish @@ -7,15 +7,13 @@ # DESCRIPTION # Opens an interactive fzf session and injects the selected item directly # into the command line at the cursor position. Bound to @@ by default. -# Requires fzf to be installed. Repaints the prompt after insertion. +# Repaints the prompt after selection or cancellation. # # RETURNS -# 0 A selection was made and inserted into the command line -# 0 No selection was made (fzf cancelled); command line is unchanged +# 0 Always; no-op if fzf is cancelled # # EXAMPLE -# # Press @@ at the prompt — fzf opens, pick an item, it appears at cursor -# +# # Press @@ at the command prompt to open fzf and insert the selected item. function __fzf_inline_picker # Open fzf and capture selection set -l selection (fzf) diff --git a/functions/__insert_previous_path_head.fish b/functions/__insert_previous_path_head.fish index c200c0b..c87fd5f 100644 --- a/functions/__insert_previous_path_head.fish +++ b/functions/__insert_previous_path_head.fish @@ -1,7 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Inserts the directory path (dirname) of the last argument from the previous command +# SYNOPSIS +# __insert_previous_path_head +# +# DESCRIPTION +# Inserts the directory component (dirname) of the last argument from the +# previous history command into the current commandline. Used as a keybinding +# helper to quickly reuse a directory path. +# +# EXAMPLE +# # Bind to a key to insert the directory from the last command. function __insert_previous_path_head # Get the last command tokens set -l tokens (string split -n " " -- $history[1]) diff --git a/functions/__interactive_history_sub.fish b/functions/__interactive_history_sub.fish index 5e32434..77a19fc 100644 --- a/functions/__interactive_history_sub.fish +++ b/functions/__interactive_history_sub.fish @@ -1,7 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Provides interactive history substitution using old/new pattern or sudo fallback +# SYNOPSIS +# __interactive_history_sub +# +# DESCRIPTION +# Provides interactive history substitution at the prompt. When the buffer +# contains old/new, replaces all occurrences of 'old' with 'new' in the last +# history entry. When the buffer is empty, prepends 'sudo' to the last command. +# +# EXAMPLE +# # Type "foo/bar" at prompt to replace "foo" with "bar" in the last command. function __interactive_history_sub set -l current_line (commandline -b) set -l last_cmd $history[1] diff --git a/functions/__substitute_typo.fish b/functions/__substitute_typo.fish index 746e314..a8ee28d 100644 --- a/functions/__substitute_typo.fish +++ b/functions/__substitute_typo.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Substitutes text in the command line using the ^old^new pattern from the previous command +# SYNOPSIS +# __substitute_typo +# +# DESCRIPTION +# Reads the commandline buffer and applies ^old^new substitution against +# the most recent history entry, replacing the buffer with the expanded +# result. If the buffer does not match the ^old^new pattern, inserts a +# literal caret character instead. Intended to be bound to ^ in +# key_bindings.fish. +# +# EXAMPLE +# bind ^ __substitute_typo function __substitute_typo set -l cursor_pos (commandline -C) set -l cmd (commandline) diff --git a/functions/_fish_deps_catalog.fish b/functions/_fish_deps_catalog.fish index 89a3023..65f69f7 100644 --- a/functions/_fish_deps_catalog.fish +++ b/functions/_fish_deps_catalog.fish @@ -1,19 +1,17 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Populates parallel arrays describing every managed dependency. -# Callers must invoke this function before accessing _fdc_* arrays. +# SYNOPSIS +# _fish_deps_catalog # -# Array layout (same index across all sets): -# _fdc_bins — binary name (what `type -q` checks) -# _fdc_tiers — req | int | rec -# _fdc_cargo — cargo crate name, or "" if not on crates.io -# _fdc_pm — system PM package name, or "" if not in repos -# _fdc_special — special install key: rustup-installer | fisher-bootstrap | -# fzf-update | paru-build | pipx | curl-installer | -# git-cargo-fish | curl-uv | "" (none) +# DESCRIPTION +# Populates parallel global arrays (_fdc_bins, _fdc_tiers, _fdc_cargo, +# _fdc_pm, _fdc_special) describing every managed shell dependency. +# Must be called before accessing any _fdc_* array. # -# uv and cargo are listed first so both are available before fish and other Rust tools. +# EXAMPLE +# _fish_deps_catalog +# echo $_fdc_bins function _fish_deps_catalog set -g _fdc_bins \ uv cargo fish fisher starship fzf zoxide direnv paru yay \ @@ -41,7 +39,22 @@ function _fish_deps_catalog "" "" "" "" "" "" "" "" "" "" curl-lazydocker "" "" "" end -# Returns the index (1-based) of $argv[1] in the catalog, or "" if not found. +# SYNOPSIS +# _fish_deps_catalog_idx +# +# DESCRIPTION +# Returns the 1-based index of a binary name in the _fdc_bins catalog array, +# or an empty string if the binary is not found. +# +# ARGUMENTS +# bin The binary name to look up in the catalog +# +# RETURNS +# 0 Index printed to stdout +# 1 Binary not found (empty output) +# +# EXAMPLE +# _fish_deps_catalog_idx fzf function _fish_deps_catalog_idx --argument-names bin _fish_deps_catalog set -l i 1 diff --git a/functions/_fish_deps_detect_pm.fish b/functions/_fish_deps_detect_pm.fish index a118140..85d40db 100644 --- a/functions/_fish_deps_detect_pm.fish +++ b/functions/_fish_deps_detect_pm.fish @@ -1,7 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Detect the first available system package manager. +# SYNOPSIS +# _fish_deps_detect_pm +# +# DESCRIPTION +# Detects and prints the name of the first available system package manager +# from the priority list: paru, yay, pacman, apt, brew, pkg, dnf, yum. +# Prints an empty string if none are found. +# +# EXAMPLE +# set pm (_fish_deps_detect_pm) function _fish_deps_detect_pm for pm in paru yay pacman apt brew pkg dnf yum if type -q $pm diff --git a/functions/_fish_deps_install.fish b/functions/_fish_deps_install.fish index c241935..928ec81 100644 --- a/functions/_fish_deps_install.fish +++ b/functions/_fish_deps_install.fish @@ -1,8 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Interactively install missing deps. -# For each missing dep: prompts yes/no, then prompts install method when multiple exist. +# SYNOPSIS +# _fish_deps_install +# +# DESCRIPTION +# Interactively installs each missing fish shell dependency from the catalog. +# For each missing entry, prompts yes/no and the preferred install method +# when multiple options are available. +# +# EXAMPLE +# _fish_deps_install function _fish_deps_install _fish_deps_catalog diff --git a/functions/_fish_deps_pm_install.fish b/functions/_fish_deps_pm_install.fish index 7279a07..e60d725 100644 --- a/functions/_fish_deps_pm_install.fish +++ b/functions/_fish_deps_pm_install.fish @@ -1,8 +1,23 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Install a package via the system PM. -# Usage: _fish_deps_pm_install +# SYNOPSIS +# _fish_deps_pm_install +# +# DESCRIPTION +# Installs a single package via the detected system package manager, running +# with sudo where required. Supports paru, yay, pacman, apt, brew, pkg, dnf, +# and yum. +# +# ARGUMENTS +# pkg The package name to install +# +# RETURNS +# 0 Package installed successfully +# 1 No supported package manager found +# +# EXAMPLE +# _fish_deps_pm_install ripgrep function _fish_deps_pm_install --argument-names pkg set -l pm (_fish_deps_detect_pm) if test -z "$pm" diff --git a/functions/_fish_deps_pm_upgrade.fish b/functions/_fish_deps_pm_upgrade.fish index 0d4efe2..d6e98c1 100644 --- a/functions/_fish_deps_pm_upgrade.fish +++ b/functions/_fish_deps_pm_upgrade.fish @@ -1,8 +1,23 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Upgrade an already-installed package via the system PM. -# Usage: _fish_deps_pm_upgrade +# SYNOPSIS +# _fish_deps_pm_upgrade +# +# DESCRIPTION +# Upgrades an installed package via the detected system package manager, +# running with sudo where required. Supports paru, yay, pacman, apt, brew, +# pkg, dnf, and yum. +# +# ARGUMENTS +# pkg The package name to upgrade +# +# RETURNS +# 0 Package upgraded successfully +# 1 No supported package manager found +# +# EXAMPLE +# _fish_deps_pm_upgrade ripgrep function _fish_deps_pm_upgrade --argument-names pkg set -l pm (_fish_deps_detect_pm) if test -z "$pm" diff --git a/functions/_fish_deps_status.fish b/functions/_fish_deps_status.fish index e9e66b0..ec23692 100644 --- a/functions/_fish_deps_status.fish +++ b/functions/_fish_deps_status.fish @@ -1,7 +1,15 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Print colored installed/missing status for all deps, grouped by tier. +# SYNOPSIS +# _fish_deps_status +# +# DESCRIPTION +# Prints a colored installed/missing status report for all managed fish shell +# dependencies, grouped by tier (required, integrations, recommended). +# +# EXAMPLE +# _fish_deps_status function _fish_deps_status _fish_deps_catalog diff --git a/functions/_fish_deps_update.fish b/functions/_fish_deps_update.fish index 6d4baae..1b7a2b7 100644 --- a/functions/_fish_deps_update.fish +++ b/functions/_fish_deps_update.fish @@ -1,8 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Update all installed deps using their known install method. -# Priority: cargo > system PM > special (fzf-update, fisher, pipx). +# SYNOPSIS +# _fish_deps_update +# +# DESCRIPTION +# Updates all currently installed fish shell dependencies using their +# preferred method. Priority order: cargo, then system PM, then special +# installers (fzf-update, fisher, pipx). Always updates fisher plugins first. +# +# EXAMPLE +# _fish_deps_update function _fish_deps_update _fish_deps_catalog diff --git a/functions/_fish_mkdir_p.fish b/functions/_fish_mkdir_p.fish index 1943893..5b42ea9 100644 --- a/functions/_fish_mkdir_p.fish +++ b/functions/_fish_mkdir_p.fish @@ -1,14 +1,25 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# mkdir -p with configurable output. +# SYNOPSIS +# _fish_mkdir_p [--path|--tree|--silent] # -# Flags: -# --path / -p (default) Print "Created: ~/full/path/" on one line -# --tree / -t Tree view: dimmed existing anchor + cyan new dirs -# --silent / -s No output +# DESCRIPTION +# Creates a directory and all missing parents, then reports what was created. +# Output mode is configurable: path (default), tree, or silent. # -# Usage: _fish_mkdir_p [--path|--tree|--silent] +# ARGUMENTS +# -p, --path Print a single "Created: ~/path/" line (default) +# -t, --tree Show a tree view of the newly created hierarchy +# -s, --silent Suppress all output +# dir The directory path to create +# +# RETURNS +# 0 Directory created or already exists +# 1 No target directory specified or mkdir failed +# +# EXAMPLE +# _fish_mkdir_p --tree ~/projects/new/subdir function _fish_mkdir_p --description 'mkdir -p with configurable verbose output' set -l mode path set -l target diff --git a/functions/_qalc_eval.fish b/functions/_qalc_eval.fish index 69aa255..abe6de2 100644 --- a/functions/_qalc_eval.fish +++ b/functions/_qalc_eval.fish @@ -1,7 +1,20 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Returns the result of a qalc calculation +# SYNOPSIS +# _qalc_eval +# +# DESCRIPTION +# Reads the current commandline buffer and evaluates it as a qalc +# expression, printing the result. Clears the buffer and repaints +# after evaluation. No-ops if qalc is not installed or the buffer +# is empty. Intended to be bound to a key in key_bindings.fish. +# +# RETURNS +# 1 qalc not found in PATH +# +# EXAMPLE +# bind \cr _qalc_eval function _qalc_eval type -q qalc || return 1 diff --git a/functions/_replace_command_token.fish b/functions/_replace_command_token.fish index cd75d3f..b8a4f3a 100644 --- a/functions/_replace_command_token.fish +++ b/functions/_replace_command_token.fish @@ -1,8 +1,17 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Removes the first token from the command line and places the cursor at the position for replacement. -# If the command starts with 'sudo', preserves 'sudo' and removes the next token instead. +# SYNOPSIS +# _replace_command_token +# +# DESCRIPTION +# Removes the first command token from the commandline buffer and +# positions the cursor for immediate replacement. If the command starts +# with sudo, preserves sudo and removes the token after it instead. +# Intended to be bound to a key in key_bindings.fish. +# +# EXAMPLE +# bind \cx _replace_command_token function _replace_command_token --description 'Remove first command token (or first after sudo) and place cursor for replacement' set -l cmd (commandline) diff --git a/functions/_scrollback_prune_junk.fish b/functions/_scrollback_prune_junk.fish index 0d441e1..37f474d 100644 --- a/functions/_scrollback_prune_junk.fish +++ b/functions/_scrollback_prune_junk.fish @@ -1,6 +1,20 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# SYNOPSIS +# _scrollback_prune_junk [dir] +# +# DESCRIPTION +# Removes low-value log files from the scrollback history directory: +# empty files, files with at most one meaningful line, and Kitty +# tab-rename prompt captures. Called by smart_exit.fish on session end. +# +# ARGUMENTS +# dir Directory to prune (defaults to $SCROLLBACK_HISTORY_DIR or +# ~/.terminal_history) +# +# EXAMPLE +# _scrollback_prune_junk ~/.terminal_history function _scrollback_prune_junk --description 'Remove empty, trivial, and Kitty UI noise logs' set -l dir (set -q SCROLLBACK_HISTORY_DIR; and echo $SCROLLBACK_HISTORY_DIR; or echo "$HOME/.terminal_history") if set -q argv[1] diff --git a/functions/_smart_execute.fish b/functions/_smart_execute.fish index cb1bd33..388ad69 100644 --- a/functions/_smart_execute.fish +++ b/functions/_smart_execute.fish @@ -1,7 +1,17 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Executes different functions based on the command line content +# SYNOPSIS +# _smart_execute +# +# DESCRIPTION +# Bound to Enter, dispatches based on the current commandline buffer. +# Buffers ending in = are evaluated as qalc expressions via _qalc_eval. +# Empty buffers and all other input fall through to normal execution. +# Intended to be bound to a key in key_bindings.fish. +# +# EXAMPLE +# bind \r _smart_execute function _smart_execute --description 'Execute different functions based on the command line content' # Get the current command line buffer set -l cmd (commandline) diff --git a/functions/antigravity-ide.fish b/functions/antigravity-ide.fish index a94b368..9ad77ab 100644 --- a/functions/antigravity-ide.fish +++ b/functions/antigravity-ide.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias antigravity-ide=antigravity +# SYNOPSIS +# antigravity-ide [args...] +# +# DESCRIPTION +# Wrapper for the antigravity-ide command that filters a known noisy warning +# about an unrecognized 'app' option from stderr. +# +# ARGUMENTS +# args... Arguments passed through to the antigravity-ide command +# +# EXAMPLE +# antigravity-ide function antigravity-ide --wraps='antigravity-ide' --description 'alias antigravity-ide=antigravity-ide' # In fish, we pipe stderr using '2>|' to another command command antigravity-ide $argv 2>| grep -v "'app' is not in the list of known options" >&2 diff --git a/functions/antigravity-resume.fish b/functions/antigravity-resume.fish index 5b33b14..7931ce0 100644 --- a/functions/antigravity-resume.fish +++ b/functions/antigravity-resume.fish @@ -1,7 +1,20 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Execute antigravity-resume +# SYNOPSIS +# antigravity-resume +# +# DESCRIPTION +# Resumes an Antigravity (agy) AI session using the session ID saved in +# .antigravity_session in the current directory. Falls back to the interactive +# session browser if no local session file exists. +# +# RETURNS +# 0 Session resumed or interactive picker opened +# 1 Required binaries (agy or save_antigravity_session) are not found +# +# EXAMPLE +# antigravity-resume function antigravity-resume --description 'Execute antigravity-resume' if not type -q agy echo "Error: The 'agy' command is not installed or not in PATH." >&2 diff --git a/functions/antigravity.fish b/functions/antigravity.fish index 4d0e701..251ab88 100644 --- a/functions/antigravity.fish +++ b/functions/antigravity.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias antigravity=agy +# SYNOPSIS +# antigravity [args...] +# +# DESCRIPTION +# Wrapper for the agy Antigravity AI CLI that filters a known noisy warning +# about an unrecognized 'app' option from stderr. +# +# ARGUMENTS +# args... Arguments passed through to the agy command +# +# EXAMPLE +# antigravity chat function antigravity --wraps='agy' --description 'alias antigravity=agy' # In fish, we pipe stderr using '2>|' to another command command agy $argv 2>| grep -v "'app' is not in the list of known options" >&2 diff --git a/functions/bash.fish b/functions/bash.fish index 9b03795..1ccaa48 100644 --- a/functions/bash.fish +++ b/functions/bash.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# bash switches to bash shell +# SYNOPSIS +# bash [args...] +# +# DESCRIPTION +# Switches the current shell session to bash, loading config from the XDG +# config directory. Resets $SHELL back to fish on exit. +# +# ARGUMENTS +# args... Arguments passed through to the bash command +# +# EXAMPLE +# bash function bash --wraps='bash' --description 'bash switches to bash shell' set SHELL $(which bash) # Set shell to bash command bash --rcfile "$XDG_CONFIG_HOME/bash/bashrc" $argv # Run bash diff --git a/functions/bd-pull.fish b/functions/bd-pull.fish index eb28893..c6e2cd9 100644 --- a/functions/bd-pull.fish +++ b/functions/bd-pull.fish @@ -1,7 +1,23 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Pull new Gitea issues into local Beads and link them +# SYNOPSIS +# bd-pull +# +# DESCRIPTION +# Fetches unlinked issues from a Gitea repository, creates corresponding local +# Beads entries, and updates the Gitea issue titles to include the new Bead IDs. +# Requires $GITEA_TOKEN and $GITEA_URL to be set. +# +# ARGUMENTS +# owner/repo The repository path in owner/name format +# +# RETURNS +# 0 Issues linked and synced (or no unlinked issues found) +# 1 Missing required argument or environment variables +# +# EXAMPLE +# bd-pull myuser/myproject function bd-pull --description 'Pull new Gitea issues into local Beads and link them' if not set -q argv[1]; echo "Need repo owner/name"; return 1; end if not set -q GITEA_TOKEN; echo "\$GITEA_TOKEN not set"; return 1; end diff --git a/functions/bkg.fish b/functions/bkg.fish index ba5e9c3..4344b3a 100644 --- a/functions/bkg.fish +++ b/functions/bkg.fish @@ -1,18 +1,23 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Function to run a command in the background, detached from the terminal. -# This prevents the command from being terminated when the terminal is closed. -# All output (stdout and stderr) is discarded. +# SYNOPSIS +# bkg [args...] # -# Usage: -# bkg [arguments...] +# DESCRIPTION +# Launches a command in the background, fully detached from the terminal +# using nohup. All stdout and stderr output is discarded. # -# Example: +# ARGUMENTS +# command The command to run detached +# args... Additional arguments for the command +# +# RETURNS +# 0 Command launched successfully +# 1 No command provided +# +# EXAMPLE # bkg firefox -# bkg code . -# -# Execute bkg function bkg --description 'Execute bkg' # Check if a command was provided as an argument. if test -z "$argv[1]" diff --git a/functions/cat.fish b/functions/cat.fish index 9dc6693..e0d8682 100644 --- a/functions/cat.fish +++ b/functions/cat.fish @@ -1,7 +1,19 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Use bat for files and ls for directories when using cat +# SYNOPSIS +# cat [args...] +# +# DESCRIPTION +# Enhanced cat replacement that uses bat for file display, runs ls when given +# a directory, falls back to raw cat for ANSI-colored log files, and finally +# falls back to standard cat if bat is not installed. +# +# ARGUMENTS +# args... Files or directories to display +# +# EXAMPLE +# cat README.md function cat --wraps='bat' --description 'Use bat for files, ls for directories, and raw cat for ANSI logs' # If no arguments are provided, cat usually waits for stdin. # We'll maintain that behavior by skipping the directory check if $argv is empty. diff --git a/functions/cdi.fish b/functions/cdi.fish index f5c563d..cc6e659 100644 --- a/functions/cdi.fish +++ b/functions/cdi.fish @@ -1,6 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# SYNOPSIS +# cdi [query] +# +# DESCRIPTION +# Alias for zi — opens zoxide's interactive directory picker for jumping to +# frequently-visited directories using fzf. +# +# ARGUMENTS +# query Optional search term to pre-filter the directory list +# +# EXAMPLE +# cdi myproject function cdi --wraps zi --description 'Interactively jump to a directory using zoxide (alias for zi)' zi $argv end diff --git a/functions/cffetch.fish b/functions/cffetch.fish index 17dc2f5..d612cee 100644 --- a/functions/cffetch.fish +++ b/functions/cffetch.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias cffetch=clear;fastfetch +# SYNOPSIS +# cffetch [args...] +# +# DESCRIPTION +# Clears the screen and displays system information using fastfetch with a +# custom config if available. Falls back to neofetch if fastfetch is not installed. +# +# ARGUMENTS +# args... Additional arguments forwarded to fastfetch or neofetch +# +# EXAMPLE +# cffetch function cffetch --description 'alias cffetch=clear;fastfetch' clear if which fastfetch >/dev/null 2>&1 diff --git a/functions/cheat.fish b/functions/cheat.fish index afbb264..eda60e0 100644 --- a/functions/cheat.fish +++ b/functions/cheat.fish @@ -1,7 +1,19 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias cheat=cheat -c +# SYNOPSIS +# cheat [args...] +# +# DESCRIPTION +# Displays colorized cheatsheets using cheat -c. Falls back to tldr, then +# man, if cheat is not installed. +# +# ARGUMENTS +# topic The command or topic to look up +# args... Additional arguments forwarded to cheat, tldr, or man +# +# EXAMPLE +# cheat tar function cheat --wraps='cheat' --description 'alias cheat=cheat -c' if type -q cheat command cheat -c $argv diff --git a/functions/check_fish_deps.fish b/functions/check_fish_deps.fish index 04470c5..b9b07b0 100644 --- a/functions/check_fish_deps.fish +++ b/functions/check_fish_deps.fish @@ -1,7 +1,15 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Thin wrapper kept for backwards compatibility. +# SYNOPSIS +# check_fish_deps +# +# DESCRIPTION +# Backwards-compatibility wrapper that delegates to fish-deps status to +# report which fish shell dependencies are installed or missing. +# +# EXAMPLE +# check_fish_deps function check_fish_deps --description 'Check all fish-related dependencies' fish-deps status end diff --git a/functions/claude-docs.fish b/functions/claude-docs.fish index b957a9d..0e217e6 100644 --- a/functions/claude-docs.fish +++ b/functions/claude-docs.fish @@ -1,7 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Update README.md with recent changes using Claude-code +# SYNOPSIS +# claude-docs +# +# DESCRIPTION +# Invokes Claude Code to analyze recent repository changes and update +# README.md, ensuring all features and examples are accurate and pruning +# obsolete content. +# +# EXAMPLE +# claude-docs function claude-docs --description 'Claude-code: Sync README with recent changes' claude "Analyze the recent changes and update the README.md to ensure all features, setup instructions, and examples are 100% accurate. Prune any obsolete information." end diff --git a/functions/claude-pr.fish b/functions/claude-pr.fish index 8f6ab35..8f0951a 100644 --- a/functions/claude-pr.fish +++ b/functions/claude-pr.fish @@ -1,7 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Create a new git branch, commit, push, and PR using Claude-code +# SYNOPSIS +# claude-pr +# +# DESCRIPTION +# Invokes Claude Code to perform a full PR workflow: create a kebab-case +# branch, write a Conventional Commit, run verification, push, and open a +# pull request with a manual verification checklist. +# +# EXAMPLE +# claude-pr function claude-pr --description 'Claude-code: New branch, commit, push, and PR' claude "Act as a senior engineer. Execute this sequence: 1. Create a new git branch (kebab-case). 2. Stage changes and write a Conventional Commit message. 3. Self-verify the changes by running relevant build/test commands or linting. 4. Push to remote. 5. Create a PR to 'main' including a summary of changes and a 'Manual Verification' section containing a Markdown checklist (- [ ]) of specific, bite-sized steps required to manually verify the functionality." end diff --git a/functions/claude-resume.fish b/functions/claude-resume.fish index a8a16db..2daf47f 100644 --- a/functions/claude-resume.fish +++ b/functions/claude-resume.fish @@ -1,7 +1,20 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Execute claude-resume +# SYNOPSIS +# claude-resume +# +# DESCRIPTION +# Resumes a Claude Code session using the ID saved in .claude_session in the +# current directory. Falls back to the interactive session picker if no file +# exists. +# +# RETURNS +# 0 Session resumed or interactive picker opened +# 1 Required binaries (claude or save_claude_session) are not found +# +# EXAMPLE +# claude-resume function claude-resume --description 'Execute claude-resume' if not type -q claude echo "Error: The 'claude' command is not installed or not in PATH." >&2 diff --git a/functions/claude.fish b/functions/claude.fish index a26d4aa..69d7455 100644 --- a/functions/claude.fish +++ b/functions/claude.fish @@ -1,6 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# SYNOPSIS +# claude [args...] +# +# DESCRIPTION +# Wrapper for the claude CLI that always injects --remote-control unless it +# is already present in the argument list. +# +# ARGUMENTS +# args... Arguments passed through to the claude command +# +# EXAMPLE +# claude "Refactor the auth module" function claude --wraps='claude --remote-control' --description 'claude with --remote-control always enabled' if contains -- --remote-control $argv command claude $argv diff --git a/functions/cleanup.fish b/functions/cleanup.fish index e7cae17..83c2b40 100644 --- a/functions/cleanup.fish +++ b/functions/cleanup.fish @@ -1,7 +1,15 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Log orphans to ~/.removed_orphans and remove them +# SYNOPSIS +# cleanup +# +# DESCRIPTION +# Identifies and removes Arch Linux orphan packages using pacman. Logs +# package names and versions to ~/.removed_orphans before removal. +# +# EXAMPLE +# cleanup function cleanup --description 'Log orphans to ~/.removed_orphans and remove them' set -l orphans (pacman -Qtdq) if test -n "$orphans" diff --git a/functions/clone.fish b/functions/clone.fish index 7970390..f036d48 100644 --- a/functions/clone.fish +++ b/functions/clone.fish @@ -1,7 +1,22 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias clone=clone-in-kitty +# SYNOPSIS +# clone [args...] +# +# DESCRIPTION +# Alias for clone-in-kitty that clones a repository into a new Kitty terminal +# window. Only works inside the Kitty terminal. +# +# ARGUMENTS +# args... Arguments forwarded to clone-in-kitty (typically a repo URL) +# +# RETURNS +# 0 Repository cloned +# 1 Not running inside Kitty terminal +# +# EXAMPLE +# clone https://github.com/user/repo.git function clone --wraps='clone-in-kitty' --description 'alias clone=clone-in-kitty' if test "$TERM" != xterm-kitty echo "Error: The 'clone' command requires Kitty terminal." >&2 diff --git a/functions/clonet.fish b/functions/clonet.fish index 57f3c0b..4c31ca8 100644 --- a/functions/clonet.fish +++ b/functions/clonet.fish @@ -1,7 +1,22 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias clonet=clone-in-kitty --type=tab +# SYNOPSIS +# clonet [args...] +# +# DESCRIPTION +# Alias for clone-in-kitty --type=tab that clones a repository into a new +# Kitty terminal tab. Only works inside the Kitty terminal. +# +# ARGUMENTS +# args... Arguments forwarded to clone-in-kitty (typically a repo URL) +# +# RETURNS +# 0 Repository cloned +# 1 Not running inside Kitty terminal +# +# EXAMPLE +# clonet https://github.com/user/repo.git function clonet --wraps='clone-in-kitty --type=tab' --description 'alias clonet=clone-in-kitty --type=tab' if test "$TERM" != xterm-kitty echo "Error: The 'clonet' command requires Kitty terminal." >&2 diff --git a/functions/code-resume.fish b/functions/code-resume.fish index 5efbff8..640a739 100644 --- a/functions/code-resume.fish +++ b/functions/code-resume.fish @@ -1,7 +1,16 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Execute code-resume +# SYNOPSIS +# code-resume +# +# DESCRIPTION +# Resumes the most recent AI coding session in the current directory. Prefers +# Claude Code (.claude_session), then Antigravity (.antigravity_session), +# falling back to the Claude interactive session picker. +# +# EXAMPLE +# code-resume function code-resume --description 'Execute code-resume' if test -f .claude_session set -l sid (cat .claude_session) diff --git a/functions/copy.fish b/functions/copy.fish index 0ca43c0..c8b1302 100644 --- a/functions/copy.fish +++ b/functions/copy.fish @@ -1,6 +1,19 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# SYNOPSIS +# copy +# +# DESCRIPTION +# Wrapper for cp that strips trailing slashes from source directories, +# preventing unwanted nested copies when the destination already exists. +# +# ARGUMENTS +# source Source file or directory +# dest Destination path +# +# EXAMPLE +# copy ./mydir/ ~/backup function copy set count (count $argv) if test "$count" = 2; and test -d "$argv[1]" diff --git a/functions/detach.fish b/functions/detach.fish index c24fe47..d2523f2 100644 --- a/functions/detach.fish +++ b/functions/detach.fish @@ -1,7 +1,25 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Execute detach +# SYNOPSIS +# detach [-h] [--version] [args...] +# +# DESCRIPTION +# Runs a command in the background using nohup, fully detached from the +# terminal with all output discarded. +# +# ARGUMENTS +# -h, --help Show help message +# --version Show version information +# command The command to run detached +# args... Additional arguments for the command +# +# RETURNS +# 0 Command launched or help/version shown +# 1 No command provided or unknown option +# +# EXAMPLE +# detach rsync -a ./data remote:/backup/ function detach --description 'Execute detach' set -l show_help 0 set -l args diff --git a/functions/dng2avif.fish b/functions/dng2avif.fish index ca8723f..e01f32b 100644 --- a/functions/dng2avif.fish +++ b/functions/dng2avif.fish @@ -1,7 +1,27 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Convert DNG raw to 10-bit HDR AVIF +# SYNOPSIS +# dng2avif [-h] [-i ] [-o ] [-q ] [-s ] [input.dng] +# +# DESCRIPTION +# Converts a DNG raw image to a 10-bit HDR AVIF using a three-step pipeline: +# develop with ImageMagick, encode with ffmpeg+avifenc, sync metadata with +# exiftool. Requires magick, ffmpeg, avifenc, and exiftool. +# +# ARGUMENTS +# -i, --input FILE Input DNG file +# -o, --output FILE Output AVIF file (defaults to input basename) +# -q, --quality N Encoding quality 0-100 (default: 92) +# -s, --speed N Encoder speed 0-10 (default: 3, 0 = slowest) +# -h, --help Show help message +# +# RETURNS +# 0 Conversion complete +# 1 File not found, missing dependency, or encode step failed +# +# EXAMPLE +# dng2avif photo.dng function dng2avif --description 'Convert DNG raw to 10-bit HDR AVIF' set -l options (fish_opt -s h -l help) set -a options (fish_opt -s i -l input -r) diff --git a/functions/dockup.fish b/functions/dockup.fish index dafd33a..fdefc59 100644 --- a/functions/dockup.fish +++ b/functions/dockup.fish @@ -1,7 +1,23 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Pull and restart docker compose containers +# SYNOPSIS +# dockup [-h] [directory] +# +# DESCRIPTION +# Pulls the latest Docker images and restarts all services in a Docker Compose +# project, then prunes dangling images. Accepts an optional target directory. +# +# ARGUMENTS +# -h, --help Show help message +# directory Path to the compose project (defaults to current directory) +# +# RETURNS +# 0 Services updated and running +# 1 Directory not found or no docker-compose.yml present +# +# EXAMPLE +# dockup ~/myapp function dockup --description 'Pull and restart docker compose containers' # Define colors set -l clr_error (set_color red) diff --git a/functions/dops.fish b/functions/dops.fish index 2bdd585..5251d02 100644 --- a/functions/dops.fish +++ b/functions/dops.fish @@ -1,7 +1,20 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Execute docker +# SYNOPSIS +# docker [subcommand] [args...] +# +# DESCRIPTION +# Wrapper for docker that intercepts the ps subcommand and redirects it to +# the dops function for enhanced container listing. All other subcommands are +# passed through to the real docker binary. +# +# ARGUMENTS +# subcommand Docker subcommand (ps is redirected to dops) +# args... Arguments forwarded to docker or dops +# +# EXAMPLE +# docker ps function docker --description 'Execute docker' if test -n "$argv[1]" switch $argv[1] diff --git a/functions/du.fish b/functions/du.fish index 909e18a..4f291e7 100644 --- a/functions/du.fish +++ b/functions/du.fish @@ -1,7 +1,22 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Execute du +# SYNOPSIS +# du [--disk|--dir|--dua] [args...] +# +# DESCRIPTION +# Smart disk-usage wrapper that routes to duf (disk overview), dust (directory +# tree), or dua based on context or explicit flags. Falls back to system du +# when the preferred tool is not installed. +# +# ARGUMENTS +# --disk Force duf for disk-level overview +# --dir Force dust for directory-level breakdown +# --dua Force dua interactive mode +# args... Files/directories or flags forwarded to the selected tool +# +# EXAMPLE +# du ~/Downloads function du --description 'Execute du' set cmd "" set args diff --git a/functions/dusize.fish b/functions/dusize.fish index 5f8ebaf..59dbb29 100644 --- a/functions/dusize.fish +++ b/functions/dusize.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias dusize=du +# SYNOPSIS +# dusize [dir] +# +# DESCRIPTION +# Shows a human-readable disk usage summary using du -sh. Defaults to the +# current directory if no argument is given. +# +# ARGUMENTS +# dir Directory to summarize (defaults to current directory) +# +# EXAMPLE +# dusize ~/Downloads function dusize --wraps='du' --description 'alias dusize=du' du -sh (test -n "$argv[1]"; and echo $argv[1]; or echo .) end diff --git a/functions/edit.fish b/functions/edit.fish index 1902153..1728a60 100644 --- a/functions/edit.fish +++ b/functions/edit.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias edit=nvim +# SYNOPSIS +# edit [args...] +# +# DESCRIPTION +# Opens files in nvim, falling back to $EDITOR, nano, or vi if nvim is not +# installed. +# +# ARGUMENTS +# args... Files and options forwarded to the editor +# +# EXAMPLE +# edit ~/.config/fish/config.fish function edit --wraps='nvim' --description 'alias edit=nvim' if type -q nvim nvim $argv diff --git a/functions/fast-cli.fish b/functions/fast-cli.fish index 2abf4be..362d30e 100644 --- a/functions/fast-cli.fish +++ b/functions/fast-cli.fish @@ -1,7 +1,17 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Run a speed test using fast.com +# SYNOPSIS +# fast-cli [args...] +# +# DESCRIPTION +# Runs a network speed test using the fast.com CLI tool. +# +# ARGUMENTS +# args... Arguments forwarded to the fast command +# +# EXAMPLE +# fast-cli function fast-cli --description "Run a speed test using fast.com" command fast $argv end diff --git a/functions/fast.fish b/functions/fast.fish index 8cacc83..59214ed 100644 --- a/functions/fast.fish +++ b/functions/fast.fish @@ -23,7 +23,15 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Placeholder for a future implementation of a "fast" function +# SYNOPSIS +# fast +# +# DESCRIPTION +# Displays a styled message indicating that the fast command is unavailable +# and suggests using fast-cli instead. +# +# EXAMPLE +# fast function fast --description 'Placeholder for future fast utility' # ANSI Escape Codes (Standard 16-color palette) set -l bold "\e[1m" diff --git a/functions/ffetch.fish b/functions/ffetch.fish index 56d2f6b..3be5cdd 100644 --- a/functions/ffetch.fish +++ b/functions/ffetch.fish @@ -1,7 +1,18 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# alias ffetch=fastfetch +# SYNOPSIS +# ffetch [args...] +# +# DESCRIPTION +# Alias for fastfetch that loads a custom config from ~/.fastfetch.jsonc when +# present. Falls back to neofetch if fastfetch is not installed. +# +# ARGUMENTS +# args... Arguments forwarded to fastfetch or neofetch +# +# EXAMPLE +# ffetch function ffetch --wraps='fastfetch' --description 'alias ffetch=fastfetch' if which fastfetch >/dev/null 2>&1 if ls ~/.fastfetch.jsonc >/dev/null 2>&1 diff --git a/functions/fish-deps.fish b/functions/fish-deps.fish index 47099e5..a6f1e62 100644 --- a/functions/fish-deps.fish +++ b/functions/fish-deps.fish @@ -1,6 +1,25 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later +# SYNOPSIS +# fish-deps [status|install|update|sync] +# +# DESCRIPTION +# Manages fish shell dependencies by dispatching to subcommand handlers. +# Defaults to status when no subcommand is given. +# +# ARGUMENTS +# status Report installed/missing deps (default) +# install Install missing deps interactively +# update Update all installed deps +# sync Install missing deps, then update all +# +# RETURNS +# 0 Subcommand completed +# 1 Unknown subcommand +# +# EXAMPLE +# fish-deps sync function fish-deps --description 'Manage fish shell dependencies' set -l subcmd $argv[1] @@ -27,6 +46,14 @@ function fish-deps --description 'Manage fish shell dependencies' end end +# SYNOPSIS +# __fish_deps_help +# +# DESCRIPTION +# Prints usage and subcommand reference for the fish-deps command to stdout. +# +# EXAMPLE +# __fish_deps_help function __fish_deps_help set_color cyan; echo "fish-deps — manage fish shell dependencies"; set_color normal echo "" diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish index 89a5bb1..7f1642a 100644 --- a/functions/fish_right_prompt.fish +++ b/functions/fish_right_prompt.fish @@ -1,7 +1,15 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Execute fish_right_prompt +# SYNOPSIS +# fish_right_prompt +# +# DESCRIPTION +# Renders the right-side prompt showing the active Docker context (in blue, +# when non-default) and the current timestamp. +# +# EXAMPLE +# # Rendered automatically by Fish shell; not called directly. function fish_right_prompt --description 'Execute fish_right_prompt' # 1. Docker Context in Blue set -l docker_ctx (docker context show 2>/dev/null) diff --git a/functions/fzf-update.fish b/functions/fzf-update.fish index 2f62708..2cc70ec 100644 --- a/functions/fzf-update.fish +++ b/functions/fzf-update.fish @@ -1,7 +1,15 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Installs or upgrades fzf from git HEAD into ~/.fzf +# SYNOPSIS +# fzf-update +# +# DESCRIPTION +# Installs or upgrades fzf from git HEAD into ~/.fzf. Pulls the latest +# changes if ~/.fzf already exists, or clones the repository if not. +# +# EXAMPLE +# fzf-update function fzf-update --description 'Install or upgrade fzf from git HEAD' if test -d ~/.fzf echo "Updating fzf..." diff --git a/functions/fzf_configure_bindings.fish b/functions/fzf_configure_bindings.fish index e1a4a0a..e20a8e7 100644 --- a/functions/fzf_configure_bindings.fish +++ b/functions/fzf_configure_bindings.fish @@ -1,8 +1,30 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect -# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1 +# SYNOPSIS +# fzf_configure_bindings [--directory=] [--git_log=] [--git_status=] +# [--history=] [--processes=] [--variables=] [-h] +# +# DESCRIPTION +# Installs key bindings for fzf.fish in both insert and default vi modes. +# Each binding can be overridden with a custom key or disabled by passing an +# empty string. Only runs in interactive mode. +# +# ARGUMENTS +# --directory=key Override the directory search binding (default: Ctrl-Alt-F) +# --git_log=key Override the git log search binding (default: Ctrl-Alt-L) +# --git_status=key Override the git status binding (default: Ctrl-Alt-S) +# --history=key Override the history search binding (default: Ctrl-R) +# --processes=key Override the processes search binding (default: Ctrl-Alt-P) +# --variables=key Override the variables search binding (default: Ctrl-V) +# -h, --help Show help message +# +# RETURNS +# 0 Bindings installed or help shown +# 22 Invalid option or positional argument provided +# +# EXAMPLE +# fzf_configure_bindings --history=ctrl-h function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options." # no need to install bindings if not in interactive mode or running tests status is-interactive || test "$CI" = true; or return diff --git a/functions/gi.fish b/functions/gi.fish index 7b999b9..a4266db 100644 --- a/functions/gi.fish +++ b/functions/gi.fish @@ -1,7 +1,29 @@ # Copyright (C) 2026 Rootiest # SPDX-License-Identifier: AGPL-3.0-or-later -# Generate .gitignore files using the gitignore.io API +# SYNOPSIS +# gi [-h] [-b] [-p] [-s] [targets...] +# +# DESCRIPTION +# Generates .gitignore content by querying the gitignore.io API. Appends +# results to the repository's .gitignore with MD5-based deduplication, or +# prints to stdout with -s. Supports boilerplate and interactive prompt modes. +# +# ARGUMENTS +# -h, --help Show help message +# -d, --description Show the function description +# -l, --list List all supported targets from the API +# -b, --boilerplate Append boilerplate from $GITIGNORE_BOILERPLATE +# -p, --prompt Prompt for patterns to append +# -s, --stdout Print API output to stdout instead of .gitignore +# targets Comma-separated list of language/tool names +# +# RETURNS +# 0 Patterns appended or printed +# 1 Not in a git repository or API fetch failed +# +# EXAMPLE +# gi python,venv function gi --description 'Generate .gitignore files using the gitignore.io API' argparse h/help d/description l/list b/boilerplate p/prompt s/stdout -- $argv or return 1 @@ -163,8 +185,21 @@ function gi --description 'Generate .gitignore files using the gitignore.io API' end end -# Append API content to .gitignore with MD5-based deduplication. -# Args: content, label, gitignore_path, readable_path +# SYNOPSIS +# __gi_append_dedup