Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat(skill): one-step cross-OS setup and API key management

Theodore Imonigie2989e0e6863e
diff --git a/claude-plugin/omniget/.claude-plugin/plugin.json b/claude-plugin/omniget/.claude-plugin/plugin.json
index 67ac0b9e..eb2646b3 100644
--- a/claude-plugin/omniget/.claude-plugin/plugin.json
+++ b/claude-plugin/omniget/.claude-plugin/plugin.json
@@ -1,11 +1,19 @@
{
"name": "omniget",
- "version": "0.1.0",
+ "version": "0.2.0",
"description": "Fetch media, captions and transcripts from a pasted URL with OmniGet's tooling: yt-dlp, ffmpeg, whisper.cpp or cloud speech APIs.",
"author": {
"name": "Theodore Imonigie"
},
"repository": "https://github.com/tonhowtf/omniget",
"license": "GPL-3.0",
- "keywords": ["omniget", "yt-dlp", "download", "transcript", "whisper", "youtube", "instagram"]
+ "keywords": [
+ "omniget",
+ "yt-dlp",
+ "download",
+ "transcript",
+ "whisper",
+ "youtube",
+ "instagram"
+ ]
}
diff --git a/claude-plugin/omniget/README.md b/claude-plugin/omniget/README.md
index 25af7159..ff52d3e4 100644
--- a/claude-plugin/omniget/README.md
+++ b/claude-plugin/omniget/README.md
@@ -8,14 +8,60 @@ desktop app's own resolver: `omniget-cli` on `PATH` → the binaries OmniGet
manages in its app-data folder → the system `PATH`. Nothing here requires the
desktop app; with `yt-dlp` and `ffmpeg` on `PATH` it works on its own.
-## Install
+## Setup
+
+Three steps. The first is the only one that's always required.
+
+**1. Install the plugin** (in a Claude Code session):
```
/plugin marketplace add /path/to/omniget/claude-plugin
/plugin install omniget
```
-Then run `/omniget:doctor` to see what is available and what to add.
+**2. Install the tools** — one step, on any OS:
+
+```
+/omniget:setup
+```
+
+It checks for `yt-dlp` and `ffmpeg`, and installs whatever is missing after a single
+confirmation (Mac via Homebrew, Windows via winget/scoop). Add `--local` to also set up
+an on-device Whisper engine and model. You can also run it straight from a terminal:
+`bash claude-plugin/omniget/scripts/setup.sh` (add `--yes` to skip the prompt).
+
+If the OmniGet desktop app is installed, `yt-dlp` and `ffmpeg` are already managed by it,
+so this step finds them and installs nothing.
+
+**3. Add a transcription key (optional).** Captions and local Whisper need no key. For
+cloud transcription (more accurate, no model download), add an OpenAI or Gemini key **in
+your own terminal** — the input is hidden and the key never passes through Claude:
+
+```bash
+bash claude-plugin/omniget/scripts/keys.sh set
+```
+
+Then confirm what works:
+
+```bash
+bash claude-plugin/omniget/scripts/keys.sh check
+```
+
+> Only OpenAI and Gemini are supported for transcription. OpenRouter has no
+> speech-to-text endpoint, so it is not offered here.
+
+### Per-OS notes
+
+- **macOS** — needs [Homebrew](https://brew.sh). `/omniget:setup` then installs
+ `yt-dlp`, `ffmpeg`, and (with `--local`) `whisper-cpp` automatically.
+- **Windows** — needs winget (App Installer, from the Microsoft Store) or scoop.
+ `/omniget:setup` installs `yt-dlp` and `ffmpeg`. For local transcription, prefer a
+ cloud key or install whisper.cpp manually; captions and cloud both work out of the box.
+- **Linux** — `/omniget:setup` detects `apt`/`dnf`/`pacman`/`zypper` and runs it (with
+ `sudo`, so it needs a terminal), or prints the exact commands if it can't. Distro
+ `yt-dlp` is often outdated — `pipx install yt-dlp` (what setup uses on apt) stays current.
+ For local Whisper, install `whisper.cpp` from your distro or the upstream release and
+ fetch a model with `scripts/get-model.sh`.
## Commands
@@ -24,6 +70,7 @@ Then run `/omniget:doctor` to see what is available and what to add.
| `/omniget:fetch <url> [--audio] [--quality N]` | Download the media to `~/Downloads/omniget` |
| `/omniget:transcribe <url\|file> [--backend B] [--lang xx] [--summarize]` | Transcribe and optionally summarize |
| `/omniget:research <url> [--backend B]` | Caption + transcript distilled into a Markdown note with `[mm:ss]` references |
+| `/omniget:setup` | Install missing tools for your OS (confirm once) and check your API keys |
| `/omniget:doctor` | Report available tools, models, and keys, plus how to add the missing ones |
The two skills (`omniget-fetch`, `omniget-transcribe`) trigger on their own when a
@@ -42,15 +89,6 @@ media URL is pasted with a request, so the slash commands are optional.
Force one with `--backend local|mlx|gemini|openai|captions`. API keys are read from
the environment or `~/.config/ai-keys.env` and never printed.
-## Getting the pieces
-
-Nothing is installed for you; `/omniget:doctor` prints the commands and you decide.
-
-- **yt-dlp + ffmpeg**: `brew install yt-dlp ffmpeg` (macOS), `winget install yt-dlp.yt-dlp Gyan.FFmpeg` (Windows), your distro's packages (Linux).
-- **local Whisper**: `brew install whisper-cpp`, or the release bundle from `ggml-org/whisper.cpp`. On Apple Silicon `uv tool install mlx-whisper` is faster.
-- **a model**: `scripts/get-model.sh large-v3-turbo-q5_0` (547 MB, SHA-256 verified from `ggerganov/whisper.cpp`). Smaller: `base` (141 MB), `small` (465 MB).
-- **cloud keys**: `export GEMINI_API_KEY=...` / `export OPENAI_API_KEY=...`, or put them in `~/.config/ai-keys.env`.
-
## Environment variables
| Variable | Meaning |
@@ -65,10 +103,11 @@ Nothing is installed for you; `/omniget:doctor` prints the commands and you deci
## Scripts
The skills call `scripts/`; each prints one JSON line on success, progress on stderr:
-`doctor.sh`, `resolve-tools.sh` (shared lookup, sourced by the rest), `fetch.sh`,
-`research.sh`, `transcribe.sh`, `get-model.sh`, plus `srt_tools.py`,
-`gemini_transcribe.py`, `openai_transcribe.sh`. Run the tests with
-`python3 -m unittest discover -s tests`.
+`setup.sh` (cross-OS installer), `keys.sh` (add/test keys), `doctor.sh`,
+`resolve-tools.sh` (shared lookup, sourced by the rest), `fetch.sh`, `research.sh`,
+`transcribe.sh`, `get-model.sh`, plus `srt_tools.py`, `gemini_transcribe.py`,
+`openai_transcribe.sh`. Run the tests with `python3 -m unittest discover -s tests`
+and `bash tests/test_keys.sh`.
## Scope
diff --git a/claude-plugin/omniget/commands/doctor.md b/claude-plugin/omniget/commands/doctor.md
index e4169667..b6af4863 100644
--- a/claude-plugin/omniget/commands/doctor.md
+++ b/claude-plugin/omniget/commands/doctor.md
@@ -3,7 +3,9 @@ description: Check which OmniGet tools, Whisper models and speech API keys this
allowed-tools: ["Bash"]
---
-Run `bash "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh"` and explain the result in plain words:
+Run `bash "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh" --check-keys` and explain the result in plain words:
what works today (captions, local Whisper, Gemini, OpenAI), what is missing, and the exact
command that would add each missing piece. Do not run any install command unless the user
answers yes.
+
+If tools or keys are missing, tell the user they can fix it in one step with `/omniget:setup` (or, for a key, by running `keys.sh set` in their own terminal).
diff --git a/claude-plugin/omniget/commands/setup.md b/claude-plugin/omniget/commands/setup.md
new file mode 100644
index 00000000..b764e3db
--- /dev/null
+++ b/claude-plugin/omniget/commands/setup.md
@@ -0,0 +1,24 @@
+---
+description: "Set up the omniget skill: install missing tools for this OS (confirm once) and check API keys"
+argument-hint: "[--yes] [--local]"
+allowed-tools: ["Bash"]
+---
+
+Set up everything the skill needs, using the `omniget-fetch` / `omniget-transcribe` skills' scripts.
+
+1. Run the setup script with any arguments the user passed:
+ ```bash
+ bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" $ARGUMENTS
+ ```
+ - It checks for `yt-dlp` and `ffmpeg`, lists anything missing, and (on Mac/Windows)
+ installs it after one confirmation. `--yes` skips the prompt; `--local` also sets up
+ a local Whisper engine + model.
+ - It cannot type the user's API keys, and neither can you. It reports which keys work
+ and prints the exact command for the user to run in their own terminal to add one.
+2. Read the output and tell the user, in plain words: what is now installed, which
+ transcription options are available to them (captions always; local if a model is
+ present; Gemini/OpenAI if a key tested "working"), and — only if they have no working
+ key and no local model — that to add a key they should run, in their own terminal:
+ `bash "${CLAUDE_PLUGIN_ROOT}/scripts/keys.sh" set`
+3. Do not ask the user to paste a key to you, and never run `keys.sh set` yourself — it
+ needs their terminal and their keys must not pass through this conversation.
diff --git a/claude-plugin/omniget/scripts/doctor.sh b/claude-plugin/omniget/scripts/doctor.sh
index 77124cdd..5e40b64c 100755
--- a/claude-plugin/omniget/scripts/doctor.sh
+++ b/claude-plugin/omniget/scripts/doctor.sh
@@ -7,7 +7,13 @@ here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$here/resolve-tools.sh"
json=false
-[ "${1:-}" = "--json" ] && json=true
+check_keys=false
+for arg in "$@"; do
+ case "$arg" in
+ --json) json=true ;;
+ --check-keys) check_keys=true ;;
+ esac
+done
rows=""
add_row() { rows="$rows$1 $2 $3
@@ -76,3 +82,8 @@ case "$(og_os)" in
esac
echo " whisper model: $here/get-model.sh large-v3-turbo-q5_0 (547 MB, from ggerganov/whisper.cpp on Hugging Face)"
echo " cloud keys: export GEMINI_API_KEY=... or OPENAI_API_KEY=..., or put them in ~/.config/ai-keys.env"
+
+if $check_keys && ! $json; then
+ echo
+ bash "$here/keys.sh" check
+fi
diff --git a/claude-plugin/omniget/scripts/keys.sh b/claude-plugin/omniget/scripts/keys.sh
new file mode 100755
index 00000000..bf54e66e
--- /dev/null
+++ b/claude-plugin/omniget/scripts/keys.sh
@@ -0,0 +1,125 @@
+#!/usr/bin/env bash
+# Manage and test the transcription API keys the skill uses (OpenAI, Gemini).
+#
+# keys.sh set Interactively add/replace keys in ~/.config/ai-keys.env (hidden
+# input, file chmod 600). Run this in YOUR OWN terminal — it needs
+# a prompt and Claude must never type your keys.
+# keys.sh check Test each configured key against its provider and report
+# working / bad / not-set. Safe for anyone (Claude included) to run;
+# never prints key values.
+#
+# Keys live in ~/.config/ai-keys.env (override with OMNIGET_KEYS_FILE). OpenRouter is
+# not supported: it has no speech-to-text endpoint, so it can't transcribe.
+set -u
+here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+# shellcheck source=resolve-tools.sh
+. "$here/resolve-tools.sh"
+
+KEYS_FILE="${OMNIGET_KEYS_FILE:-$HOME/.config/ai-keys.env}"
+
+# _upsert_env NAME (value read from stdin) — set NAME in KEYS_FILE, preserving every
+# other line. Kept value-on-stdin (never argv) so it stays out of ps and shell history.
+_upsert_env() {
+ local name="$1" value file tmp
+ value="$(cat)"
+ file="$KEYS_FILE"
+ mkdir -p "$(dirname "$file")"
+ [ -f "$file" ] || { : > "$file"; chmod 600 "$file"; }
+ tmp="$(mktemp "${TMPDIR:-/tmp}/omniget-keys.XXXXXX")"
+ awk -v n="$name" 'BEGIN{FS="="} $1!=n && $1!="export "n {print}' "$file" > "$tmp"
+ printf '%s=%s\n' "$name" "$value" >> "$tmp"
+ chmod 600 "$tmp"
+ mv "$tmp" "$file"
+ chmod 600 "$file"
+}
+
+cmd_set() {
+ if [ ! -t 0 ]; then
+ echo "keys.sh set needs an interactive terminal (it hides what you type)." >&2
+ echo "Open your own terminal and run: bash \"$here/keys.sh\" set" >&2
+ return 2
+ fi
+ echo "Add transcription API keys. Leave a field blank to keep the current value."
+ echo "Keys are written to $KEYS_FILE (permissions 600) and never printed."
+ echo
+ og_load_keys
+ local existing
+ for spec in "OpenAI:OPENAI_API_KEY:https://platform.openai.com/api-keys" \
+ "Gemini:GEMINI_API_KEY:https://aistudio.google.com/apikey"; do
+ local label var url
+ label="${spec%%:*}"; var="$(printf '%s' "$spec" | cut -d: -f2)"; url="${spec#*:*:}"
+ existing="$(eval "printf '%s' \"\${$var:-}\"")"
+ if [ -n "$existing" ]; then
+ printf '%s key [already set, press Enter to keep] (%s): ' "$label" "$url"
+ else
+ printf '%s key [%s]: ' "$label" "$url"
+ fi
+ local value=""
+ read -r -s value
+ echo
+ if [ -n "$value" ]; then
+ printf '%s' "$value" | _upsert_env "$var"
+ echo " saved $var"
+ fi
+ done
+ echo
+ cmd_check
+}
+
+# http_status URL [header] — GET, print the numeric HTTP status (000 on network failure).
+_http_status() {
+ local url="$1" header="${2:-}"
+ if [ -n "$header" ]; then
+ curl -s -o /dev/null -w '%{http_code}' -m 20 -H "$header" "$url" 2>/dev/null || echo 000
+ else
+ curl -s -o /dev/null -w '%{http_code}' -m 20 "$url" 2>/dev/null || echo 000
+ fi
+}
+
+_report() { printf ' %-14s %s\n' "$1" "$2"; }
+
+cmd_check() {
+ og_load_keys
+ echo "Transcription API keys ($KEYS_FILE):"
+ local any=false
+
+ if [ -n "${OPENAI_API_KEY:-}" ]; then
+ any=true
+ case "$(_http_status https://api.openai.com/v1/models "Authorization: Bearer $OPENAI_API_KEY")" in
+ 200) _report OpenAI "working" ;;
+ 401|403) _report OpenAI "BAD KEY (rejected)" ;;
+ 000) _report OpenAI "no network / timeout" ;;
+ *) _report OpenAI "unexpected response" ;;
+ esac
+ else
+ _report OpenAI "not set"
+ fi
+
+ if [ -n "${GEMINI_API_KEY:-}" ]; then
+ any=true
+ case "$(_http_status "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY")" in
+ 200) _report Gemini "working" ;;
+ 400|401|403) _report Gemini "BAD KEY (rejected)" ;;
+ 000) _report Gemini "no network / timeout" ;;
+ *) _report Gemini "unexpected response" ;;
+ esac
+ else
+ _report Gemini "not set"
+ fi
+
+ echo
+ if $any; then
+ echo "A 'working' key lets you use --backend openai / --backend gemini for accurate transcription."
+ else
+ echo "No cloud keys set. You can still use platform captions or a local Whisper model,"
+ echo "or add a key with: bash \"$here/keys.sh\" set"
+ fi
+}
+
+if [ "${BASH_SOURCE[0]}" = "$0" ]; then
+ case "${1:-}" in
+ set) cmd_set ;;
+ check|"") cmd_check ;;
+ *) echo "usage: keys.sh set|check" >&2; exit 2 ;;
+ esac
+fi
diff --git a/claude-plugin/omniget/scripts/setup.sh b/claude-plugin/omniget/scripts/setup.sh
new file mode 100755
index 00000000..a5578521
--- /dev/null
+++ b/claude-plugin/omniget/scripts/setup.sh
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+# One-step setup for the omniget skill. Detects the OS, checks for the tools the
+# skill needs, and installs the missing ones after a single confirmation.
+#
+# setup.sh interactive: check, confirm, install, then key setup + check
+# setup.sh --yes install missing tools without the confirmation prompt
+# setup.sh --local also install a local Whisper engine + default model
+# setup.sh --check-only report status and exit; install nothing (safe for Claude)
+#
+# Core tools (needed for everything): yt-dlp, ffmpeg. Cloud transcription then needs
+# only an OpenAI or Gemini key (see keys.sh). Local transcription (--local) additionally
+# wants whisper-cli + a ggml model. Mac (brew) and Windows (winget/scoop) install
+# automatically; Linux runs the distro manager when it can, else prints the commands.
+set -u
+here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+# shellcheck source=resolve-tools.sh
+. "$here/resolve-tools.sh"
+
+ASSUME_YES=false; WANT_LOCAL=false; CHECK_ONLY=false
+for arg in "$@"; do
+ case "$arg" in
+ --yes|-y) ASSUME_YES=true ;;
+ --local) WANT_LOCAL=true ;;
+ --check-only) CHECK_ONLY=true ;;
+ *) echo "setup: unknown flag $arg" >&2; exit 2 ;;
+ esac
+done
+
+OS="$(og_os)"
+PM=""
+detect_pm() {
+ case "$OS" in
+ mac) command -v brew >/dev/null 2>&1 && PM=brew ;;
+ windows) for c in winget scoop choco; do command -v "$c" >/dev/null 2>&1 && { PM="$c"; break; }; done ;;
+ linux) for c in apt-get dnf pacman zypper; do command -v "$c" >/dev/null 2>&1 && { PM="$c"; break; }; done ;;
+ esac
+}
+detect_pm
+
+# install_cmd TOOL -> echoes the shell command to install TOOL with the detected PM,
+# or empty if we don't have a recipe for this OS/PM.
+install_cmd() {
+ local tool="$1"
+ case "$tool:$PM" in
+ yt-dlp:brew) echo "brew install yt-dlp" ;;
+ yt-dlp:winget) echo "winget install --silent --accept-package-agreements --accept-source-agreements yt-dlp.yt-dlp" ;;
+ yt-dlp:scoop) echo "scoop install yt-dlp" ;;
+ yt-dlp:choco) echo "choco install -y yt-dlp" ;;
+ yt-dlp:apt-get) echo "sudo apt-get update && sudo apt-get install -y pipx && pipx install yt-dlp" ;;
+ yt-dlp:dnf) echo "sudo dnf install -y yt-dlp" ;;
+ yt-dlp:pacman) echo "sudo pacman -S --noconfirm yt-dlp" ;;
+ yt-dlp:zypper) echo "sudo zypper install -y yt-dlp" ;;
+ ffmpeg:brew) echo "brew install ffmpeg" ;;
+ ffmpeg:winget) echo "winget install --silent --accept-package-agreements --accept-source-agreements Gyan.FFmpeg" ;;
+ ffmpeg:scoop) echo "scoop install ffmpeg" ;;
+ ffmpeg:choco) echo "choco install -y ffmpeg" ;;
+ ffmpeg:apt-get) echo "sudo apt-get update && sudo apt-get install -y ffmpeg" ;;
+ ffmpeg:dnf) echo "sudo dnf install -y ffmpeg" ;;
+ ffmpeg:pacman) echo "sudo pacman -S --noconfirm ffmpeg" ;;
+ ffmpeg:zypper) echo "sudo zypper install -y ffmpeg" ;;
+ whisper-cli:brew) echo "brew install whisper-cpp" ;;
+ *) echo "" ;;
+ esac
+}
+
+missing=()
+plan=()
+note_missing() {
+ local tool="$1"
+ og_find_tool "$tool" >/dev/null 2>&1 && return
+ missing+=("$tool")
+ local cmd; cmd="$(install_cmd "$tool")"
+ [ -n "$cmd" ] && plan+=("$cmd") || plan+=("# no auto-install recipe for $tool on $OS — see README")
+}
+
+echo "OmniGet skill setup — $OS${PM:+ (package manager: $PM)}"
+echo
+
+note_missing yt-dlp
+note_missing ffmpeg
+$WANT_LOCAL && note_missing whisper-cli
+
+if [ ${#missing[@]} -eq 0 ]; then
+ echo "Core tools present:"
+ for t in yt-dlp ffmpeg $([ "$WANT_LOCAL" = true ] && echo whisper-cli); do
+ printf ' %-12s %s\n' "$t" "$(og_tool_path "$t")"
+ done
+else
+ echo "Missing: ${missing[*]}"
+ if [ -z "$PM" ]; then
+ echo
+ case "$OS" in
+ mac) echo "Homebrew isn't installed. Install it first (one line), then re-run setup:"; echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' ;;
+ windows) echo "No winget/scoop/choco found. Install winget (App Installer from the Microsoft Store) or scoop, then re-run." ;;
+ linux) echo "No supported package manager detected. Install yt-dlp and ffmpeg via your distro, then re-run." ;;
+ esac
+ else
+ echo "Planned install commands:"
+ for c in "${plan[@]}"; do echo " $c"; done
+ fi
+fi
+echo
+
+run_installs() {
+ [ ${#missing[@]} -eq 0 ] && return 0
+ [ -z "$PM" ] && { echo "Can't auto-install without a package manager (see above)."; return 1; }
+ local i=0 tool cmd rc=0
+ for tool in "${missing[@]}"; do
+ cmd="${plan[$i]}"; i=$((i+1))
+ case "$cmd" in \#*) echo "Skipping $tool: $cmd"; continue ;; esac
+ echo ">>> $cmd"
+ if printf '%s' "$cmd" | grep -q 'sudo ' && [ ! -t 0 ]; then
+ echo " needs sudo and there's no terminal here — run this line yourself:"
+ echo " $cmd"
+ rc=1; continue
+ fi
+ if bash -c "$cmd"; then
+ og_find_tool "$tool" >/dev/null 2>&1 && echo " ok: $tool -> $(og_tool_path "$tool")" || echo " installed, but $tool still not on PATH — open a new shell and re-check"
+ else
+ echo " failed to install $tool"; rc=1
+ fi
+ done
+ return $rc
+}
+
+if [ ${#missing[@]} -gt 0 ] && [ "$CHECK_ONLY" != true ]; then
+ do_install=false
+ if $ASSUME_YES; then
+ do_install=true
+ elif [ -t 0 ]; then
+ printf 'Install the %d missing tool(s) now? [y/N] ' "${#missing[@]}"
+ read -r ans
+ case "$ans" in y|Y|yes|YES) do_install=true ;; esac
+ else
+ echo "Re-run with --yes to install, or run the commands above yourself."
+ fi
+ $do_install && run_installs
+ echo
+fi
+
+if $WANT_LOCAL && og_find_tool whisper-cli >/dev/null 2>&1 && ! og_whisper_model >/dev/null 2>&1; then
+ echo "Local Whisper is installed but has no model."
+ if [ "$CHECK_ONLY" != true ] && { $ASSUME_YES || [ -t 0 ]; }; then
+ if $ASSUME_YES || { printf 'Download the default model (large-v3-turbo-q5_0, 547 MB)? [y/N] '; read -r m; case "$m" in y|Y|yes|YES) true ;; *) false ;; esac; }; then
+ "$here/get-model.sh" large-v3-turbo-q5_0 && echo " model ready"
+ fi
+ else
+ echo " get one with: bash \"$here/get-model.sh\" large-v3-turbo-q5_0"
+ fi
+ echo
+fi
+
+# Transcription keys: report status, and point at the interactive setter (never run by Claude).
+echo "== Transcription API keys =="
+bash "$here/keys.sh" check
+echo
+echo "To add or change a key, run this in YOUR terminal (input is hidden, keys never leave your machine):"
+echo " bash \"$here/keys.sh\" set"
+echo
+echo "Setup check complete. Run bash \"$here/doctor.sh\" any time for the full picture."
diff --git a/claude-plugin/omniget/skills/omniget-fetch/SKILL.md b/claude-plugin/omniget/skills/omniget-fetch/SKILL.md
index 4c2ff5a6..e6bd7209 100644
--- a/claude-plugin/omniget/skills/omniget-fetch/SKILL.md
+++ b/claude-plugin/omniget/skills/omniget-fetch/SKILL.md
@@ -28,11 +28,23 @@ Scripts live in `${CLAUDE_PLUGIN_ROOT}/scripts/`.
3. If the user only wants to know what the media says, use the `omniget-transcribe` skill
instead of downloading video.
+## First run / missing tools
+
+If `fetch.sh` reports `yt-dlp not found` (or a fresh machine has nothing set up),
+do not hand the user raw install commands. Offer one step:
+```bash
+bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh"
+```
+It detects the OS, lists what is missing, and installs it after a single confirmation
+(Mac via brew, Windows via winget/scoop; Linux runs the distro manager when it can, else
+prints the commands). Pass `--yes` to skip the prompt. If OmniGet (the desktop app) is
+installed, `yt-dlp` and `ffmpeg` are already managed and nothing needs installing.
+
## When something fails
Run the doctor first, then act on what it reports:
```bash
-bash "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh"
+bash "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh" --check-keys
```
| Symptom in stderr | Meaning | Action |
diff --git a/claude-plugin/omniget/skills/omniget-transcribe/SKILL.md b/claude-plugin/omniget/skills/omniget-transcribe/SKILL.md
index bd7d7596..0109b05f 100644
--- a/claude-plugin/omniget/skills/omniget-transcribe/SKILL.md
+++ b/claude-plugin/omniget/skills/omniget-transcribe/SKILL.md
@@ -45,14 +45,14 @@ Choose deliberately when the user states a preference:
- Known language: pass `--lang en` (or `pt`, `es`, ...) to every backend; it speeds up and sharpens results.
- Recording longer than two hours: say so and confirm before a cloud backend runs.
-Keys are read from the environment or `~/.config/ai-keys.env`. Never print them.
+Keys are read from the environment or `~/.config/ai-keys.env`. Never print them. To add one, the user runs `bash "${CLAUDE_PLUGIN_ROOT}/scripts/keys.sh" set` in their own terminal (hidden input); never ask them to paste a key here. `keys.sh check` (or `doctor.sh --check-keys`) reports which keys work.
## Exit codes and what to do
| Exit | Meaning | Action |
|---|---|---|
| 3 | `--backend captions` and the platform has none | rerun with `--backend auto` |
-| 4 | no local engine and no key | run `doctor.sh`, show the install lines, ask before installing; `get-model.sh large-v3-turbo-q5_0` fetches the model (547 MB) |
+| 4 | no local engine and no key | offer `setup.sh` (installs tools, confirm once) and tell the user to add a key with `keys.sh set` in their own terminal; `get-model.sh large-v3-turbo-q5_0` fetches a local model (547 MB) |
| 1 | tool missing or download failed | run `doctor.sh`; for login errors see the `omniget-fetch` skill's error table |
## Rules
diff --git a/claude-plugin/omniget/tests/test_keys.sh b/claude-plugin/omniget/tests/test_keys.sh
new file mode 100755
index 00000000..6424b7fb
--- /dev/null
+++ b/claude-plugin/omniget/tests/test_keys.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+# Tests for keys.sh _upsert_env: it must set/replace one var while preserving the rest.
+set -u
+here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+fail=0
+check() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 — expected [$3], got [$2]"; fail=1; fi; }
+
+tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
+export OMNIGET_KEYS_FILE="$tmp/ai-keys.env"
+# seed with unrelated keys that must survive
+printf 'REPLICATE_API_KEY=keep-me\nANTHROPIC_API_KEY=also-keep\n' > "$OMNIGET_KEYS_FILE"
+
+# shellcheck source=../scripts/keys.sh
+. "$here/../scripts/keys.sh"
+
+printf 'sk-openai-1' | _upsert_env OPENAI_API_KEY
+printf 'gem-1' | _upsert_env GEMINI_API_KEY
+printf 'sk-openai-2' | _upsert_env OPENAI_API_KEY # replace, not append
+
+get() { grep -E "^$1=" "$OMNIGET_KEYS_FILE" | tail -1 | cut -d= -f2-; }
+count() { grep -cE "^$1=" "$OMNIGET_KEYS_FILE"; }
+
+check "unrelated key preserved (replicate)" "$(get REPLICATE_API_KEY)" "keep-me"
+check "unrelated key preserved (anthropic)" "$(get ANTHROPIC_API_KEY)" "also-keep"
+check "openai replaced not duplicated" "$(count OPENAI_API_KEY)" "1"
+check "openai has latest value" "$(get OPENAI_API_KEY)" "sk-openai-2"
+check "gemini set" "$(get GEMINI_API_KEY)" "gem-1"
+perm="$(stat -f '%Lp' "$OMNIGET_KEYS_FILE" 2>/dev/null || stat -c '%a' "$OMNIGET_KEYS_FILE")"
+check "keys file is chmod 600" "$perm" "600"
+
+exit $fail