Skip to main content
@waniwani/cli is the official command-line tool for Waniwani. It wires a local repo to a Waniwani agent, runs your MCP server locally against the hosted playground, and removes the manual steps of provisioning GitHub, Vercel, and API keys. The CLI is optional. @waniwani/sdk works on its own — the CLI is the fastest way to skip the dashboard for project setup and local development.

Install

Requires Node.js 20 or later.

Quickstart

Three commands. Your local MCP server is now reachable from ChatGPT, Claude, and Cursor through the Waniwani playground, with no tunnel setup.

Commands

login

Runs the OAuth2 PKCE flow: spins up a local callback server on port 54321, opens your browser to app.waniwani.ai, exchanges the code for an access token, and persists access + refresh tokens to .waniwani/settings.json in the current directory. If you’re already logged in with an expired token, it auto-refreshes and exits. Pass --no-browser to print the URL instead of launching a browser (useful on headless machines).

logout

Clears the stored auth tokens. Keeps non-auth config (like apiUrl) intact. No-op if you’re already logged out.

connect

Interactive only. Walks you through:
  1. Pick an organization. If you’re in one org, it’s auto-selected.
  2. Pick or create an agent. Either select an existing project, create a new managed agent (Waniwani provisions a GitHub repo + Vercel project from the MCP distribution template with API keys pre-wired), or create a new external agent (you host the MCP server; the CLI gives you a production API key to set as WANIWANI_API_KEY).
  3. Write the binding. Writes waniwani.json at the repo root with $schema, orgId, and projectId. If the file already exists, the CLI merges the keys in; if the shape isn’t recognized, it prints the snippet for you to paste. If a legacy waniwani.config.ts is present, it’s removed after the JSON file is written.
Re-run anytime to switch the repo to a different agent.

Managed vs external agents

See Deployment for the full picture.

dev

Interactive only. The end-to-end local dev loop:
  1. Ensures you’re logged in (runs login if not) and that waniwani.json has a projectId (runs connect if not).
  2. Detects your package manager (bun / pnpm / yarn / npm) and spawns the dev script with PORT set.
  3. Waits for the local server to bind to the port.
  4. Creates a dev session against the Waniwani API and starts a heartbeat.
  5. Opens the playground at app.waniwani.ai/agents/<projectId>/playground?localMode=1 so chat traffic routes to your local server.
  6. Ctrl-C tears the dev session down cleanly.
Options:
  • -p, --port <port> — Port the local MCP listens on. Defaults to devPort in waniwani.json, or 3000.
dev runs your existing dev script — it does not start the MCP for you. The script must bind to process.env.PORT.

Global flags

Configuration

Auth & local state — .waniwani/settings.json

Per-repo, gitignored. Holds OAuth tokens and the resolved API URL:
Access tokens auto-refresh on 401. Add .waniwani/ to your .gitignore.

Project config — waniwani.json

Shared with @waniwani/sdk. waniwani connect writes $schema, orgId, and projectId; other fields are optional and consumed by the SDK and the dev command:
waniwani.json
The $schema field unlocks autocomplete and validation in editors that support JSON Schema (VS Code, JetBrains, Neovim with LSP). It’s ignored at runtime. Legacy waniwani.config.ts files are still read for now (with a deprecation warning), but new projects should use waniwani.json. Running waniwani connect against a repo that has a .ts file removes it and writes a .json in its place.

Environment variables

Resolution order for the API URL: env var → waniwani.json.waniwani/settings.json → default. For auth: API key → OAuth tokens (with auto-refresh).

Typical workflow

To start a fresh project, clone the template first:

For AI coding agents

If you’re Claude Code, Cursor, or another AI agent setting up Waniwani in a user’s repo:
  1. Confirm the user is in an MCP project (@waniwani/sdk in package.json, or it’s the distribution template). If not, scaffold one with the SDK quickstart first.
  2. Run waniwani login — opens the browser; the user authenticates once.
  3. Run waniwani connect — interactive; ask the user which org / agent they want, or recommend “managed” if they don’t already host.
  4. Run waniwani dev to verify the bridge works.
The CLI is interactive — connect and dev cannot run under --json. Pair it with the agent skill for code generation:
The skill teaches your agent the SDK APIs (flows, tracking, widgets, knowledge base). The CLI handles platform wiring. They’re independent — install whichever you need.

Source

MIT licensed, like the rest of the Waniwani stack.