A minimal CLI tool to manage Namecheap DNS records and domain privacy (WhoisGuard) from your terminal.
- Domain listing: View all domains in your Namecheap account.
- DNS management: List, add, and delete DNS records for any domain.
- WhoisGuard (Domain Privacy): Check status, enable, and disable privacy protection.
- Docker wrapper: Includes a lightweight
ncscript to run without installing Node.js locally.
-
Clone the repository
git clone https://github.com/andreas-glaser/namecheap-manager.git cd namecheap-manager -
Install dependencies
npm install
-
Make CLI executable
chmod +x src/cli.js
Create a config.json or use environment variables to provide your Namecheap API credentials.
{
"apiUser": "YOUR_API_USER",
"apiKey": "YOUR_API_KEY",
"userName": "YOUR_ACCOUNT_USER",
"clientIp": "YOUR_SERVER_IP",
"endpoint": "https://api.namecheap.com/xml.response"
}Note: Make sure
clientIpmatches the IP address permitted in your Namecheap API settings.
| Command | Description |
|---|---|
domains:list |
List all domains in your account |
dns:list <domain> |
Show DNS records for <domain> |
dns:add <domain> <name> <type> <value> [opts] |
Add a DNS record |
dns:delete <domain> <hostId...> |
Delete one or more records by Host ID |
privacy:status <domain> |
Show WhoisGuard status (ENABLED, DISABLED, NOTPRESENT) |
privacy:enable <domain> |
Enable WhoisGuard for a domain |
privacy:disable <domain> |
Disable WhoisGuard for a domain |
Use the --help flag for detailed options:
namecheap-manager dns:add --helpIf you prefer not to install Node.js locally, use the nc script. It runs the CLI inside Docker:
./nc domains:list
./nc dns:add example.com @ A 203.0.113.42 --ttl 5m
./nc privacy:enable mydomain.com# List domains
namecheap-manager domains:list --page 1 --size 50
# Show records for example.com
namecheap-manager dns:list example.com
# Add an A record
namecheap-manager dns:add example.com www A 198.51.100.123 --ttl 60m
# Delete records
namecheap-manager dns:delete example.com 1234 5678
# Check privacy status
namecheap-manager privacy:status example.com
# Enable WhoisGuard
namecheap-manager privacy:enable example.com
# Disable WhoisGuard
namecheap-manager privacy:disable example.com-
Run tests (if applicable)
npm test -
Lint & Format
npm run lint npm run format
Contributions are welcome! Please open issues and submit pull requests for any improvements.
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-command) - Commit your changes (
git commit -m "Add new feature") - Push to your branch (
git push origin feature/new-command) - Open a Pull Request
This project is licensed under the MIT License.