Skip to main content

Agent and CLI for managing AWS EC2 machines (instances) — launch, inspect, start/stop, and operate fleets.

Project description

ec2-cli

Agent and CLI for managing AWS EC2 machines (instances) — launch, inspect, start/stop, and operate fleets.

Audience

An AWS user or mesh agent who wants a single at-a-glance answer to "what am I running and what is it costing me" without opening the AWS console.

Before → After

Before: Today you stitch describe-instances and Cost Explorer queries by hand to answer "what am I running + spending."

After: ec2 overview gives you the fleet and cost figures in one command; ec2 instance manages power and limits; ec2 monitor watches spend against limits.

Why it matters

Cost surprise is the #1 EC2 pain. A single trustworthy "running + spend + forecast" view turns reactive bill-shock into a glanceable habit.

Usage

ec2 overview

Live dashboard: fleet listing plus four EC2-service cost figures (MTD, YTD, end-of-month forecast, end-of-year forecast).

ec2 overview
ec2 overview --json

ec2 instance

Manage instances — list, start, stop, and set spend limits.

ec2 instance                          # list instances
ec2 instance start <id> --yes       # start an instance
ec2 instance stop <id> --yes        # stop an instance
ec2 instance limit <id> <amount> --monthly  # set a spend cap

ec2 monitor

Spend monitoring — evaluate against limits, manage a background daemon.

ec2 monitor check                    # evaluate once, alert on breach
ec2 monitor start                    # start the background daemon (~5 min loop)
ec2 monitor stop                     # stop the daemon
ec2 monitor status                   # report daemon running/stopped

Cost figures

The per-machine cost figure is an estimate: spot or on-demand hourly rate × running hours + attached EBS cost. It excludes RI/Savings-Plan discounts and data transfer. Cost Explorer is the billed-truth source.

Monitor scope

Monthly total spend limits are enforced end-to-end with real Cost Explorer data. Per-machine limits and yearly totals are a known follow-up (they require a price/usage-gathering layer).

What you get

  • An agent-first CLI cited from teken (afi-cli) — the runtime package has no third-party dependencies.
  • A mesh identityculture.yaml (suffix + backend) and the matching prompt file (CLAUDE.md for backend: claude).
  • The canonical guildmaster skill kit (11 skills) under .claude/skills/, vendored cite-don't-import. See docs/skill-sources.md.
  • A build + deploy baseline — pytest, lint, the agent-first rubric gate, and PyPI Trusted Publishing wired into GitHub Actions.

Quickstart

uv sync
uv run pytest -n auto                 # run the test suite
uv run ec2 whoami  # identity from culture.yaml (command is `ec2`; dist is `ec2-cli`)
uv run ec2 learn   # self-teaching prompt (add --json)
uv run teken cli doctor . --strict    # the agent-first rubric gate CI runs

CLI

Verb What it does
whoami Report this agent's nick, version, backend, and model from culture.yaml.
learn Print a structured self-teaching prompt.
explain <path> Markdown docs for any noun/verb path.
overview Live dashboard: fleet + EC2 cost figures (MTD, YTD, forecasts).
doctor Check the agent-identity invariants (prompt-file-present, backend-consistency).
instance Manage instances (list, start, stop, spend limit).
monitor Spend monitoring (check, daemon start/stop/status).
cli overview Describe the CLI surface itself.

Every command supports --json. Results go to stdout, errors/diagnostics to stderr (never mixed). Exit codes: 0 success, 1 user error, 2 environment error, 3+ reserved.

Make it your own

  1. Rename the package ec2/ and the ec2-cli CLI/dist name throughout pyproject.toml, the package, tests/, sonar-project.properties, and this README.md. The name is hard-coded in ~100 places, so list every occurrence first — see the git grep discovery command in CLAUDE.md, the authoritative rename procedure.
  2. Edit culture.yaml with your suffix and backend.
  3. Rewrite CLAUDE.md for your agent and run /init.
  4. Re-vendor only the skills you need from guildmaster (see docs/skill-sources.md).

See CLAUDE.md for the full conventions (version-bump-every-PR, the cicd PR lane, deploy setup).

License

MIT — see LICENSE.

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

ec2_cli-0.4.0.tar.gz (172.2 kB view details)

Uploaded Source

Built Distribution

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

ec2_cli-0.4.0-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file ec2_cli-0.4.0.tar.gz.

File metadata

  • Download URL: ec2_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 172.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ec2_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7f186cd396cf3e70872ae0a08091465027b553cc9eda2fbaf1a628db0d5101a6
MD5 9cfa474538df88413ec4970759aeb683
BLAKE2b-256 b938b223f29ce708d85624f6a9f9935de8cc04c209717dc8fa161f8380584344

See more details on using hashes here.

File details

Details for the file ec2_cli-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ec2_cli-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ec2_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e3891f5b82d519ce7cdafa34c4b3c28b304ae765172be7a7505b61a6c2013d2
MD5 de3f2ff8c3530974e73488ca37916ebd
BLAKE2b-256 b41421d5f617dc34633047c6c8e42bbff6f60df94c026c96bd78443f04274fea

See more details on using hashes here.

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