Skip to main content

FinOps CLI Toolkit for Azure

Project description

FinOps CLI Toolkit

This project provides a simple cross‑platform FinOps command line toolkit for Azure. The scripts simulate detection of cloud waste, budget checks and cost‑saving recommendations using local mock data. Output is styled with ANSI colours and Unicode tables similar to the screenshot referenced in the project description. The scripts simulate detection of cloud waste, budget checks and cost‑saving recommendations using local mock data. Output is styled with ANSI colours and Unicode tables similar to the screenshot referenced in the project description.

Quick start

Clone the repository and install the Python dependencies:

git clone https://github.com/cloudcwfranck/finazops.git
cd finazops
./install.sh

After the packages are installed you can run the toolkit just like the AWS version but targeting Azure.

Install from PyPI

The CLI can be installed as a package from PyPI:

pip install finazops
finazops --help

Scripts

  • detect-waste.sh / detect-waste.ps1 – find stopped Azure VMs, unassociated public IPs, and unattached managed disks and show estimated monthly waste.
  • check-budgets.sh / check-budgets.ps1 – check mock budgets for multiple subscriptions and indicate if they are under or over budget.
  • generate-recommendations.sh / generate-recommendations.ps1 – display recommendations based on detected waste.

The scripts rely only on Bash (for Linux/macOS) or PowerShell (for Windows). No cloud APIs or additional tools are required.

Run on GitHub

Run FinOps Toolkit

Execute the toolkit in a GitHub Actions runner using the run-app workflow. Click the badge above, choose Run workflow, and once the job completes open the run and view the output in the Summary tab directly in your browser.

Build and publish on GitHub

The publish workflow builds the Python package and uploads it to PyPI. Push a tag like v1.2.3 or trigger the workflow manually after configuring a PYPI_API_TOKEN secret in your repository settings.

Running on Replit or Linux/macOS

After cloning run ./install.sh once to set up Python packages. Then execute:

bash detect-waste.sh
bash check-budgets.sh
bash generate-recommendations.sh

Ensure the scripts have execute permissions:

chmod +x *.sh

Running on Windows PowerShell

In a PowerShell terminal run the installer once and then execute the scripts:

powershell -ExecutionPolicy Bypass -File install.ps1

Then run:

powershell -ExecutionPolicy Bypass -File detect-waste.ps1
powershell -ExecutionPolicy Bypass -File check-budgets.ps1
powershell -ExecutionPolicy Bypass -File generate-recommendations.ps1

These commands will output colorized tables summarizing waste, budgets, and recommended actions using mock data.

Python FinOps CLI

The finops_cli.py script adds enhanced features such as cost analysis by time period, cost trends, subscription management and export options. It uses the Rich library for a pleasant terminal UI. When installed from PyPI it is available as the finazops command.

Key capabilities include:

  • Cost analysis by time period – view the current and previous month by default. Set custom ranges such as 7, 30 or 90 days with --time-range.
  • Cost by Azure service – sorted from highest to lowest for clear insight.
  • Cost by tag – filter spend by one or more tags using --tag (cost allocation tags must be enabled).
  • Budget information – display limits and actual spend for configured budgets.
  • VM instance status – detailed state information across specified regions via --regions.
  • Cost trend analysis – bar charts summarising the last six months across profiles when --trend is used.
  • FinOps audit – view untagged resources, unused or stopped instances and budget breaches across profiles.
  • Profile management – automatic subscription detection, select with --profiles, use all with --all or combine using --combine.
  • Export options – set a name with --report-name and output to CSV, JSON and/or PDF with --report-type (e.g. --report-type csv json). Use --dir to choose the folder. Trend reports export to JSON only.
  • Improved error handling and a beautiful terminal UI thanks to the Rich library.

Run ./install.sh (or install.ps1 on Windows) beforehand so the required Python packages are present.

Run the CLI with Python or the installed command:

finazops --help
# or
python3 finops_cli.py --help

Exports can be written to CSV, JSON or PDF with --report-type and saved to a custom directory using --dir.

Azure Authentication

azure_login.py launches an interactive browser window to sign into Azure and prints your available subscriptions. It requires the azure-identity and azure-mgmt-resource packages which are installed automatically in the GitHub Actions workflow or by running ./install.sh (or install.ps1 on Windows).

Run locally with:

python3 azure_login.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finazops-0.2.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finazops-0.2.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file finazops-0.2.0.tar.gz.

File metadata

  • Download URL: finazops-0.2.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for finazops-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9dcbf2efd5dcfa932f0071bf39aa5b038f9fafd9aac04059aeca4ade7027429a
MD5 9b7636e869fee1bd994a9b9e92f876ac
BLAKE2b-256 2cc4d1c50b45285cd776051870c1a5c402d372df3abd083b18df7cd4436be54f

See more details on using hashes here.

Provenance

The following attestation bundles were made for finazops-0.2.0.tar.gz:

Publisher: publish.yml on cloudcwfranck/finazops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file finazops-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: finazops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for finazops-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 317f87c4faff9adcff0f0a1c8e54a774e9426d786ab2cfdf6c07b4fb6c48cef1
MD5 47d1a9653c707f54a35e42179e3c1662
BLAKE2b-256 a2063a8cea101fde5202c51f19f5f97560318bce3fd2fc66f819f01a8cef4583

See more details on using hashes here.

Provenance

The following attestation bundles were made for finazops-0.2.0-py3-none-any.whl:

Publisher: publish.yml on cloudcwfranck/finazops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page