# Xmtp CLI Setup

> Initialize the XMTP CLI and configure environment variables. Use when setting up or changing CLI config (init, .env, gateway, env).

- Skill: `modbender/xmtp-cli-setup` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds add modbender/xmtp-cli-setup`
- Raw SKILL.md: https://api.skillmd.com/api/skills/modbender/xmtp-cli-setup/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: modbender (https://skillmd.com/u/modbender)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/modbender/xmtp-cli-setup

---


# CLI setup

Initialize your XMTP CLI configuration and set required environment variables.

## When to apply

- First-time CLI setup or generating a new ephemeral wallet
- Using an existing private key or custom gateway
- Configuring env for dev, production, or local

## Rules

- `init` – Run `xmtp init`, options, and generated `.env`
- `env-variables` – Required and optional env vars, `.env` example

## Quick start

```bash
# Ephemeral wallet, dev env (default)
xmtp init

# Existing key, production
xmtp init --private-key 0x1234... --env production
```

Read `rules/init.md` and `rules/env-variables.md` for details.

