Loading...
Loading...
Replace old API keys with new ones across multiple configuration files, keystores, and logs. Use this skill when the user asks to rotate, replace, update, or refresh API keys across their system. Supports .env files, JSON keystores, and log files. Automatically creates backups before making changes.
npx skill4agent add dalehurley/phpbot rotate-api-keys| Parameter | Required | Description | Example |
|---|---|---|---|
| Yes | The API key to be replaced (the old or compromised key) | sk-old-abc123 |
| Yes | The new API key to replace the old one with | sk-new-xyz789 |
| No | Directories to search for .env files and keystores (defaults to home directory and common project paths) | ~/Herd ~/Code |
keys.jsonfind {{SEARCH_PATH}} -name "*.env" -o -name "keys.json" -o -name "*.log"sed -i.bak "s|{{OLD_KEY}}|{{NEW_KEY}}|g" {{FILE_PATH}}grep -o "sk-[a-zA-Z0-9-]*" {{FILE_PATH}} | head -1-i.bakrotate my API key across all my projects and config files
replace my old OpenAI key with a new one in all .env files
update this API key everywhere it appears on my system
rotate my compromised API key across all config files and keystores
refresh my API credentials across my development environment