Skip to main content

Namecheap CLI

A command-line interface for managing Namecheap DNS records.

Features

  • List all domains in your Namecheap account
  • View DNS records for a domain
  • Add, update, and delete DNS records
  • Interactive menu for easier management
  • Secure storage of API credentials

Installation

pip install namecheap-cli

Or install directly from GitHub:

pip install git+https://github.com/connorodea/namecheap-cli.git

Usage

Interactive Mode

For the easiest usage, simply run the command without any arguments to enter interactive mode:

namecheap

This will display a menu similar to:

╭─────────────╮
│ Namecheap CLI │
╰─────────────╯

Please select an option:

[1] List domains
[2] View DNS records
[3] Add DNS record
[4] Update DNS record
[5] Delete DNS records
[0] Exit

Enter your choice [0/1/2/3/4/5] (0):

Command-Line Arguments

You can also use command-line arguments for scripting or automation:

# Initialize API credentials
namecheap init

# List all domains
namecheap domains

# List DNS records for a domain
namecheap records example.com

# Add a DNS record
namecheap add -d example.com -t A -h www -v 192.168.1.1 -l 3600

# Update a DNS record
namecheap update -d example.com -t A -h www -v 192.168.1.2 -l 3600

# Delete a DNS record
namecheap delete -d example.com -t A -h www

Getting Help

For more information on the available commands and options:

namecheap --help

API Credentials

Upon first use, the CLI will prompt you for your Namecheap API credentials:

  • API Key
  • API User
  • Username (usually the same as API User)
  • Client IP (detected automatically)

These credentials are securely stored in ~/.namecheap/config.json for future use.

To obtain API credentials from Namecheap:

  1. Log in to your Namecheap account
  2. Go to Profile > Tools > API Access
  3. Enable API access and note your API key
  4. Your client IP must be whitelisted in the Namecheap API settings

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Environment Variables

Instead of storing credentials in the config file, you can use environment variables:

  • NAMECHEAP_API_KEY - Your Namecheap API key
  • NAMECHEAP_API_USER - Your Namecheap API user
  • NAMECHEAP_USERNAME - Your Namecheap username (optional, defaults to API_USER)
  • NAMECHEAP_CLIENT_IP - Your client IP address (optional, auto-detected if not provided)
  • NAMECHEAP_USE_SANDBOX - Whether to use the sandbox environment (optional, defaults to false)

You can set these variables in your shell:

export NAMECHEAP_API_KEY="your_api_key"
export NAMECHEAP_API_USER="your_api_user"

Metadata

Release files for namecheap-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for namecheap-cli 0.2.0
File Size Uploaded
namecheap_cli-0.2.0.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for namecheap-cli 0.2.0
File Interpreter ABI Platform
namecheap_cli-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / namecheap_cli-0.2.0.tar.gz

Download URL namecheap_cli-0.2.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
36dc189276807a55360f6fffe32eccbf5501280ef106dc9fe0082984e2b57f9d
BLAKE2b-256 checksum
How to use checksums
c7fd2523791c5605d1de851da4c55a05dcf7094ee10495f70f9fb3dfea7d6d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / namecheap_cli-0.2.0-py3-none-any.whl

Download URL namecheap_cli-0.2.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57725bbc79f3033d19826f92626b1c435873a8994bad03e493392072b79db6f7
BLAKE2b-256 checksum
How to use checksums
29f79e39cd31ce8287f1e2daacd1460b743f86830dcff13145039103322514ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page