Skip to main content
Glama
araujoviana

hwc-calculator

by araujoviana
README.md
# autocalc

Turns "price this for customer Y" into a share link on the
[Huawei Cloud pricing calculator](https://www.huaweicloud.com/intl/en-us/pricing/calculator.html).
Use it from the terminal (CLI) or from an AI agent (MCP server).

> **Experimental. Expect it to break.**
> autocalc is not a Huawei product and uses no official API. It drives the public pricing calculator
> the way a person would, and relies on that page's internals. When Huawei changes the page, publishing
> can fail or, worse, stop matching what the website shows, without any warning in advance.
> Before you send a link to anyone, open it and check the total yourself. Run `autocalc doctor` before
> relying on it, and do not use it for binding quotes. Prices are USD list prices, not an offer.

- Catalog and price queries need no login and no AK/SK. Prices are USD list prices from Huawei's
  own rating engine.
- Saving a list and getting a share link needs a one-time browser sign-in. autocalc never sees
  your password.

## Quick start

```bash
# 1. install (Windows: see the tutorial)
curl -fsSL https://raw.githubusercontent.com/araujoviana/autocalc/main/install.sh | sh
# 2. sign in (a browser opens)
autocalc login                           
```

The installer adds the MCP server to Claude Code when `claude` is on the path (otherwise:
`claude mcp add hwc-calculator -- autocalc-mcp`). `autocalc update` moves to the newest release.
Working on autocalc itself: `uv sync`, then prefix commands with `uv run`.

```bash
autocalc search ecs "Sao Paulo" linux --vcpus 4 --mem 8
autocalc quote Santiago 'ecs:c7n.large.2.linux*3' 'ecs:SSD*3@100' --billing monthly
autocalc doctor                   # health check: endpoints, auth, browser, cache
```

## Docs

Start at [`docs/index.md`](docs/index.md) (or `uv run --group docs mkdocs serve`). The
[first-quote tutorial](docs/tutorials/first-quote.md) is the best entry point; the
[CLI reference](docs/reference/cli.md) and [architecture](docs/explanation/architecture.md) come next.

## Development

`uv sync --group dev --group docs`, then see [run the tests](docs/how-to/run-tests.md) for the
checks CI runs. Behavior is specified in [`openspec/specs/`](openspec/specs/), and changes go
through OpenSpec (`/opsx:propose`, `/opsx:apply`, `/opsx:archive`).

## Security

The login session grants access to your Huawei Cloud **account**, not just the calculator.
It lives only in autocalc's browser profile directory (owner-only): it is never copied outside
it, and cookie values are never logged. The browser profile and the golden corpus are gitignored. Never commit client data. See [sessions](docs/explanation/huawei/sessions.md).

## License

[Apache License 2.0](LICENSE).

TDQS

B3.4/5.0

Scored across 20 tools

Disambiguation4/5

Catalog-related tools (list_services, supported_services, describe_service, search_skus) all touch service discovery but at different levels, while quote/compare_modes/compare_regions and draft_quote/revise_quote/publish_quote are stage-specific. The boundaries are mostly clear, though an agent must rely on descriptions to choose between the catalog and capability tools.

Naming Consistency4/5

All names use snake_case with mostly verb_noun patterns such as list_services, create-style stage names, and delete_price_list. A few noun-only or status-style names (quote, supported_services, auth_status) are minor deviations, but the set is predictable overall.

Tool Count3/5

At 20 tools this is in the heavy borderline range. The broad workflow includes auth, catalog, quoting, saved lists, comparisons, currency conversion, and export, so most tools earn their place, but the surface feels large and some operations could potentially be consolidated.

Completeness5/5

The set covers service/region discovery, SKU search, pricing, draft/revise/publish quote lifecycle, saved list creation and management, anonymous shared list reading, billing/region comparisons, currency conversion, and Excel export. No major dead ends are apparent for the stated pricing calculator purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues