Command-line interface (@ewasl/cli)
Publish, schedule, and manage social posts and ads from your terminal or CI with the eWasl CLI.
@ewasl/cli drives the eWasl V1 API from your terminal or CI. It's the scripting
counterpart to the REST API and the
MCP server.
Authentication
The CLI uses an API key (ewasl_*) created at Settings → API keys. Keys are
scoped — the CLI can do only what the key's scopes allow. Credentials resolve in this
order (highest priority first):
--api-key/--base-urlflagsEWASL_API_KEY/EWASL_BASE_URLenvironment variables (use these in CI)- the key stored by
ewasl loginat~/.ewasl/config.json(written0600)
OAuth-based ewasl login (browser/device flow) is on the roadmap. Today the CLI
uses API keys, which is the recommended path for server-to-server and CI use.
Commands
| Command | Scope | Description |
|---|---|---|
login / logout / whoami | — | Manage stored credentials |
posts list | posts:read | List posts (--status, --platform, --limit) |
posts get <id> | posts:read | Get a single post |
posts create --content <t> --accounts <ids> | posts:create | Create now, or schedule with --schedule <iso> |
posts delete <id> | posts:create | Delete a draft / scheduled post |
connections | posts:read | List connected social accounts |
analytics summary | posts:read | Dashboard KPI summary |
analytics optimal-times --platform <p> | posts:read | AI-recommended posting times |
ads campaigns | ads:read | List ad campaigns |
ads insights | ads:read | Ad KPI summary (--days, --account) |
ads pause <id> | ads:write | Pause a campaign (dry-run unless --commit) |
ads resume <id> | ads:write | Resume a campaign (dry-run unless --commit) |
Global flags
--json— emit raw JSON (best for scripting; the default rendering is compact text)--api-key <key>— override the resolved key for one command--base-url <url>— point at a staging / self-hosted deployment
Write actions on ads default to a dry-run preview; pass --commit to apply.
Scripting
--json plus stable exit codes make the CLI pipeline-friendly — 0 success, 1
API/runtime error, 2 not authenticated: