diff --git a/README.md b/README.md index 1d1a47b..2c042af 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,47 @@ # azureprice -Go cli to check azure prices on the fly + +![build workflow](https://github.com/muandane/azureprice/actions/workflows/release.yml/badge.svg) + +azureprice is a Go CLI that retrieves pricing information for Azure services using the Azure pricing API. + +![Azureprice Demo](./demo.gif) + +## Features + +- Retrieves pricing info for Azure services +- Outputs pricing in easy-to-read tables +- Built using [lipgloss](https://github.com/charmbracelet/lipgloss) for beautiful terminal output + +## Installation + +```sh +brew tap muandane/gitmoji +brew install azureprice +``` + +Or build from source: + +```sh +git clone https://github.com/muandane/azureprice +cd azureprice +go build -o azureprice ./src/cmd +``` + +## Usage + +```sh +azureprice [flags] + Usage of azureprice: + -h, --help help for azureprice + -r, --region string Azure region (default "westus") + -s, --service string Azure service + -t, --type string Azure VM type (default "Standard_B4ms") +``` + +## Contributing + +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. + +## License + +[Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0) diff --git a/demo.gif b/demo.gif new file mode 100644 index 0000000..b034e91 Binary files /dev/null and b/demo.gif differ diff --git a/demo.tape b/demo.tape new file mode 100644 index 0000000..5a9ac1d --- /dev/null +++ b/demo.tape @@ -0,0 +1,52 @@ +Output demo.gif +Set Shell zsh +# Set up a 1200x600 terminal with 46px font. +Set FontSize 14 +Set Width 1000 +Set Height 600 + +Sleep 500ms +Sleep 500ms +Type "azureprice" +Type " " +Sleep 50ms +Type "-t " +Sleep 90ms +Type "S" +Sleep 50ms +Type "tandard" +Sleep 1s +Type "_" +Sleep 50ms +Type "P" +Sleep 50ms +Type "B" +Sleep 50ms +Type "6" +Sleep 50ms +Type "s -r " +Sleep 500ms +Type "eastus" +Enter +Sleep 500ms +Sleep 1s +Sleep 500ms +Type "azureprice" +Type " " +Sleep 50ms +Type "-s " +Sleep 90ms +Type "B" +Sleep 50ms +Type "4" +Sleep 50ms +Type "p" +Sleep 50ms +Sleep 50ms +Type " -r" +Sleep 500ms +Type " australiaeast" +Enter +Sleep 500ms +Sleep 2s +Sleep 500ms diff --git a/src/cmd/main.go b/src/cmd/main.go index e9ce952..42edd48 100644 --- a/src/cmd/main.go +++ b/src/cmd/main.go @@ -29,14 +29,14 @@ type Response struct { } func main() { - vmType := flag.String("t", "", "VM type") - region := flag.String("r", "", "Region") + vmType := flag.String("t", "Standard_B4ms", "VM type") + region := flag.String("r", "westus", "Region") pricingPeriod := flag.String("p", "", "Pricing period (hour or month)") - series := flag.String("s", "", "VM series (e.g., 'D' for D series)") - flag.StringVar(series, "series", "", "VM series (e.g., 'D' for D series)") - flag.StringVar(vmType, "type", "", "VM type") - flag.StringVar(region, "region", "", "Region") - flag.StringVar(pricingPeriod, "pricing", "", "Pricing period (hour or month)") + series := flag.String("s", "", "Azure service (e.g., 'D' for D series vms, Private for Private links)") + flag.StringVar(series, "service", "", "Azure service (e.g., 'D' for D series vms, Private for Private links)") + flag.StringVar(vmType, "type", "Standard_B4ms", "VM type") + flag.StringVar(region, "region", "westus", "Region") + flag.StringVar(pricingPeriod, "period", "", "Pricing period (hour or month)") flag.Parse() re := lipgloss.NewRenderer(os.Stdout)