From mega-code
Signs in to MEGA-Code via GitHub or Google OAuth to obtain an API key. Uses a two-step OAuth flow with browser-based login.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mega-code:login [--provider github|google] [--url https://console.megacode.ai][--provider github|google] [--url https://console.megacode.ai]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Authenticate with MEGA-Code to obtain an API key using a two-step OAuth flow.
Authenticate with MEGA-Code to obtain an API key using a two-step OAuth flow.
MEGA_DIR="$(cd "${CLAUDE_SKILL_DIR}/../.." && pwd)"
export MEGA_CODE_AGENT="claude"
uv run --directory "$MEGA_DIR" python -m mega_code.client.login --step create [--url URL]
Add --provider github for GitHub OAuth instead of Google.
Add --url URL to specify the server (default: https://console.megacode.ai).
Returns a JSON object to stdout:
{"login_url": "https://...", "client_id": "abc-123", "base_url": "https://..."}
On error, the JSON has an error field instead.
After getting the JSON:
login_url to the user — tell them to open it in their browserclient_id and base_url for Step 2uv run --directory "$MEGA_DIR" python -m mega_code.client.login \
--step poll --client-id CLIENT_ID --url BASE_URL
Replace CLIENT_ID and BASE_URL with values from Step 1.
Run this in the background so the user is not blocked.
On success, saves to ~/.local/share/mega-code/.env (stable, version-independent):
MEGA_CODE_API_KEY, MEGA_CODE_CLIENT_MODE=remote, MEGA_CODE_SERVER_URLPolls every 3s, times out after 10 minutes.
Credentials are stored in the stable data directory, not the versioned plugin dir. Do not print the raw API key — mask it.
grep -E "MEGA_CODE_(API_KEY|CLIENT_MODE|SERVER_URL)" "$HOME/.local/share/mega-code/.env" \
| sed -E 's/(MEGA_CODE_API_KEY=.{6}).*/\1***/'
MEGA_CODE_SERVER_URL in ~/.local/share/mega-code/.env.npx claudepluginhub wisdomgraph/mega-code --plugin mega-codeWalks new users through GitHits setup: detects supported tools, installs the MCP server, and handles sign-in/signup with auth verification and recovery.
Provides auth patterns for API keys, OAuth, and token management. Use when implementing or reviewing service authentication and credential handling.
Internal pattern helper for skills that need the user to open a URL in their browser, perform a manual action (regenerate a key, create an OAuth client, copy a webhook secret, etc.), and paste the resulting value back. Standardizes the UX across all skills that require this flow - consistent messaging, browser auto-open, optional format validation, retry on invalid input. Triggered by any add-* skill or rotate-secret when a value must be obtained from an external provider's dashboard. Not meant to be invoked directly by users.