@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
Quickstart
Commands
login
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
apiUrl) intact. No-op if you’re already logged out.
connect
- Pick an organization. If you’re in one org, it’s auto-selected.
- 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). - Write the binding. Writes
waniwani.jsonat the repo root with$schema,orgId, andprojectId. 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 legacywaniwani.config.tsis present, it’s removed after the JSON file is written.
Managed vs external agents
See Deployment for the full picture.
dev
- Ensures you’re logged in (runs
loginif not) and thatwaniwani.jsonhas aprojectId(runsconnectif not). - Detects your package manager (
bun/pnpm/yarn/npm) and spawns the dev script withPORTset. - Waits for the local server to bind to the port.
- Creates a dev session against the Waniwani API and starts a heartbeat.
- Opens the playground at
app.waniwani.ai/agents/<projectId>/playground?localMode=1so chat traffic routes to your local server. - Ctrl-C tears the dev session down cleanly.
-p, --port <port>— Port the local MCP listens on. Defaults todevPortinwaniwani.json, or3000.
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:
.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
$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
For AI coding agents
If you’re Claude Code, Cursor, or another AI agent setting up Waniwani in a user’s repo:- Confirm the user is in an MCP project (
@waniwani/sdkinpackage.json, or it’s the distribution template). If not, scaffold one with the SDK quickstart first. - Run
waniwani login— opens the browser; the user authenticates once. - Run
waniwani connect— interactive; ask the user which org / agent they want, or recommend “managed” if they don’t already host. - Run
waniwani devto verify the bridge works.
connect and dev cannot run under --json. Pair it with the agent skill for code generation:
Source
- npm:
@waniwani/cli - GitHub: Waniwani-AI/cli
- Issues: github.com/WaniWani-AI/cli/issues