Skip to content

Repository files navigation

CUDly CLI

CUDly is an open source CLI for discovering and purchasing AWS Reserved Instances and Savings Plans in a single command. It is dry-run by default: nothing is purchased until you pass --purchase. configure-azure and configure-gcp bootstrap credentials for the separate self-hosted platform; this CLI's own recommend-and-purchase workflow is AWS-only today. See cloud setup.

It is also built to be driven by an AI agent for the discovery and analysis side: searching recommendations, sizing a plan, filtering by account or region. The purchase step still needs a human to review the numbers before committing money. --yes currently skips the confirmation prompt outright, including for a non-interactive caller (a script, a CI job, an agent driving the CLI as a subprocess): see Safety Features and #1943 before wiring --purchase --yes into anything unattended.

The CLI depends on the published shared Go modules in cloud-commitments-go, pinned to fixed versions in go.mod. No sibling checkout or parent workspace is needed for local development.

Key Features

  • Dry-run by default - --purchase is the only opt-in that moves money; a bare invocation only prints results and writes a CSV.
  • Grounded recommendations - sized from AWS Cost Explorer's own recommendation and coverage data, not a locally-guessed baseline.
  • Multiple AWS services, one interface - RDS, ElastiCache, EC2, OpenSearch, Redshift, MemoryDB, and Savings Plans through the same command and flags. See Implementation Status for per-service maturity.
  • Coverage control - purchase a percentage of what's recommended, or of actual historical usage via --target-coverage, instead of buying everything a provider suggests in one run.
  • CSV + audit log - every dry run and every purchase is written to CSV and to a permanent JSONL audit log.

Safety Features

  1. Dry-run by default - no purchase without the explicit --purchase flag.
  2. Confirmation prompt - --purchase prints a summary of instance count and estimated savings, then prompts for confirmation. --yes skips this prompt, including for a non-interactive caller - it is not currently an automation boundary. #1943 tracks closing that gap.
  3. Coverage and instance limits - --coverage, --target-coverage, and --max-instances shape what a dry run recommends before there is anything to confirm.
  4. RDS extended-support filtering - by default, recommendations for instances running an engine version in AWS Extended Support are excluded, since the surcharge can erase RI savings; pass --include-extended-support to include them.
  5. Audit log written per recommendation - the audit log path is checked for writability before any cloud API call. Each recommendation then gets its own audit record: for a dry run, written as soon as its (local, no-API-call) result is generated; for a real purchase, written after that purchase call returns.
  6. Permanent CSV exports of every dry run and every purchase.
  7. Duplicate-purchase dedup, fails closed - every path (--services and --input-csv) subtracts commitments purchased in the last 24 hours before sizing a recommendation. --idempotency-window doesn't change that fixed 24h lookback yet (#1262). If the existing-commitments API call itself fails, a dry run continues with a warning (nothing is bought); a --purchase run refuses that (service, region) with a "Refusing to purchase" line and buys nothing there.

Full internals: Purchase Safety.

Implementation Status

AWS service Status
RDS, ElastiCache Production - the tested paths.
EC2, OpenSearch, Redshift, MemoryDB, Savings Plans Experimental - implemented and functional, still accumulating real-world purchase validation.

Azure and GCP are not part of this CLI's recommend-and-purchase workflow; configure-azure and configure-gcp only bootstrap credentials for the self-hosted platform.

Build

Use the Go version declared in go.mod.

make build
./cudly --help

make build creates ./cudly from ./cmd. The build does not deploy or configure a cloud account.

Read the CLI reference for commands. See the guides for cloud setup, filtering, and purchase safety.

Common workflows

Preview RDS recommendations before enabling a purchase:

./cudly --services rds --profile default

Export a reviewable report when you need to share results:

./cudly --services rds --profile default --output recommendations.csv

All purchase operations can spend money. Check the account, region, quantity, and selected commitment before confirming - see Safety Features for what is and is not enforced today.

Credentials and provider status

Use the AWS SDK's supported credential chain. Select a profile with --profile and validate access before a purchase.

  • Recommendation data and purchase APIs can change outside this repository.
  • See Implementation Status for per-service maturity.
  • configure-azure and configure-gcp bootstrap credentials for the self-hosted platform, not for this CLI - see cloud setup.

Related components

This component owns the CLI under cmd and its CLI documentation. It does not own the web dashboard, MCP server, or deployment infrastructure.

License and attribution

CUDly is maintained by LeanerCloud and licensed under the Open Software License 3.0. See the repository license and attribution files for third-party notices.

About

CUDly CLI: discover and purchase AWS, Azure, and GCP reserved capacity and savings plans from the command line.

Topics

Resources

Contributing

Security policy

Stars

31 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages