See README.md for user-facing documentation, features, and usage examples.
- Do NOT do git commits. Let the user do those.
- If you need to run "add" command, ask the user to run it since it is interactive.
DevHttps follows a simple CLI architecture:
-
main.go: Entry point that delegates tocmd.Execute() -
cmd/package: CLI command implementations usingurfave/cli/v3 -
internal/package: Core business logic modulescertbot/: Certificate management via certbot CLI (~/.devhttps/certbot/)Certificates(),CertificatesVerbose(): list certs (source of truth for available domains)Run(domain): interactive certbot for new domain
caddy/: Caddy integration (~/.devhttps/caddy/)validate/: Input validationhostcheck/: DNS and hosts file resolution checking
# Build the binary
go build -o devhttps
# Run the CLI directly (without building)
go run main.go [command] [args]
# Run specific commands
go run main.go add dev.example.com
go run main.go run dev.example.com 3000
go run main.go show
go run main.go check- Command handling: Each subcommand is a separate file in
cmd/that returns a*cli.Command - Input validation: All user input (domain, port) goes through
validate/package before business logic - No persistent config: Certbot certificate store is the source of truth for available domains
- Error handling: Commands use
cli.Exit("", 1)for non-zero exit on errors
github.com/urfave/cli/v3: CLI framework for command parsing and execution- Standard library only for all internal logic (no external dependencies for business logic)