Skip to main content
Configure Grok CLI to use Nordlys’s Mixture of Models — our Mixture of Models automatically selects the best specialist while maintaining the same AI-powered command line experience.
Get the best AI specialist for every prompt with Nordlys Mixture of Models. Works as a drop-in replacement for Grok CLI’s API backend. The installer automatically configures your shell environment.

Get Your Nordlys API Key

Sign up here to create an account and generate your API key.

Quick Setup

Run Installer

curl -fsSL https://raw.githubusercontent.com/Nordlys-Labs/nordlys/main/scripts/installers/unix/grok-cli.sh | bash
The installer will prompt you for your Nordlys API key and automatically:
  • Install Grok CLI if not present
  • Configure Nordlys API settings
  • Add environment variables to your shell config

Restart Terminal

Close and reopen your terminal to load the new environment variables, or run:
source ~/.zshrc  # or ~/.bashrc for Bash users

Start Using

grok -m nordlys/hypernova
Grok CLI running with Hypernova model

Alternative Setup Methods

export NORDLYS_API_KEY='your-api-key-here'
curl -fsSL https://raw.githubusercontent.com/Nordlys-Labs/nordlys/main/scripts/installers/unix/grok-cli.sh | bash
# The installer will automatically add the API key to your shell config

Advanced Configuration

The installer automatically handles environment variable setup for all major shells (bash, zsh, fish). Manual configuration is typically not needed.

Shell-Specific Configuration

# Nordlys AI model API Configuration
export NORDLYS_API_KEY="your-nordlys-api-key"
export NORDLYS_BASE_URL="https://api.nordlyslabs.com/v1"

Troubleshooting

If you see an error like:
Grok API error: 400 invalid model 'grok-4-latest': only nordlys/* models are supported
This means Grok CLI is trying to use a model that isn’t supported by the Nordlys API. Fix it by:
  1. Update your configuration file to only use nordlys/hypernova:
    cat > ~/.grok/user-settings.json << 'EOF'
    {
      "apiKey": "your-nordlys-api-key",
      "baseURL": "https://api.nordlyslabs.com/v1",
      "defaultModel": "nordlys/hypernova",
      "models": ["nordlys/hypernova"]
    }
    EOF
    
  2. Set the GROK_MODEL environment variable to override any other settings:
    # Add to your shell config (~/.bashrc, ~/.zshrc, etc.)
    export GROK_MODEL="nordlys/hypernova"
    export GROK_BASE_URL="https://api.nordlyslabs.com/v1"
    
  3. Re-run the installer to automatically fix the configuration:
    curl -fsSL https://raw.githubusercontent.com/Nordlys-Labs/nordlys/main/scripts/installers/unix/grok-cli.sh | bash
    
  • Ensure you have the required dependencies (Node.js, Python, etc.)
  • Check installation logs for specific error messages
  • Try the interactive installation method for better error handling
  • Verify your API key at nordlyslabs.com/api-platform/orgs
  • Check that API key is properly set in ~/.grok/user-settings.json
  • Ensure environment variables are exported in your shell config:
    # Check if variables are set
    echo $NORDLYS_API_KEY
    echo $NORDLYS_BASE_URL
    
    # If not set, restart terminal or source your shell config
    source ~/.bashrc  # or ~/.zshrc for Zsh users
    

Next Steps


Was this page helpful? Contact us at [email protected] for feedback or assistance with your Grok CLI integration.