Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Check and configure SurgePix environment before first use. Use when the user first invokes any SurgePix skill, says "setup surgepix", or when SURGEPIX_API_KEY is missing and a SurgePix operation fails.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 169% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 11% | 0% |
Pre-flight check and guided setup. Run this before any other SurgePix skill.
All SurgePix skills share one portable config: a .env file. Scripts auto-load it regardless of which agent you use (Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, etc.).
Reply to the user in the same language they used in their request. All other SurgePix skills follow the same rule for both agent replies and generated on-image text.
SURGEPIX_API_KEY or SURGEPIX_BASE_URLbashnode "<skills-dir>/surgepix-setup/scripts/check_env.mjs"
Configured (exit 0):
json{"ok":true,"configured":true,"sources":["/path/to/.env"],"baseUrl":"https://..."}
→ Tell user env is ready, proceed with the original task.
Not configured (exit 1):
json{"ok":true,"configured":false,"missing":["SURGEPIX_API_KEY","SURGEPIX_BASE_URL"],"hint":"..."}
→ Continue to Step 2.
> SurgePix is not configured. > > How to get an API Key: > 1. Sign in to SurgePix Console > 2. Go to Account Settings → API Keys > 3. Create a new key and copy the Bearer Token > > How to configure (do this yourself — do not paste secrets into chat): > Create a .env file in the project root with: > > > SURGEPIX_API_KEY=<your-token> > SURGEPIX_BASE_URL=https://api.surgepix.ai/api > > > For local/test environments, set SURGEPIX_BASE_URL to the test API host instead. > Or export the same variables in your shell. > > Tell the agent when you are done so it can re-check.
NEVER ask the user to paste their API key into the chat. NEVER accept an API key from the user and write it into .env (or any file) yourself. NEVER interpolate a user-provided key into shell commands, heredocs, or tool arguments. NEVER invent or hardcode SURGEPIX_BASE_URL in scripts — the user/agent must set it in .env or the shell.
After the user confirms configuration, re-run:
bashnode "<skills-dir>/surgepix-setup/scripts/check_env.mjs"
Must exit 0. Then proceed with the user's original task.
If still not configured, show missing from the JSON and remind them of Step 2 — do not collect secrets via chat.
Both SURGEPIX_API_KEY and SURGEPIX_BASE_URL are required. Scripts do not invent a default base URL.
bashgrep -q "^\.env$" .gitignore 2>/dev/null || echo ".env" >> .gitignore
export SURGEPIX_API_KEY=... / SURGEPIX_BASE_URL=...) — highest priority.env in cwd or parent directories — recommended, portable.claude/settings.local.json — Claude Code optional fallback~/.claude/settings.local.json — Claude Code global fallback.env to git.env as primary config (not platform-specific files)SURGEPIX_API_KEY and SURGEPIX_BASE_URL via check_env.mjsOther measured skills in the registry, with their headline benchmark lift.