/ai-universe:ai-universe-authfrom ai-universe
Authenticates with the AI Universe MCP server to enable multi-model commands like /secondo. Handles token retrieval and refresh for Firebase projects.
Ships in ai-universe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill provides authentication setup for the AI Universe MCP server, which powers the /secondo command for multi-model AI feedback.
Use existing credentials and their supported refresh path first. Follow the shared credential and isolated-browser owners before starting an interactive login; this recipe does not authorize new access, personal-browser use or credential rotation. Capture token output in a variable, never in logs or chat.
Before any authentication command, use the host's already loaded nvm setup to resolve its installed Node 22. If nvm or Node 22 is unavailable, report that prerequisite; do not use a different major version or change persistent defaults.
AUTH_NODE="$(nvm which 22)" || exit 1
[ -x "$AUTH_NODE" ] || exit 1
case "$("$AUTH_NODE" --version)" in v22.*) ;; *) exit 1 ;; esac
Use this same verified AUTH_NODE executable for every command below.
IMPORTANT: Always look for auth-cli.mjs in these locations (in order of preference):
| Location | Description | Has node_modules |
|---|---|---|
scripts/auth-cli.mjs | Project-local (recommended) | Needs parent project |
${CLAUDE_HOME:-$HOME/.claude}/scripts/auth-cli.mjs | User-global fallback | Yes (if installed) |
$AI_UNIVERSE_ROOT/scripts/auth-cli.mjs | Source of truth (set AI_UNIVERSE_ROOT to your AI Universe checkout) | Yes |
To run the script, use a directory that has node_modules with express installed:
# From the AI Universe checkout (always works)
cd "${AI_UNIVERSE_ROOT:?AI_UNIVERSE_ROOT not configured: path to the AI Universe checkout}" && "$AUTH_NODE" scripts/auth-cli.mjs status
# Or from ${CLAUDE_HOME:-$HOME/.claude} if deps installed
"$AUTH_NODE" ${CLAUDE_HOME:-$HOME/.claude}/scripts/auth-cli.mjs status
The script supports two Firebase projects. Use the correct one for your use case:
| Project | Firebase ID | Use Case | Command |
|---|---|---|---|
| AI Universe | auth-cli.mjs default project | /secondo, multi-model synthesis | "$AUTH_NODE" scripts/auth-cli.mjs token (default) |
| Another Firebase app | <firebase-project-id> | That app's auth | "$AUTH_NODE" scripts/auth-cli.mjs token --project <firebase-project-id> |
/secondo command for multi-model second opinions# Use an existing verified token or supported silent refresh immediately.
# Interactive login is only an authorized recovery step when needed.
TOKEN=$("$AUTH_NODE" scripts/auth-cli.mjs token)
<firebase-project-id>)worldai-auth skill from the worldarchitect plugin# Use an existing verified token or supported silent refresh immediately.
TOKEN=$("$AUTH_NODE" scripts/auth-cli.mjs token --project <firebase-project-id>)
AUTH_NODE abovenpm install express)Use existing credentials and their supported refresh path first. Before an interactive login, complete both required credential probes and follow the browser owner for explicit authority and a verified task-owned isolated browser. If those conditions are not met, report the exact dependency without starting login.
# AI Universe (default) - for /secondo
"$AUTH_NODE" scripts/auth-cli.mjs login
# Another Firebase app
"$AUTH_NODE" scripts/auth-cli.mjs login --project <firebase-project-id>
What happens:
~/.ai-universe/auth-token-<project-id>.json"$AUTH_NODE" scripts/auth-cli.mjs status
Output includes:
# Get token (auto-refreshes if expired, does nothing if valid)
TOKEN=$("$AUTH_NODE" scripts/auth-cli.mjs token)
test -n "$TOKEN" && printf 'Token available\n'
# For another Firebase app
TOKEN=$("$AUTH_NODE" scripts/auth-cli.mjs token --project <firebase-project-id>)
Token Behavior:
This enables seamless 30+ day sessions.
"$AUTH_NODE" scripts/auth-cli.mjs refresh
"$AUTH_NODE" scripts/auth-cli.mjs test
"$AUTH_NODE" scripts/auth-cli.mjs logout
# Option 1: Run from the AI Universe checkout
cd "$AI_UNIVERSE_ROOT" && "$AUTH_NODE" scripts/auth-cli.mjs status
# Option 2: Install deps in ${CLAUDE_HOME:-$HOME/.claude}
cd "${CLAUDE_HOME:-$HOME/.claude}" && npm install express
# Option 3: Copy working script
cp "$AI_UNIVERSE_ROOT/scripts/auth-cli.mjs" ${CLAUDE_HOME:-$HOME/.claude}/scripts/
This means the token was created for a different Firebase project than you're trying to use.
# Check which project your token is for
"$AUTH_NODE" scripts/auth-cli.mjs status
# Look for "Firebase Project:" line
# Before recovery login: verify Keychain presence and run a cheap non-UI
# credential probe for the intended project; try supported existing credentials.
# Login is only a remaining recovery step after both probes fail.
# Follow the browser owner: an interactive login needs explicit authority
# and a verified task-owned isolated browser, never personal Chrome.
# Then, if authorized, log in for the correct project:
"$AUTH_NODE" scripts/auth-cli.mjs login # AI Universe
"$AUTH_NODE" scripts/auth-cli.mjs login --project <firebase-project-id> # Another Firebase app
Inspect the listener with lsof -nP -iTCP:9005 -sTCP:LISTEN, then inspect its
PID and parent command. A port match does not establish ownership. Stop only
the verified callback process owned by this task through its supported shutdown
path; leave unrelated listeners running and report the exact port conflict.
# Auto-refresh (silent)
TOKEN=$("$AUTH_NODE" scripts/auth-cli.mjs token)
# Or manual refresh
"$AUTH_NODE" scripts/auth-cli.mjs refresh
# If refresh fails, first verify Keychain presence and a cheap non-UI
# credential probe; exhaust supported existing credential routes.
# Only after both probes fail, use the browser owner recovery procedure.
# Interactive login requires explicit authority and a verified task-owned
# isolated browser. If that boundary is unmet, report the exact dependency.
# When those conditions are met:
"$AUTH_NODE" scripts/auth-cli.mjs login
~/.ai-universe/auth-token-<project-id>.json (separate file per project)| Command | Project | Authentication |
|---|---|---|
/secondo | AI Universe | "$AUTH_NODE" scripts/auth-cli.mjs token (default) |
| Another app's API | <firebase-project-id> | "$AUTH_NODE" scripts/auth-cli.mjs token --project <firebase-project-id> |
The source of truth for auth-cli.mjs is $AI_UNIVERSE_ROOT/scripts/auth-cli.mjs.
To sync to other locations:
# Sync to project .claude/scripts/
cp "$AI_UNIVERSE_ROOT/scripts/auth-cli.mjs" .claude/scripts/
# Sync to user ${CLAUDE_HOME:-$HOME/.claude}/scripts/
cp "$AI_UNIVERSE_ROOT/scripts/auth-cli.mjs" ${CLAUDE_HOME:-$HOME/.claude}/scripts/
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jleechanorg/jleechan-skills --plugin ai-universe4 skills in this plugin