Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.3] - 2026-02-15

### Fixed
- Removed deprecated `homebrew/cask-fonts` tap logic; font casks now live in the main `homebrew/cask` repository since Homebrew 4.3.0

### Added
- `--version` / `-v` flag to display the current version
- `--list-installed` / `-l` flag to list installed Nerd Fonts non-interactively
- `--list-available` / `-a` flag to list available Nerd Fonts non-interactively
- Updated shell completions (zsh, bash, fish) with new flags

## [1.0.2] - 2025-12-28

### Added
Expand Down Expand Up @@ -41,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Homebrew formula for easy installation
- Logging to `~/.nerd-font-manager.log`

[1.0.3]: https://github.com/auge2u/uni-nerd-font/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/auge2u/uni-nerd-font/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/auge2u/uni-nerd-font/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/auge2u/uni-nerd-font/releases/tag/v1.0.0
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ A bash utility for managing [Nerd Fonts](https://www.nerdfonts.com/) on macOS vi
- [Homebrew](https://brew.sh/)
- [fzf](https://github.com/junegunn/fzf) (for CLI mode): `brew install fzf`

> **Note:** As of Homebrew 4.3.0, all font casks (previously in `homebrew/cask-fonts`) are now part of the main `homebrew/cask` repository. No additional tap is needed for fonts.

## Installation

### Homebrew (Recommended)
Expand Down Expand Up @@ -66,6 +68,15 @@ Then restart your shell or source the config file.
# GUI mode - macOS native dialogs
./nerd-font-manager.sh --gui

# Show version
./nerd-font-manager.sh --version

# List installed Nerd Fonts
./nerd-font-manager.sh --list-installed

# List available Nerd Fonts
./nerd-font-manager.sh --list-available

# Show help
./nerd-font-manager.sh --help
```
Expand Down
3 changes: 3 additions & 0 deletions completions/_nerd-font-manager
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ _nerd-font-manager() {
options=(
'(-c --cli)'{-c,--cli}'[Run in CLI mode with fzf (default)]'
'(-g --gui)'{-g,--gui}'[Run in GUI mode with macOS dialogs]'
'(-v --version)'{-v,--version}'[Show version]'
'(-l --list-installed)'{-l,--list-installed}'[List installed Nerd Fonts]'
'(-a --list-available)'{-a,--list-available}'[List available Nerd Fonts]'
'(-h --help)'{-h,--help}'[Show help message]'
)

Expand Down
2 changes: 1 addition & 1 deletion completions/nerd-font-manager.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _nerd_font_manager() {
local cur opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts="--cli -c --gui -g --help -h"
opts="--cli -c --gui -g --version -v --list-installed -l --list-available -a --help -h"

if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
Expand Down
6 changes: 6 additions & 0 deletions completions/nerd-font-manager.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
complete -c nerd-font-manager -f
complete -c nerd-font-manager -s c -l cli -d 'Run in CLI mode with fzf (default)'
complete -c nerd-font-manager -s g -l gui -d 'Run in GUI mode with macOS dialogs'
complete -c nerd-font-manager -s v -l version -d 'Show version'
complete -c nerd-font-manager -s l -l list-installed -d 'List installed Nerd Fonts'
complete -c nerd-font-manager -s a -l list-available -d 'List available Nerd Fonts'
complete -c nerd-font-manager -s h -l help -d 'Show help message'

# Also complete for the .sh version
complete -c nerd-font-manager.sh -f
complete -c nerd-font-manager.sh -s c -l cli -d 'Run in CLI mode with fzf (default)'
complete -c nerd-font-manager.sh -s g -l gui -d 'Run in GUI mode with macOS dialogs'
complete -c nerd-font-manager.sh -s v -l version -d 'Show version'
complete -c nerd-font-manager.sh -s l -l list-installed -d 'List installed Nerd Fonts'
complete -c nerd-font-manager.sh -s a -l list-available -d 'List available Nerd Fonts'
complete -c nerd-font-manager.sh -s h -l help -d 'Show help message'
41 changes: 29 additions & 12 deletions nerd-font-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Config
# =============================

VERSION="1.0.3"
LOG_FILE="$HOME/.nerd-font-manager.log"

# Updated favorites (8 fonts)
Expand All @@ -28,15 +29,7 @@ log_event() {
echo "$(date '+%Y-%m-%d %H:%M:%S') | $action | $font" >> "$LOG_FILE"
}

ensure_fonts_tap() {
if ! brew tap | grep -q "^homebrew/cask-fonts$"; then
echo "Adding Homebrew tap: homebrew/cask-fonts"
brew tap homebrew/cask-fonts
fi
}

get_available_fonts() {
ensure_fonts_tap
brew search --casks nerd-font | grep "font-.*-nerd-font"
}

Expand Down Expand Up @@ -348,11 +341,35 @@ main() {
--cli|-c|"")
cli_mode
;;
--version|-v)
echo "nerd-font-manager $VERSION"
;;
--list-installed|-l)
local installed
installed=$(get_installed_fonts)
if [ -z "$installed" ]; then
echo "No Nerd Fonts installed."
else
echo "$installed"
fi
;;
--list-available|-a)
local available
available=$(get_available_fonts)
if [ -z "$available" ]; then
echo "No Nerd Fonts found."
else
echo "$available"
fi
;;
--help|-h)
echo "Usage: $0 [--cli|-c] [--gui|-g] [--help|-h]"
echo " --cli, -c Run in CLI mode with fzf (default)"
echo " --gui, -g Run in GUI mode with macOS dialogs"
echo " --help, -h Show this help message"
echo "Usage: $0 [--cli|-c] [--gui|-g] [--help|-h] [--version|-v]"

Copilot AI Feb 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Usage line in the help text is incomplete. It shows Usage: $0 [--cli|-c] [--gui|-g] [--help|-h] [--version|-v] but does not include the newly added --list-installed|-l and --list-available|-a flags. The usage line should include all available options or use a more generic format to indicate that multiple options are available.

Consider updating to:
Usage: $0 [OPTIONS]
or listing all options:
Usage: $0 [--cli|-c] [--gui|-g] [--version|-v] [--list-installed|-l] [--list-available|-a] [--help|-h]

Suggested change
echo "Usage: $0 [--cli|-c] [--gui|-g] [--help|-h] [--version|-v]"
echo "Usage: $0 [--cli|-c] [--gui|-g] [--version|-v] [--list-installed|-l] [--list-available|-a] [--help|-h]"

Copilot uses AI. Check for mistakes.
echo " --cli, -c Run in CLI mode with fzf (default)"
echo " --gui, -g Run in GUI mode with macOS dialogs"
echo " --version, -v Show version"
echo " --list-installed, -l List installed Nerd Fonts"
echo " --list-available, -a List available Nerd Fonts"
echo " --help, -h Show this help message"
;;
*)
echo "Unknown option: $1"
Expand Down