Getting Started
Prerequisites
- Node.js 18.0.0 or higher, or the Bun runtime
Installation
Global Install (Recommended)
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-cliRun 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 listAPI Credentials Setup
Before using the CLI, you need API credentials from Namecheap:
- Log in to your Namecheap account
- Go to Profile > Tools > API Access
- Enable API access (requires account balance > $50 or 20+ domains)
- Whitelist your IP address
- 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 loginYou 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.comTroubleshooting
Common Errors
| Error | Solution |
|---|---|
| "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