Cloudcash

Check your cloud spending from the CLI, from Waybar, and from the macOS menu bar!

Waybar

Cloudcash on Waybar

macOS menu bar

Cloudcash on macOS

Supported cloud services

  • Vultr
  • DigitalOcean
  • Render (no billing API yet)
  • Heroku (have no account ¯\(ツ)/¯ )
  • Amazon Web Services
  • Google Cloud Platform (have no account ¯\(ツ)/¯ )
  • Microsoft Azure (have no account ¯\(ツ)/¯ )
  • Alibaba Cloud (have no account ¯\(ツ)/¯ )
  • Oracle Cloud (have no account ¯\(ツ)/¯ )
  • Hetzner Cloud (no billing API yet)
  • suggest a new one!

Build

go build .

Configuration

Only add the services that you want to use and delete all the others:

cat ~/.config/cloudcash.toml

[Waybar]
Pango = "  {{.Name}} <span color='#aaaaaa'>${{.Status.CurrentCharges}}</span> [<span color='#aaaaaa'>${{.Status.PreviousCharges}}</span>]"
PangoJoiner = " · "

[Menu]
Template = "{{.Name}} ${{.Status.CurrentCharges}}"
Joiner = " · "
IsDefault = false

[Service]

[Service.Vultr]
APIKey = "XXXX"

[Service.DigitalOcean]
APIKey = "XXXX"

[Service.AWS]
AWSAccessKeyID = "AAAA"
AWSSecretAccessKey = "XXXX"
Region = "us-east-1"

Alternative paths for configuration file:

  • /etc/cloudcash.toml
  • $XDG_CONFIG_HOME/cloudcash.toml
  • $HOME/.config/cloudcash.toml
  • $HOME/cloudcash.toml
  • ./cloudcash.toml

Waybar

The Pango template used in the -waybar-pango output is used per service, separated by the PangoJouner string. To make it clear, if Pango is <span>{{.Name}}</span> and PangoJoiner is - then the output for two services (e.g. Vultr and AWS) would be:

<span>Vultr</span> - <span>AWS</span>

The Pango configuration uses Go’s text/template.

macOS menu bar

The Template in Menu is what is used to render the macOS menu bar widget. As with the Waybar output, the template is per service, separated by the Joiner string.

To always run in menu mode, set Menu.IsDefault to true.

Use

CLI (text)

cloudcash

CLI (JSON)

cloudcash -json

Waybar

rg -NA6 'cloudcash":'  ~/.config/waybar/config

  "custom/cloudcash": {
    "format": "{}",
    "return-type": "json",
    "exec": "/usr/local/bin/cloudcash -waybar-pango",
    "on-click": "",
    "interval": 3600
  },

macOS menu bar

cloudcash -menu-mode 

Alternatively set Menu.IsDefault to true in configuration.

GitHub

View Github