@wevion/cli
v1.0.2982
Published
Wevion API command-line interface — generated from the public OpenAPI spec
Readme
@wevion/cli
Command-line access to the Wevion API. Manage ad accounts,
campaigns, insights, creatives and everything else the API exposes — straight
from your terminal or a script. Every API-key-auth endpoint in the public spec is
a command, and successful responses come back as JSON on stdout, so it's easy to
pipe into jq or a script.
Requires Node.js 22+.
Install
npm install -g @wevion/cli
# or run without installing:
npx @wevion/cli listAuthenticate
You need a Wevion API key (create one in the Wevion app under Settings → API keys). Then log in once:
wevion login # prompts for the key and stores it securelyThe key is saved under $XDG_CONFIG_HOME/wevion/config.json or
~/.config/wevion/config.json (on Windows: %APPDATA%\Wevion\config.json;
readable only by you). In CI or scripts, skip the prompt with an env var instead:
export WEVION_API_KEY=sk_live_xxxLog out (delete the stored key) with wevion logout.
Usage
wevion <command> [--flag value ...]Discover what's available:
wevion list # all commands, grouped by area (ad-accounts, campaigns, …)
wevion help <command> # flags, required params and the underlying endpointExamples:
# List your ad accounts (paginated), filtered by name
wevion get-api-v1-ad-accounts --limit 10 --search brand
# Send a request body with individual flags…
wevion post-api-v1-ad-accounts-assign-all --connected true
# …or pass the whole JSON body at once
wevion post-api-v1-ad-accounts-assign-all --json '{"connected":true}'
# Pipe JSON output into jq
wevion get-api-v1-ad-accounts --limit 50 | jq '.data[].name'Each command mirrors one API endpoint: path, query and supported header
parameters become --flags using their exact OpenAPI names, and request-body
fields are --flags too (use --json '<raw>' to send a body verbatim).
wevion help <command> shows exactly which are required.
For LLMs & agents
Driving the CLI from an agent (e.g. Claude Code) with no prior Wevion knowledge? Start with one command — a self-contained primer covering auth, how commands map to endpoints, parameter rules, and the output/exit-code contract:
wevion agentThen discover and inspect commands as structured JSON:
wevion list --json # every command: command, method, path, params, body
wevion help <command> --json # one command's exact parameter/body schemaConfiguration
Resolved in this order (first wins):
| Setting | Sources |
| -------- | --------------------------------------------------------------------- |
| API key | WEVION_API_KEY env → stored login (wevion login) |
| Base URL | --base-url → WEVION_BASE_URL env → stored login config → default https://api.wevion.ai |
To target staging, point the base URL at https://api-stage.wevion.ai:
wevion --base-url https://api-stage.wevion.ai get-api-v1-ad-accounts
# or: export WEVION_BASE_URL=https://api-stage.wevion.aiExit codes
0 on success, 1 on an API/network/runtime error (HTTP errors print the
request line and response body to stderr),
2 on a usage error (unknown command, missing required flag, no API key),
3 when the CLI is too old for the API — run npm i -g @wevion/cli@latest.
The command set is derived from the Wevion API's live OpenAPI spec and
cached briefly. Offline or non-OK spec fetches fall back to the last valid cache
or bundled snapshot, so commands normally track the current API while still
working without the network. The CLI checks npm for a newer version and prints an
upgrade hint when one exists — set NO_UPDATE_NOTIFIER=1 to silence it. Full
endpoint details: api.wevion.ai/docs.
