CLI-based analytics setup for builders
How to Set Up Analytics from Your Terminal with the Amplitude CLI Wizard
Set up product analytics in minutes. The Amplitude CLI Wizard detects your framework, proposes events from your codebase, and instruments your app in one terminal session.
The Amplitude CLI Wizard (npx @amplitude/wizard) is a one-command setup tool that installs, instruments, and verifies your analytics implementation directly from your terminal. It detects your framework, reads your codebase, proposes custom events, and confirms data is flowing before it exits.
What the CLI Wizard does
The Amplitude CLI Wizard handles the full analytics setup sequence in a single terminal session: authentication, framework detection, event instrumentation, and data verification. Run npx @amplitude/wizard in your project directory, and it walks through four steps without requiring you to read SDK documentation or plan an event taxonomy upfront.
Step 1: Authenticate. The wizard will sign you up for Amplitude, or allow you to log in to your existing organization and project.
Step 2: Detect your framework. It scans your project to identify your stack. The wizard supports curated support for 18+ frameworks including Next.js, Vue, Swift, Android, Django, Flask, Flutter, Go, and Unity, using Amplitude's 11 language and platform SDKs. Web projects use Browser SDK 2 or Browser Unified SDK depending on your setup.
Step 3: Propose and instrument events. An Amplitude AI agent reads your codebase, identifies routes, pages, and key flows, then proposes tracking events based on what your app actually does. It waits for your approval before writing any code. You can chat with the agent and refine your event plan before instrumenting.
Step 4: Verify data flow. The wizard confirms that events reach your Amplitude project before it exits. You can open the Amplitude Debugger to watch test events arrive in real time.
The wizard also configures Autocapture (sessions, clicks, page views, forms), Session Replay, Feature Experimentation, and Guides and Surveys during the same run (in SDKs where those features are available). One command covers the full Amplitude stack, not just basic event tracking.
Prerequisites and installation
The Amplitude CLI Wizard requires Node.js 20+ and runs via npx, so there is no global installation needed. Open your terminal, navigate to your project directory, and run npx @amplitude/wizard. The wizard downloads and launches the setup flow.
In interactive mode, the wizard opens your browser for OAuth login and walks you through selecting (or creating) an org and project. You don't need to manually copy an API key. In agent mode (--agent or --ci), authentication and project selection happen automatically, so the entire setup runs without human input.
A few flags worth knowing:
- --help lists all subcommands and options
- --menu lets you manually pick your framework instead of relying on auto-detection
- --agent or --ci runs the wizard in non-interactive mode for headless environments, handling auth and project selection automatically
- Checkpoint resume: if you stop the wizard with Ctrl+C, it crashes, or you close your terminal, it saves a checkpoint. Run the same command in the same directory to resume where you left off
If you don't have an Amplitude account yet, sign up for free (the Starter plan gives you 10K MTUs and up to 2M events at no cost). The wizard will walk you through the rest.
Framework-specific setup examples
The wizard adapts its instrumentation to your detected stack. Here's what to expect for the most common builder frameworks.
Next.js
The wizard detects Next.js projects (both App Router and Pages Router) and installs the Browser SDK 2 or Unified SDK. It identifies your route structure, proposes page view events for each route, and suggests custom events for forms, CTAs, and key interactions it finds in your components. For server-side rendering setups, the wizard places the SDK initialization in the correct client-side entry point so analytics code never runs on the server.
A typical Next.js run takes under five minutes from npx @amplitude/wizard to verified events in your Amplitude project.
React (single-page app)
For standalone React apps (Create React App, Vite, or custom builds), the wizard installs the browser SDK and scans your component tree for interactive elements. It proposes events for button clicks, form submissions, and navigation changes. If your app uses React Router, it maps routes to page view events.
Python (Django and Flask)
The wizard detects Django and Flask projects and installs the Python SDK. It identifies view functions, URL patterns, and API endpoints to propose server-side events. Because Python apps handle business logic on the server, the wizard focuses on tracking API calls, authentication flows, and key transactions rather than UI interactions.
Flutter
For Flutter mobile apps, the wizard installs the Flutter SDK and proposes events based on your widget tree and navigation structure. It covers both iOS and Android targets in a single run.
Using the CLI with AI coding agents
The Amplitude CLI Wizard is built to work inside the AI coding tools that builders already use. Instead of context-switching to a dashboard or reading docs in a browser, you can set up and query analytics from the same environment where you write code.
Claude Code. Install the Amplitude plugin for Claude Code, which provides MCP tools alongside built-in slash commands. After installing, run /mcp in Claude Code and follow the browser prompts to log in. The plugin includes commands like /amplitude:create-chart, /amplitude:create-dashboard, /amplitude:instrument-events, /amplitude:replay-ux-audit, and /amplitude:weekly-brief.
Cursor and VS Code. Connect the Amplitude MCP server to query your analytics data from any MCP-compatible client. Ask questions like "what's my conversion rate this week" or "show me the top events by volume" directly from your IDE.
Agent mode. Run npx @amplitude/wizard --agent for a non-interactive setup that works in CI/CD pipelines and automated environments. Combined with --ci, the wizard skips all interactive prompts and uses configuration defaults or environment variables.
Slack and Teams. After the CLI sets up your project, connect Amplitude to your team's messaging tool to share insights, create charts, and run queries where your team already communicates.
Verifying your setup
After the wizard finishes instrumentation, it runs a verification step that sends test events to your Amplitude project and confirms they arrive. This happens automatically as the final stage of the wizard flow, so you don't need to write any test scripts.
To verify manually or debug later:
- Open the Amplitude Debugger in your project settings. It shows events arriving in real time, including event names, properties, user IDs, and timestamps.
- Fire a few actions in your app (click a button, navigate between pages, submit a form) and confirm the corresponding events appear in the debugger.
- Create your first chart. The wizard prompts you to build a chart after verification, so you can immediately visualize the data you're collecting.
If events aren't appearing, the most common issues are API key mismatches (double-check your key in Settings > Projects) or framework detection picking the wrong SDK. Use the --menu flag to manually select your framework and re-run the wizard.
CLI Wizard vs. manual SDK setup
The CLI Wizard is the recommended path for most teams getting started with Amplitude Analytics, but it's not the only option. Here's when to use each approach.
For detailed manual setup instructions, see the Amplitude Quickstart or the individual SDK documentation for your platform.
Get started with the Amplitude CLI Wizard
Setting up analytics is the one thing standing between building your product and understanding how people use it. The CLI Wizard removes that friction. Run npx @amplitude/wizard in your project directory, or sign up for a free account to get an API key.
Try Amplitude for free today to set up analytics from your terminal in under five minutes.
Frequently asked questions about the Amplitude CLI Wizard
The wizard runs per directory. In monorepos with multiple sources, run it from each source's folder (for example, web/ for your browser app and backend/ for Node). Each run creates its own configuration scoped to that source.
Yes. The wizard works with any Amplitude plan, including the free Starter plan (10K MTUs, up to 2M events). No paid features are required. The Starter plan gives you full platform access with volume and capability limits, not a stripped-down feature set.
The AI agent waits for your approval before writing any code. You review each proposed event individually and accept or reject it. Nothing is instrumented without your explicit confirmation.
Yes. Use --agent or --ci mode for non-interactive runs. The wizard saves checkpoints, so interrupted runs resume where they left off. This is useful for automated onboarding in new repositories.
Yes. The wizard detects server-side frameworks (Django, Flask, Go, Node.js, Java) and installs the appropriate server SDK. Server-side instrumentation follows the same detect, propose, and instrument flow as client-side setups.
Run npx @amplitude/wizard in your project directory. The wizard handles authentication, framework detection, SDK installation, event proposal, and data verification in a single session. Most frameworks complete in under five minutes.