eWeWasl Docs

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.

npx @ewasl/cli login --api-key ewasl_xxxxxxxx
npx @ewasl/cli posts list --status SCHEDULED

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):

  1. --api-key / --base-url flags
  2. EWASL_API_KEY / EWASL_BASE_URL environment variables (use these in CI)
  3. the key stored by ewasl login at ~/.ewasl/config.json (written 0600)
# Local: store a key for reuse (validated against the API before saving)
ewasl login --api-key ewasl_xxxxxxxx
ewasl whoami
ewasl logout
 
# CI: no stored state
export EWASL_API_KEY=ewasl_xxxxxxxx
ewasl posts list --json

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

CommandScopeDescription
login / logout / whoamiManage stored credentials
posts listposts:readList posts (--status, --platform, --limit)
posts get <id>posts:readGet a single post
posts create --content <t> --accounts <ids>posts:createCreate now, or schedule with --schedule <iso>
posts delete <id>posts:createDelete a draft / scheduled post
connectionsposts:readList connected social accounts
analytics summaryposts:readDashboard KPI summary
analytics optimal-times --platform <p>posts:readAI-recommended posting times
ads campaignsads:readList ad campaigns
ads insightsads:readAd KPI summary (--days, --account)
ads pause <id>ads:writePause a campaign (dry-run unless --commit)
ads resume <id>ads:writeResume 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:

# Preview-pause every active campaign
ewasl ads campaigns --status ACTIVE --json | jq -r '.data[].id' | while read id; do
  ewasl ads pause "$id" --json
done

On this page