Skip to content

Plugins

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

Plugins

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:

  • namecheap-dns migadu setup <domain> - Set up all required DNS records
  • namecheap-dns migadu verify <domain> - Verify DNS records are correct
  • namecheap-dns migadu remove <domain> - Remove Migadu DNS records

Example:

# Setup with dry-run first
namecheap-dns migadu setup example.com --dry-run

# Apply changes
namecheap-dns migadu setup example.com

# Verify setup
namecheap-dns migadu verify example.com

Plugin Management

List Plugins

namecheap-dns plugin list

Get Plugin Information

namecheap-dns plugin info migadu

Output includes:

  • Plugin name and version
  • Description
  • Available commands

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
}

Example Plugin Structure

See the Plugin Example in the main repository for a complete example.

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