How aziontech/azion works
Project type and purpose
• This is a Go-based command-line interface (CLI) named “azion” for creating and managing applications on the Azion Edge Platform.
• It uses Cobra (in cmd/azion) to expose dozens of subcommands (create, delete, deploy, describe, etc.) and bundles API clients to interact with Azion’s REST/GraphQL endpoints.
• The CLI also supports config management, manifest generation, metrics, logging, testing, packaging (Docker, Chocolatey, Homebrew, DEB/RPM/APK via goreleaser), and CI/CD via GitHub Actions.
File structure
• Top level:
• cmd/azion – root command
• cmd/gen_docs – docs generator
• pkg/ – core libraries
• pkg/api – service-specific API clients and models
• pkg/cmd – implementations of each subcommand’s business logic
• pkg/config, pkg/token, pkg/manifest, pkg/logger, pkg/metric – cross-cutting concerns
• chocolatey/, Dockerfile, goreleaser.yaml – packaging
• .github/workflows – CI/CD pipelines
• env/ – environment-specific configs (local, stage, prod)
• Pattern: a layered/hexagonal architecture where the CLI invoker sits at the outer layer, invokes command handlers in pkg/cmd, which in turn call adapters in pkg/api, feeding into external Azion services.
README for additional insights
• Emphasizes user flows: authentication (token, login), command reference, autocomplete, build and cross-build, packaging options.
• Mentions the update policy for Go, hinting at stable release-based dependency management.
Final advice
• Cross-cutting modules (config, token, logger) once and show their injection to every handler.