Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

skill-server_bill_monitor

bởi Oratis Kamir

DevOps & Cloud
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

generates daily Google Cloud Platform billing reports. It queries your GCP billing data via BigQuery and summarizes costs by service, highlights trends, and flags anomalies.

Mô tả

Kỹ năng này làm gì

  • **Daily cost breakdown** by GCP service (Compute Engine, Cloud Storage, BigQuery, etc.)
  • **Day-over-day comparison** with percentage change indicators
  • **Credits tracking** (sustained use discounts, committed use discounts, free tier)
  • **Anomaly detection** — flags services with >20% cost increase
  • **Multiple output formats** — Markdown, JSON, or ASCII table
  • **Auto-detection** of BigQuery billing export dataset and billing account
  • **Schedulable** — pair with Claude Code's `/schedule` for daily automated reports

Quy trình ví dụ

### In Claude Code (as a skill)

Simply ask Claude about your cloud billing:

```

> What's my GCP bill for today?

> Show me yesterday's cloud costs broken down by service

> Generate a billing report for 2025-03-15

> How much am I spending on Compute Engine?

```

Or invoke directly with the slash command:

```

> /server-bill-monitor

> /server-bill-monitor --project my-project --date 2025-03-15

> /server-bill-monitor --format json

```

### Standalone Script

```bash

# Basic usage (auto-detects project, uses yesterday's date)

./scripts/gcp_billing_query.sh

# Specify project and date

./scripts/gcp_billing_query.sh --project my-gcp-project --date 2025-03-15

# JSON output saved to file

./scripts/gcp_billing_query.sh --format json --output ./reports/

# Table format for terminal

./scripts/gcp_billing_query.sh --format table

# Specify BigQuery dataset explicitly

./scripts/gcp_billing_query.sh --dataset billing_export --billing-account 012345-6789AB-CDEF01

# Without day-over-day comparison

./scripts/gcp_billing_query.sh --no-compare

```

### Schedule Daily Reports

#### With Claude Code `/schedule`

```

> /schedule "Run /server-bill-monitor every day at 9am"

```

#### With cron

```bash

# Edit crontab

crontab -e

# Add daily 9am report

0 9 * * * /path/to/gcp_billing_query.sh --project my-project --output /path/to/reports/ 2>&1

```

Yêu cầu

  • **Google Cloud SDK** (`gcloud` + `bq`) installed and authenticated
  • **BigQuery Billing Export** enabled in your GCP project
  • **jq** installed for JSON processing
  • IAM role: `roles/billing.viewer` and `roles/bigquery.dataViewer`

### Setting up BigQuery Billing Export

If you haven't set up billing export yet:

  • Go to [GCP Console → Billing → Billing export](https://console.cloud.google.com/billing/export)
  • Select the **BigQuery Export** tab
  • Choose or create a dataset (e.g., `billing_export`)
  • Enable **Standard usage cost** export
  • Wait 24-48 hours for initial data to populate

Cài đặt

Cài kỹ năng từ https://github.com/oratis/skill-server_bill_monitor

Kỹ năng này chưa được đăng trên registry ClawHub. Hãy dán prompt vào coding agent của bạn — Claude Code, Cursor, Codex — và nó sẽ cài kỹ năng thẳng từ kho mã nguồn.

Mở kho mã

Liên kết