nexus auth
Manage authentication for Nexus. An API key is required to use Nexus MCP tools.
Usage
bash
nexus auth <command>Commands
| Command | Description |
|---|---|
login | Authenticate with Nexus and get an API key |
logout | Remove stored authentication |
status | Check authentication status |
Login
Authenticate with Nexus using your browser:
Terminal
npx @nexus/cli auth loginOpening browser for authentication...Verification code: ABCD-1234Authenticated successfully!API key saved to ~/.nexus/config.json
How It Works
- The CLI generates a verification code and opens your browser
- Sign in with GitHub or Google
- The CLI automatically receives your API key
- Your key is stored locally and used by
nexus serve
Automatic Key Usage
Once logged in, you don't need to manually configure `NEXUS_API_KEY` in your MCP client configs. The CLI automatically uses the stored key.
Status
Check your authentication status:
Terminal
npx @nexus/cli auth statusAuthenticatedUser: ryan@example.comPlan: ProAPI calls this month: 1,234 / unlimited
Logout
Remove stored credentials:
Terminal
npx @nexus/cli auth logoutLogged out successfully
Token Storage
Credentials are stored in ~/.nexus/config.json:
json
{
"apiKey": "nxs_your_api_key_here",
"userId": "user_123"
}Security
Keep this file secure. Don't commit it to version control. Add `~/.nexus/` to your global gitignore.
Manual API Key
If you prefer to manage your API key manually:
- Create a key at nexus.yogan.dev/dashboard/keys
- Set it as an environment variable:
bash
export NEXUS_API_KEY=nxs_your_api_key_hereOr add it directly to your MCP client config:
json
{
"mcpServers": {
"nexus": {
"command": "npx",
"args": ["-y", "@nexus/cli", "serve"],
"env": {
"NEXUS_API_KEY": "nxs_your_api_key_here"
}
}
}
}Troubleshooting
Browser Doesn't Open
If the browser doesn't open automatically, copy the URL from the terminal and open it manually.
Authentication Timeout
The verification code expires after 10 minutes. Run nexus auth login again to get a new code.
API Key Not Working
- Check
npx @nexus/cli auth status - Try logging out and back in:
npx @nexus/cli auth logout && npx @nexus/cli auth login - Verify your key at nexus.yogan.dev/dashboard/keys