cmd

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(args []string) (err error)

func VersionString

func VersionString() string

Types

type AuthCmd

type AuthCmd struct {
	SetKey  AuthSetKeyCmd  `cmd:"" name:"set-key" help:"Set API key (uses --stdin by default)"`
	SetUser AuthSetUserCmd `cmd:"" name:"set-user" help:"Set API username"`
	SetIP   AuthSetIPCmd   `cmd:"" name:"set-ip" help:"Set client IP address"`
	Status  AuthStatusCmd  `cmd:"" help:"Show authentication status"`
	Remove  AuthRemoveCmd  `cmd:"" help:"Remove all stored credentials"`
}

type AuthRemoveCmd

type AuthRemoveCmd struct{}

func (*AuthRemoveCmd) Run

func (cmd *AuthRemoveCmd) Run(ctx context.Context) error

type AuthSetIPCmd

type AuthSetIPCmd struct {
	IP string `arg:"" required:"" help:"Client IP address for API access"`
}

func (*AuthSetIPCmd) Run

func (cmd *AuthSetIPCmd) Run(ctx context.Context) error

type AuthSetKeyCmd

type AuthSetKeyCmd struct {
	Stdin bool   `help:"Read API key from stdin (default: true)" default:"true"`
	Key   string `arg:"" optional:"" help:"API key (discouraged; exposes in shell history)"`
}

func (*AuthSetKeyCmd) Run

func (cmd *AuthSetKeyCmd) Run(ctx context.Context) error

type AuthSetUserCmd

type AuthSetUserCmd struct {
	Username string `arg:"" required:"" help:"Namecheap API username"`
}

func (*AuthSetUserCmd) Run

func (cmd *AuthSetUserCmd) Run(ctx context.Context) error

type AuthStatusCmd

type AuthStatusCmd struct{}

func (*AuthStatusCmd) Run

func (cmd *AuthStatusCmd) Run(ctx context.Context) error

type CLI

type CLI struct {
	RootFlags `embed:""`

	Version    kong.VersionFlag `help:"Print version and exit"`
	Auth       AuthCmd          `cmd:"" help:"Auth and credentials"`
	Domains    DomainsCmd       `cmd:"" help:"Domain management"`
	DNS        DNSCmd           `cmd:"" name:"dns" help:"DNS record management"`
	SSL        SSLCmd           `cmd:"" name:"ssl" help:"SSL certificate management"`
	VersionCmd VersionCmd       `cmd:"" name:"version" help:"Print version"`
}

type DNSCmd

type DNSCmd struct {
	List      DNSListCmd      `cmd:"" help:"List DNS records for a domain"`
	Set       DNSSetCmd       `cmd:"" help:"Set DNS records for a domain"`
	SetCustom DNSSetCustomCmd `cmd:"set-custom" help:"Set custom nameservers for a domain"`
}

type DNSListCmd

type DNSListCmd struct {
	SLD string `arg:"" required:"" help:"Second-level domain (e.g., example)"`
	TLD string `arg:"" required:"" help:"Top-level domain (e.g., com)"`
}

func (*DNSListCmd) Run

func (cmd *DNSListCmd) Run(ctx context.Context, flags *RootFlags) error

type DNSSetCmd

type DNSSetCmd struct {
	SLD     string `arg:"" required:"" help:"Second-level domain (e.g., example)"`
	TLD     string `arg:"" required:"" help:"Top-level domain (e.g., com)"`
	Records string `required:"" help:"JSON array of records: [{\"host_name\":\"@\",\"record_type\":\"A\",\"address\":\"1.2.3.4\"}]"`
}

func (*DNSSetCmd) Run

func (cmd *DNSSetCmd) Run(ctx context.Context, flags *RootFlags) error

type DNSSetCustomCmd

type DNSSetCustomCmd struct {
	SLD         string `arg:"" required:"" help:"Second-level domain (e.g., example)"`
	TLD         string `arg:"" required:"" help:"Top-level domain (e.g., com)"`
	Nameservers string `required:"" help:"Comma-separated list of nameservers (e.g., ns1.example.com,ns2.example.com)"`
}

func (*DNSSetCustomCmd) Run

func (cmd *DNSSetCustomCmd) Run(ctx context.Context, flags *RootFlags) error

type DomainsCheckCmd

type DomainsCheckCmd struct {
	Domains string `arg:"" required:"" help:"Comma-separated domains to check (e.g., example.com,test.net)"`
}

func (*DomainsCheckCmd) Run

func (cmd *DomainsCheckCmd) Run(ctx context.Context, flags *RootFlags) error

type DomainsCmd

type DomainsCmd struct {
	List  DomainsListCmd  `cmd:"" help:"List domains in your account"`
	Check DomainsCheckCmd `cmd:"" help:"Check domain availability"`
	Get   DomainsGetCmd   `cmd:"" help:"Get domain details"`
}

type DomainsGetCmd

type DomainsGetCmd struct {
	Domain string `arg:"" required:"" help:"Domain name to get details for"`
}

func (*DomainsGetCmd) Run

func (cmd *DomainsGetCmd) Run(ctx context.Context, flags *RootFlags) error

type DomainsListCmd

type DomainsListCmd struct {
	Type     string `help:"Filter: ALL, EXPIRING, or EXPIRED" default:"ALL" enum:"ALL,EXPIRING,EXPIRED"`
	Page     int    `help:"Page number" default:"1"`
	PageSize int    `help:"Results per page" default:"100" name:"page-size"`
}

func (*DomainsListCmd) Run

func (cmd *DomainsListCmd) Run(ctx context.Context, flags *RootFlags) error

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError wraps an error with an exit code.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

type RootFlags

type RootFlags struct {
	Color   string `help:"Color output: auto|always|never" default:"${color}"`
	JSON    bool   `help:"Output JSON to stdout (best for scripting)" default:"${json}"`
	Plain   bool   `help:"Output stable, parseable text to stdout (TSV; no colors)" default:"${plain}"`
	Force   bool   `help:"Skip confirmations for destructive commands"`
	NoInput bool   `help:"Never prompt; fail instead (useful for CI)"`
	Verbose bool   `help:"Enable verbose logging"`
	Sandbox bool   `help:"Use sandbox API endpoint"`
}

type SSLCmd

type SSLCmd struct {
	List SSLListCmd `cmd:"" help:"List SSL certificates"`
}

type SSLListCmd

type SSLListCmd struct {
	Type string `help:"Filter: All, Processing, or Active" default:"" enum:",All,Processing,Active"`
}

func (*SSLListCmd) Run

func (cmd *SSLListCmd) Run(ctx context.Context, flags *RootFlags) error

type VersionCmd

type VersionCmd struct{}

func (*VersionCmd) Run

func (cmd *VersionCmd) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL