Skip to content

Getting Started ​

Prerequisites ​

  • Node.js 18.0.0 or higher, or the Bun runtime

Installation ​

bash
# Using npm
npm install -g @helgesverre/namecheap-cli

# Using pnpm
pnpm add -g @helgesverre/namecheap-cli

# Using Yarn
yarn global add @helgesverre/namecheap-cli

# Using Bun
bun install -g @helgesverre/namecheap-cli

Run Without Installing ​

You can try out the CLI without installing it globally:

bash
# Using npx
npx @helgesverre/namecheap-cli domains list

# Using bunx
bunx @helgesverre/namecheap-cli domains list

API Credentials Setup ​

Before using the CLI, you need API credentials from Namecheap:

  1. Log in to your Namecheap account
  2. Go to Profile > Tools > API Access
  3. Enable API access (requires account balance > $50 or 20+ domains)
  4. Whitelist your IP address
  5. Copy your API key

TIP

You can find your current public IP address by visiting whatismyip.com or running curl ifconfig.me in your terminal.

Authentication ​

Once you have your API credentials, authenticate the CLI:

bash
namecheap auth login

You will be prompted for:

  • Username -- Your Namecheap username
  • API Key -- From the API Access page
  • Client IP -- Your whitelisted IP address

First Commands ​

After authenticating, try these commands to verify everything is working:

bash
# List your domains
namecheap domains list

# Check domain availability
namecheap domains check example.com

# View DNS records for a domain
namecheap dns list example.com

Troubleshooting ​

Common Errors ​

ErrorSolution
"Not authenticated"Run namecheap auth login
"IP not whitelisted"Add your IP at Namecheap > Profile > API Access
"API access disabled"Enable at Namecheap > Profile > Tools > API Access
"Invalid API Key"Re-run namecheap auth login with the correct key
"Domain not found"Check the domain name and verify ownership

Check Status ​

You can verify your authentication and configuration at any time:

bash
# Verify authentication
namecheap auth status

# Check current config
namecheap config list

Released under the MIT License.