Install the plugin in your coding agent
The Cloud ex Machina plugin lets you ask your coding agent about your cloud from your terminal. After a one-time browser sign-in, it answers with live data from your Cloud ex Machina organization: cost drivers, savings opportunities, commitment coverage, workload context, and the cost of a change before you apply it.
The plugin runs in Claude Code and Codex. It is public: the source is on GitHub at
cxmlabs/cxm-plugin, and the cxm command is on npm as
@cloudexmachina/cxm.
Requirements
- Claude Code or Codex installed and working in your terminal.
- Node.js 22 or later. Check with
node --version. - A Cloud ex Machina account with access to at least one organization. To get one, write to hello@cloudexmachina.io.
Step 1 — Install and sign in
npx @cloudexmachina/cxm@latest install
The command:
- finds Claude Code and Codex on your machine;
- shows the commands it will run, and asks you to confirm;
- installs the plugin into each agent: its skills, its commands, and its hooks;
- opens your browser to the Cloud ex Machina sign-in page. Sign in as usual, then choose the organization the agent uses.
Cloud ex Machina stores a short-lived access token at ~/.config/cxm/credentials.json, readable
only by you.
Options: --agent claude or --agent codex installs into one agent only, --yes skips the
confirmation, and --no-login skips the sign-in.
Open a new agent session after installing so the skills, commands, and hooks load.
Step 2 — Ask your agent
Start your agent in a repository and ask in plain language:
- "What are my biggest cloud cost drivers this month?"
- "Where am I wasting money? Show the opportunities with estimated savings."
- "What is my Reserved Instance and Savings Plan coverage?"
- "I'm about to add three large instances — what will that cost per month at our rate?"
- "Is there a cheaper equivalent for this instance type?"
- "Who owns this resource, and which code manages it?"
The matching skill fires automatically and answers with your live data.
You can also edit a Terraform or CloudFormation file, or run an aws create command. The plugin
then prompts the agent to price and enrich the change before you apply it.
Run commands directly
The same tool works as a plain command:
cxm whoami # confirm which organization you are connected to
cxm price --service ec2 --instance-type r6i.2xlarge --region eu-west-1
The plugin puts cxm on your PATH through a symlink in ~/.local/bin when an agent session
starts. If that directory is not on your PATH, add it, or use npx @cloudexmachina/cxm@latest
instead of cxm.
Update
Run the install again. It refreshes the plugin source and moves each agent to the latest version. Your credentials survive an update, so you do not sign in again. Restart the session afterwards.
npx @cloudexmachina/cxm@latest install --no-login
Install by hand
If you prefer to run each agent's commands yourself:
# Claude Code
claude plugin marketplace add https://github.com/cxmlabs/cxm-plugin.git
claude plugin install cxm-agent-plugin@cxm-marketplace
# Codex
codex plugin marketplace add cxmlabs/cxm-plugin --ref main
codex plugin add cxm-agent-plugin@cxm-marketplace
Then open one agent session, so cxm lands on your PATH, and sign in with cxm login.
To update by hand:
claude plugin marketplace update cxm-marketplace && claude plugin update cxm-agent-plugin@cxm-marketplace
codex plugin marketplace upgrade cxm-marketplace && codex plugin add cxm-agent-plugin@cxm-marketplace
Install into one project only
cxm setup copies the skills into the current repository (.claude/skills or .agents/skills) and
merges the hooks into that project's settings. You re-run it per repository. Use it when you want a
pinned or modified copy of the skills in one repository.
npx @cloudexmachina/cxm@latest setup
Privacy
The plugin sends pseudonymous usage data: which commands and skills ran, whether they succeeded,
how long they took, and sanitized crash reports. It does not send your prompts, the answers, or
your cloud data, unless you opt in with CXM_TELEMETRY=full. Turn it off with CXM_TELEMETRY=0
in your shell profile. The full statement is in the plugin's
privacy document.
Switch organization, sign out, or uninstall
- Switch organization: run
cxm loginagain and pick the new one. - Sign out: delete the credentials file,
rm ~/.config/cxm/credentials.json. - Uninstall: run
npx @cloudexmachina/cxm@latest uninstall, thenclaude plugin uninstall cxm-agent-plugin@cxm-marketplaceandcodex plugin remove cxm-agent-plugin@cxm-marketplace.
Troubleshooting
- "Not logged in" or "Session expired" — run
cxm loginagain. - The browser did not open — the command prints a sign-in link. Open it manually.
cxm: command not found— open one agent session first, or add~/.local/binto your PATH.npx @cloudexmachina/cxm@latest <command>works in the meantime.- Skills or commands are missing — open a new agent session so the plugin loads.
- The plugin did not update — run the install again; it updates every agent it finds.
- Wrong organization — run
cxm loginand select the correct organization on the consent screen.