Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:23:04 +08:00
commit ec60f8e0b6
7 changed files with 990 additions and 0 deletions

66
commands/analyze.md Normal file
View File

@@ -0,0 +1,66 @@
---
description: Analyze AWS Bedrock costs for specified period
argument-hint: period
---
Analyze AWS Bedrock model costs for a specified time period.
## Usage
```bash
aws-bedrock-cost-tool [OPTIONS]
```
## Options
**Time Range:**
- `--period DURATION`: Period to analyze (default: 30d)
- Format: `7d`, `2w`, `1m`, `3m`, `90d`
- Max: 365d
**AWS Configuration:**
- `--profile NAME`: AWS profile name
**Output Modes:**
- Default: JSON to stdout
- `--table`: Summary table
- `--plot-time`: Time series plot
- `--plot-models`: Bar chart by model
- `--all-visual`: All visualizations
- `--summary-only`: Quick summary
**Detail Level:**
- `--detail basic|standard|full`: Detail level (default: standard)
**Control:**
- `-v/-vv/-vvv`: Verbosity (INFO/DEBUG/TRACE)
- `--quiet` / `-q`: Suppress messages
- `--help` / `-h`: Show help
## Examples
```bash
# Default JSON output (last 30 days)
aws-bedrock-cost-tool
# Quick summary
aws-bedrock-cost-tool --summary-only
# Visual table for last 90 days
aws-bedrock-cost-tool --period 90d --table
# Full report with all visualizations
aws-bedrock-cost-tool --all-visual --detail full
# Pipe to jq for filtering
aws-bedrock-cost-tool | jq '.models[] | select(.model_name | contains("Sonnet"))'
```
## Output
Returns cost data with:
- Total cost for period
- Per-model breakdown
- Usage by type (input/output/cache tokens in millions)
- Daily cost trends
- Estimated cost indicators (~$X.XX)

48
commands/plot.md Normal file
View File

@@ -0,0 +1,48 @@
---
description: Visualize costs with ASCII plots
argument-hint: type
---
Generate ASCII visualizations of AWS Bedrock costs.
## Usage
```bash
aws-bedrock-cost-tool --plot-time [OPTIONS] # Time series
aws-bedrock-cost-tool --plot-models [OPTIONS] # Bar chart
aws-bedrock-cost-tool --all-visual [OPTIONS] # All plots
```
## Plot Types
**Time Series (`--plot-time`):**
- Daily cost trends over time
- Shows spending patterns
- Identifies cost spikes
**Models Bar Chart (`--plot-models`):**
- Cost by model comparison
- Horizontal bar chart
- Quick cost distribution view
**All Visuals (`--all-visual`):**
- Table + Time series + Bar chart
- Comprehensive cost overview
## Examples
```bash
# Time series for last 30 days
aws-bedrock-cost-tool --plot-time
# Model comparison for last 90 days
aws-bedrock-cost-tool --period 90d --plot-models
# Complete visual report
aws-bedrock-cost-tool --all-visual --detail full
```
## Requirements
- gnuplot (install: `brew install gnuplot`)
- Plots render in terminal as ASCII art

41
commands/table.md Normal file
View File

@@ -0,0 +1,41 @@
---
description: Display costs in formatted table view
argument-hint: period
---
Display AWS Bedrock costs in a formatted table with usage breakdown.
## Usage
```bash
aws-bedrock-cost-tool --table [OPTIONS]
```
## Options
- `--period DURATION`: Time period (default: 30d)
- `--detail basic|standard|full`: Detail level
- `--profile NAME`: AWS profile
- `-v/-vv/-vvv`: Verbosity levels
## Examples
```bash
# Standard table (last 30 days)
aws-bedrock-cost-tool --table
# Full detail with regions
aws-bedrock-cost-tool --table --detail full
# Last 90 days
aws-bedrock-cost-tool --period 90d --table
```
## Output
Displays formatted table with:
- Model names
- Total costs per model
- Token usage in millions (M)
- Usage type breakdown (input/output/cache)
- Regional breakdown (full detail only)