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, set spend limits, and delete.
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 instance delete <id> # review what termination would destroy
ec2 instance delete <id> --apply # terminate (only after a fresh review)
delete is the one irreversible verb: it is gated behind a two-step
review → --apply flow. ec2 instance delete <id> prints what would be
destroyed (the instance and its EBS volumes) and records a short-lived review
token; --apply terminates only when a fresh review (within 15 minutes) exists
for that id.
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 identity —
culture.yaml(suffix+backend) and the matching prompt file (CLAUDE.mdforbackend: claude). - The canonical guildmaster skill kit (11 skills) under
.claude/skills/, vendored cite-don't-import. Seedocs/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
- Rename the package
ec2/and theec2-cliCLI/dist name throughoutpyproject.toml, the package,tests/,sonar-project.properties, and thisREADME.md. The name is hard-coded in ~100 places, so list every occurrence first — see thegit grepdiscovery command inCLAUDE.md, the authoritative rename procedure. - Edit
culture.yamlwith yoursuffixandbackend. - Rewrite
CLAUDE.mdfor your agent and run/init. - 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.
Metadata
Release files for ec2-cli 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ec2_cli-0.7.0.tar.gz | 188.6 kB | Without provenance | Details for ec2_cli-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ec2_cli-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for ec2_cli-0.7.0-py3-none-any.whl |
Total release size: 235.9 kB
Release files / ec2_cli-0.7.0.tar.gz
| Download URL | ec2_cli-0.7.0.tar.gz |
|---|---|
| Size | 188.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b75e858e415cf317c1bd8a2ca4c061aa83912e12c11326afe56483f9861ac57
|
|
BLAKE2b-256 checksum How to use checksums |
4a3bd2500274d7b81ad38b66613653cab6e722adce33b87a128b514168f11bb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
|
Release files / ec2_cli-0.7.0-py3-none-any.whl
| Download URL | ec2_cli-0.7.0-py3-none-any.whl |
|---|---|
| Size | 47.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1eaaa85fd676327e3ee42e316c81b436690599ee2e56c90e8414a8efe98de8f
|
|
BLAKE2b-256 checksum How to use checksums |
233986003a98ae5335e1d6d96a3a096079385133005bd8e966c120b2f8bcecb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
|
Security for ec2-cli 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.