The CLI uses reflection to automatically register commands from the Equinix SDK. This approach:
- Automatically discovers all API services in the SDK client
- Generates commands for each service and method at build time
- Reduces maintenance - new SDK services are automatically available
- Ensures consistency - command structure mirrors the SDK structure
To onboard a single new Equinix service (e.g., fabricv5), use the onboard target:
make onboard SERVICE=fabricv5This will scaffold:
cmd/<service>.go- Command registrationinternal/api/<service>.go- API client setupcmd/descriptions/<service>.json- Field descriptions to embed for help
After scaffolding, you'll need to:
- Review and adjust the generated files
- Ensure the SDK package exists in
github.com/equinix/equinix-sdk-go/services/<service> - Run
make buildto verify the integration
To onboard/update every service defined in equinix-sdk-go, use the generate-all target:
make generate-allAfter generating, you'll need to:
- Review and adjust the generated files
- Run
make buildto verify the integration
make buildmake lintmake fixNOTE: Some linter issues may require hands-on work to address. Where possible, the make task abov will automatically address linter issues in generated code. It's a good idea to carefully review lint issues first to see if any of them can be fixed proactively with changes to template files, etc..
make docs