‹ 首页

credential-switch

@indranilbanerjee · 收录于 1 周前

Switch brand credentials. Use when: activating the correct API keys for MCP servers in multi-client workflows.

适合你,如果需要在多个MCP服务器间切换API密钥

/ 下载安装
credential-switch.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add indranilbanerjee/digital-marketing-pro/credential-switch
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- indranilbanerjee/digital-marketing-pro/credential-switch
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify indranilbanerjee/digital-marketing-pro/credential-switch
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
220GitHub stars
~1.5K上下文体积 · 单文件
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · ba1468e

/digital-marketing-pro:credential-switch

Purpose

Switch the active credential profile to a different brand for multi-client agency management. Validates all platform connections and reports which services are available for the target brand. Ensures the correct API keys, tokens, and environment variables are active before executing any platform operations — preventing cross-client data leakage, misrouted ad spend, or accidental operations on the wrong account.

Input Required

The user must provide (or will be prompted for):

  • Target brand slug: The brand slug to switch credentials to — must match a configured brand in ~/.claude-marketing/brands/ with a corresponding credential profile in ~/.claude-marketing/credentials/
  • Validation depth (optional): One of:
  • Quick: Check that env vars exist and are non-empty — fast, no API calls
  • Full: Test live API connectivity and token validity for each configured platform — slower but confirms actual access
  • Defaults to quick for faster switching
  • Force switch (optional): If the target profile has missing or expired credentials, whether to switch anyway with warnings or abort entirely — defaults to abort on missing critical credentials (ad platforms, analytics)
  • Reason (optional): Brief note for the switch log — helps with audit trail when multiple team members share the system (e.g., "Starting monthly reporting for Acme Corp")
  • Platforms to validate (optional): Specific platforms to validate instead of all — useful when you only need certain integrations for the current task (e.g., "google-ads, google-analytics" for a paid media session)
Process
  1. Check current context: Read ~/.claude-marketing/brands/_active-brand.json to identify the currently active brand, and ~/.claude-marketing/credentials/_active-profile.json for the current credential profile. Display current state before switching.
  2. Verify target brand exists: Confirm the target brand slug has a configured profile at ~/.claude-marketing/brands/{slug}/profile.json. If not found, list all available brands from ~/.claude-marketing/brands/ and suggest /digital-marketing-pro:brand-setup for new brands or /digital-marketing-pro:client-onboarding for new client setup
  3. Check credential profile exists: Run credential-manager.py --action get-profile --id {slug} to verify a credential profile exists for the target brand. If missing, explain how to create one with the required platform credentials and abort with setup instructions
  4. Validate credential profile: Run credential-manager.py --action validate-profile --id {slug} to check each platform's credentials — verify API keys are present and non-empty, OAuth tokens are not expired, and required environment variables are set for all MCP servers configured in .mcp.json
  5. Present validation summary: Display a platform-by-platform validation report — for each configured service:
  6. Platform name and type (ad platform, analytics, CRM, social, email)
  7. Credential status: configured / not configured / expired
  8. Required env vars: set or missing (with specific variable names)
  9. Token expiry date if applicable
  10. Last successful connection timestamp if available
  11. Check for active operations: Before switching, scan execution-tracker.py --action list --status in-progress for any in-progress executions, scheduled deliveries, or queued operations running under the current profile that could be disrupted by a context switch. Warn with specific operation details if any are found
  12. Confirm switch intent: If validation passed cleanly, proceed automatically. If warnings exist (missing non-critical credentials, expiring tokens within 7 days), present the warnings and ask for confirmation. If critical credentials are missing and force is not set, abort with specific guidance on what needs to be configured
  13. Execute credential switch: Run credential-manager.py --action switch-profile --id {slug} to activate the target brand's credential profile. This updates the active profile reference and loads the corresponding environment variables for all MCP servers
  14. Switch active brand: Update ~/.claude-marketing/brands/_active-brand.json to set the target brand as the active brand context — ensuring brand profile and credentials are aligned so all subsequent commands use the correct client
  15. Verify switch success: Re-read both _active-brand.json and _active-profile.json to confirm the switch completed successfully. If full validation was requested, run a quick connectivity test on critical platforms (Google Ads, Analytics, CRM) to confirm live access works
  16. Log the switch: Record the switch event with timestamp, previous brand, new brand, validation result, any warnings, and reason (if provided) in ~/.claude-marketing/credentials/switch-log.json for audit trail purposes
  17. Report new active context: Display the new active brand name, slug, industry, business model, configured platforms with their validation status, and any warnings for missing or expiring credentials. Suggest relevant next steps based on common post-switch workflows
Output

A credential switch confirmation containing:

  • Previous context: Brand name, slug, and credential profile that was active before the switch — so the user can verify what they switched away from and return if needed
  • New active context: Brand name, slug, industry, business model, primary marketing channels, engagement type, and contract status now active
  • Platform validation report: Per-platform status table — platform name, configured (yes/no), env vars (set/missing with specific var names listed), token status (valid/expired/N/A with expiry date if applicable), and connectivity result (verified/not tested/failed with error detail)
  • Missing credential warnings: Any platforms configured in the brand profile but missing API keys or tokens, with specific instructions for adding them — which env var to set, where to obtain the credential, and whether the platform is critical or optional for current workflows
  • Expiring credential alerts: Any tokens or keys approaching expiration within 7 days, with renewal instructions, urgency level (informational/action-needed/critical), and impact if not renewed
  • Active operations check: Confirmation that no in-progress operations were disrupted, or detailed warnings listing any operations that may need attention after the switch
  • Switch log entry: Timestamp, previous brand, new brand, validation summary, warnings count, and reason — recorded for audit and troubleshooting purposes
  • Next steps: Confirmation message — "All operations will now use [brand_name]'s credentials. Configured platforms: [list]. Use /digital-marketing-pro:agency-dashboard to see this client's status, /digital-marketing-pro:client-report to generate a performance report, or /digital-marketing-pro:credential-switch again to return to the previous brand."
Agents Used
  • agency-operations — Credential profile management, platform validation logic, active operations safety check, switch execution, context alignment verification, audit logging, and post-switch recommendation engine
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。