Skip to content

Plugins

Damir Mukimov edited this page Nov 22, 2025 · 9 revisions

Plugins

Extend Namecheap DNS Manager with custom functionality

Namecheap DNS Manager features a plugin system that allows you to extend functionality for specific use cases.


πŸ”Œ Built-in Plugins

Migadu Email Hosting

The Migadu plugin helps you set up DNS records for Migadu email hosting.

Commands

Command Description Example
migadu setup <domain> Set up all required DNS records namecheap-dns migadu setup example.com
migadu verify <domain> Verify DNS records are correct namecheap-dns migadu verify example.com
migadu remove <domain> Remove Migadu DNS records namecheap-dns migadu remove example.com

Example Workflow

Complete Migadu setup example
# 1. Preview changes (dry-run)
namecheap-dns migadu setup example.com --dry-run

# Output:
# πŸ” Dry-run mode: Previewing changes...
# Would add: MX record @ -> mx.migadu.com (priority: 10)
# Would add: TXT record @ -> "v=spf1 include:spf.migadu.com ~all"
# Would add: CNAME record autoconfig -> autoconfig.migadu.com
# ...

# 2. Apply changes
namecheap-dns migadu setup example.com

# Output:
# βœ… Successfully set up Migadu DNS records for example.com
# βœ… Added MX record
# βœ… Added SPF record
# βœ… Added DKIM records
# βœ… Added DMARC record
# βœ… Added autoconfig records

# 3. Verify setup
namecheap-dns migadu verify example.com

# Output:
# βœ… All Migadu DNS records are correctly configured

πŸ“‹ Plugin Management

List All Plugins

namecheap-dns plugin list

Example Output:

Available Plugins:
πŸ“¦ migadu (v1.0.0)
   Migadu email hosting setup and management

Get Plugin Information

namecheap-dns plugin info migadu

Output includes:

  • βœ… Plugin name and version
  • βœ… Description
  • βœ… Available commands with details

Creating Custom Plugins

Plugins are Go packages that implement the plugin.Plugin interface.

Plugin Interface

type Plugin interface {
    Name() string
    Description() string
    Version() string
    Commands() []Command
}

Quick Start

  1. Create plugin package: pkg/plugin/myplugin/
  2. Implement interface: Implement all required methods
  3. Register plugin: Add to cmd/root.go
  4. Test: Use namecheap-dns plugin list to verify

Key Components

  1. Plugin Registration: Plugins must be registered in cmd/root.go
  2. Command Execution: Commands receive a Context with DNS service access
  3. Output Handling: Use ctx.Output for user-facing messages

Best Practices

  • Validate all inputs
  • Support --dry-run flag
  • Check for existing records before modifying
  • Provide clear error messages
  • Use DNS constants from pkg/dns package

Plugin Development

For detailed plugin development guide, see:

Contributing Plugins

If you create a useful plugin, consider contributing it back to the project:

  1. Fork the repository
  2. Create your plugin in pkg/plugin/<plugin-name>/
  3. Register it in cmd/root.go
  4. Add tests
  5. Submit a pull request

Clone this wiki locally