Skip to main content

A command-line interface for managing Namecheap DNS records

Project description

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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

namecheap_cli-0.2.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

namecheap_cli-0.2.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file namecheap_cli-0.2.0.tar.gz.

File metadata

  • Download URL: namecheap_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for namecheap_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 36dc189276807a55360f6fffe32eccbf5501280ef106dc9fe0082984e2b57f9d
MD5 937594e699b76267e9a50c5867c29950
BLAKE2b-256 c7fd2523791c5605d1de851da4c55a05dcf7094ee10495f70f9fb3dfea7d6d60

See more details on using hashes here.

File details

Details for the file namecheap_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: namecheap_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for namecheap_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57725bbc79f3033d19826f92626b1c435873a8994bad03e493392072b79db6f7
MD5 559fb36855de56a6e86d333b1c59841e
BLAKE2b-256 29f79e39cd31ce8287f1e2daacd1460b743f86830dcff13145039103322514ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page