Skip to main content

Overview

Some Refactron features require authentication with cloud services:
  • Repository management
  • Cloud-based AI features
  • Collaborative pattern learning
  • Usage analytics

Login

Authenticate using the CLI:
refactron login
This will open your browser to complete the authentication flow.
Local analysis and refactoring features work without authentication

Check Authentication Status

Verify your authentication status:
refactron auth status
Expected output:
✓ Authenticated as user@example.com
  Organization: my-org
  Plan: Pro

Logout

To log out from your account:
refactron auth logout

API Keys

For CI/CD environments, use API keys instead of interactive login:

Generate API Key

  1. Log in via the CLI: refactron login
  2. Visit your dashboard
  3. Navigate to SettingsAPI Keys
  4. Click Generate New Key

Use API Key

Set the API key as an environment variable:
export REFACTRON_API_KEY=your_api_key_here
Keep your API keys secret! Never commit them to version control.

Authenticated Features

Features that require authentication:
refactron repo list
refactron repo connect my-repo
Enhanced AI-powered refactoring with cloud LLM models
refactron metrics
Share learned patterns across your team

Offline Mode

Refactron works offline for core features:
  • Local code analysis
  • Refactoring suggestions
  • Auto-fix operations
  • Report generation
Cloud features gracefully degrade when offline.

Troubleshooting

If the browser doesn’t open automatically:
  1. Copy the URL from the terminal
  2. Paste it into your browser manually
  3. Complete the authentication
If you see “Token expired” errors:
refactron auth logout
refactron login
Verify the API key is set correctly:
echo $REFACTRON_API_KEY
Ensure it’s exported in your shell profile.

Security

Refactron follows security best practices:
  • Tokens are stored securely in your system keychain
  • API keys are never logged or displayed
  • All communication uses HTTPS
  • Authentication tokens expire after 30 days

Next Steps

Code Analysis Guide

Start analyzing your code with Refactron