Skip to content

Commit

Permalink
docs 📚: added documentation and minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
muandane committed Oct 12, 2023
1 parent 95a221b commit 1723083
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 8 deletions.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions demo.tape
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions src/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1723083

Please sign in to comment.