From febf2c429c40f5120a2409b0e12b47076cd3d5e5 Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Mon, 6 Apr 2026 06:24:38 -0700 Subject: [PATCH] feat: add `--visual`, `--visual-sensitivity`, and `--visual-fps` flags to shell completions - Add `--visual` flag for OCR and FFmpeg video data extraction - Add `--visual-sensitivity` option for FFmpeg scene detection tolerance - Add `--visual-fps` option for fixed frame-per-second extraction - Update zsh completions with three new visual flags - Update bash completions opts list with visual flags - Add visual flags to bash simple-argument completion case - Update fish completions with visual flag descriptions --- completions/_fabric | 3 +++ completions/fabric.bash | 4 ++-- completions/fabric.fish | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/completions/_fabric b/completions/_fabric index 5f9d71fa..b979b83a 100644 --- a/completions/_fabric +++ b/completions/_fabric @@ -100,6 +100,9 @@ _fabric() { '(--playlist)--playlist[Prefer playlist over video if both ids are present in the URL]' \ '(--transcript)--transcript[Grab transcript from YouTube video and send to chat]' \ '(--transcript-with-timestamps)--transcript-with-timestamps[Grab transcript from YouTube video with timestamps]' \ + '(--visual)--visual[Extract visual data from video using OCR and FFmpeg]' \ + '(--visual-sensitivity)--visual-sensitivity[Tolerance for FFmpeg scene detection (0.0 - 1.0)]:visual sensitivity:' \ + '(--visual-fps)--visual-fps[Extract a specific number of frames per second instead of using scene detection]:frames per second:' \ '(--comments)--comments[Grab comments from YouTube video and send to chat]' \ '(--metadata)--metadata[Output video metadata]' \ '(--yt-dlp-args)--yt-dlp-args[Additional arguments to pass to yt-dlp]:yt-dlp args:' \ diff --git a/completions/fabric.bash b/completions/fabric.bash index 30e6f7ee..fa05d612 100644 --- a/completions/fabric.bash +++ b/completions/fabric.bash @@ -17,7 +17,7 @@ _fabric() { fi # Define all possible options/flags - local opts="--pattern -p --variable -v --context -C --session --attachment -a --setup -S --temperature -t --topp -T --stream -s --presencepenalty -P --raw -r --frequencypenalty -F --listpatterns -l --listmodels -L --listcontexts -x --listsessions -X --updatepatterns -U --copy -c --model -m --vendor -V --modelContextLength --output -o --output-session --latest -n --changeDefaultModel -d --youtube -y --playlist --transcript --transcript-with-timestamps --comments --metadata --yt-dlp-args --language -g --scrape_url -u --scrape_question -q --seed -e --thinking --wipecontext -w --wipesession -W --printcontext --printsession --readability --input-has-vars --no-variable-replacement --dry-run --serve --serveOllama --address --api-key --config --search --search-location --image-file --image-size --image-quality --image-compression --image-background --suppress-think --think-start-tag --think-end-tag --disable-responses-api --transcribe-file --transcribe-model --split-media-file --voice --list-gemini-voices --notification --notification-command --debug --version --listextensions --addextension --rmextension --strategy --liststrategies --listvendors --shell-complete-list --help -h" + local opts="--pattern -p --variable -v --context -C --session --attachment -a --setup -S --temperature -t --topp -T --stream -s --presencepenalty -P --raw -r --frequencypenalty -F --listpatterns -l --listmodels -L --listcontexts -x --listsessions -X --updatepatterns -U --copy -c --model -m --vendor -V --modelContextLength --output -o --output-session --latest -n --changeDefaultModel -d --youtube -y --playlist --transcript --transcript-with-timestamps --visual --visual-sensitivity --visual-fps --comments --metadata --yt-dlp-args --language -g --scrape_url -u --scrape_question -q --seed -e --thinking --wipecontext -w --wipesession -W --printcontext --printsession --readability --input-has-vars --no-variable-replacement --dry-run --serve --serveOllama --address --api-key --config --search --search-location --image-file --image-size --image-quality --image-compression --image-background --suppress-think --think-start-tag --think-end-tag --disable-responses-api --transcribe-file --transcribe-model --split-media-file --voice --list-gemini-voices --notification --notification-command --debug --version --listextensions --addextension --rmextension --strategy --liststrategies --listvendors --shell-complete-list --help -h" # Helper function for dynamic completions _fabric_get_list() { @@ -105,7 +105,7 @@ _fabric() { return 0 ;; # Options requiring simple arguments (no specific completion logic here) - -v | --variable | -t | --temperature | -T | --topp | -P | --presencepenalty | -F | --frequencypenalty | --modelContextLength | -n | --latest | -y | --youtube | --yt-dlp-args | -g | --language | -u | --scrape_url | -q | --scrape_question | -e | --seed | --address | --api-key | --search-location | --image-compression | --think-start-tag | --think-end-tag | --notification-command) + -v | --variable | -t | --temperature | -T | --topp | -P | --presencepenalty | -F | --frequencypenalty | --modelContextLength | -n | --latest | -y | --youtube | --visual-sensitivity | --visual-fps | --yt-dlp-args | -g | --language | -u | --scrape_url | -q | --scrape_question | -e | --seed | --address | --api-key | --search-location | --image-compression | --think-start-tag | --think-end-tag | --notification-command) # No specific completion suggestions, user types the value return 0 ;; diff --git a/completions/fabric.fish b/completions/fabric.fish index 8ff3c7ac..caa0e408 100755 --- a/completions/fabric.fish +++ b/completions/fabric.fish @@ -73,6 +73,8 @@ function __fabric_register_completions complete -c $cmd -s o -l output -d "Output to file" -r complete -c $cmd -s n -l latest -d "Number of latest patterns to list (default: 0)" complete -c $cmd -s y -l youtube -d "YouTube video or play list URL to grab transcript, comments from it" + complete -c $cmd -l visual-sensitivity -d "Tolerance for FFmpeg scene detection (0.0 - 1.0)" + complete -c $cmd -l visual-fps -d "Extract a specific number of frames per second instead of using scene detection" complete -c $cmd -s g -l language -d "Specify the Language Code for the chat, e.g. -g=en -g=zh" complete -c $cmd -s u -l scrape_url -d "Scrape website URL to markdown using Jina AI" complete -c $cmd -s q -l scrape_question -d "Search question using Jina AI" @@ -117,6 +119,7 @@ function __fabric_register_completions complete -c $cmd -l playlist -d "Prefer playlist over video if both ids are present in the URL" complete -c $cmd -l transcript -d "Grab transcript from YouTube video and send to chat" complete -c $cmd -l transcript-with-timestamps -d "Grab transcript from YouTube video with timestamps" + complete -c $cmd -l visual -d "Extract visual data from video using OCR and FFmpeg" complete -c $cmd -l comments -d "Grab comments from YouTube video and send to chat" complete -c $cmd -l metadata -d "Output video metadata" complete -c $cmd -l yt-dlp-args -d "Additional arguments to pass to yt-dlp (e.g. '--cookies-from-browser brave')"