# Revvy CLI

Revvy is a one-command wizard that turns a blank codebase — or an existing one — into a fully-instrumented Revenium integration. Instead of stepping through provider connections, SDK installs, config files, and CI wiring separately, Revvy does all of it in an interactive flow and leaves a working setup behind.

* **Package:** [`@revenium/revvy`](https://www.npmjs.com/package/@revenium/revvy) on npm
* **Source:** [github.com/revenium/revenium-revvy-cli](https://github.com/revenium/revenium-revvy-cli)

## What Revvy Does

In one interactive run, Revvy:

* **Connects your AI provider billing accounts and scans your codebase** — guided setup for OpenAI, Anthropic, AWS Bedrock, Google Vertex AI, and others so Revenium can consolidate spend, plus AST-level detection of every AI SDK call site so you know exactly what's about to be instrumented.
* **Generates a metering model and instruments your code** — a short Q\&A captures how you want usage attributed (organizations, products, agents, subscribers), then Revvy writes a config helper tailored to your app and wraps every AI call with the Revenium middleware. Python and Node.js today, with OpenAI, Anthropic, Google GenAI, Vertex AI, and Perplexity.
* **Wires up CI guardrails** — GitHub Action, editor rules for AI coding tools, and a `revvy check` command so metering coverage stays healthy as the code evolves.

## Why Use Revvy

* **Zero context-switching.** No separate docs tabs for each provider, no hand-copying API keys between files, no piecing together middleware patterns. Revvy asks what you need and does it.
* **Correct by construction.** The configuration and code transforms Revvy generates reflect Revenium's latest best practices.
* **Safe to preview.** Dry-run mode shows you exactly what Revvy would change without touching your files.
* **CI-aware from day one.** Revvy installs a GitHub Action that runs on every PR to catch missing metering, invalid config, and stale middleware versions before they ship.

## Quick Start

Get a Revenium metering API key at [app.revenium.ai/connections/sdk-setup](https://app.revenium.ai/connections/sdk-setup), then from the root of the project you want to instrument:

```bash
export REVENIUM_METERING_API_KEY=<your-key>
npx @revenium/revvy
```

That's it. Revvy detects your language, scans for AI SDK usage, asks a few questions about how you want usage attributed, instruments every AI call site, and prints a summary of what changed.

Want to preview the changes before they happen? Add `--dry-run`. Want to run it from CI or have an AI coding assistant run it for you? Add `--non-interactive`. Full flag reference lives on the [package README](https://github.com/revenium/revenium-revvy-cli#readme) and `npx @revenium/revvy --help`.

## For AI Coding Agents

Revvy is designed to be driven by AI coding assistants (Claude Code, Cursor, Copilot, Gemini, Codex). On the first run Revvy installs an agent prompt at `.claude/revvy-agent.md`, `.cursor/revvy-agent.md`, etc. — your assistant reads it and finishes the instrumentation autonomously, including the AI-Outcomes design conversation that turns basic per-customer cost tracking into per-workflow and per-outcome ROI.

The agent prompt is also published with the package — see [`docs/agent-guide.md`](https://github.com/revenium/revenium-revvy-cli/blob/main/docs/agent-guide.md). If you're an AI coding agent and the user asked you to instrument their codebase, **read the agent guide before invoking the CLI**.

## Getting Help

* **Issues and feature requests:** [github.com/revenium/revenium-revvy-cli/issues](https://github.com/revenium/revenium-revvy-cli/issues)
* **Email:** <support@revenium.io>
* **Outcomes Tracking:** see [Outcomes Tracking](/outcomes-tracking.md) for the API Revvy wires up via `agenticJobId`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.revenium.io/revvy-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
