Install
The wellfriend command ships in the wellfriend-document-sdk npm package and needs Node.js 20 or later. What the registry serves now: 1.0.0 on npm.
npm install -g wellfriend-document-sdk@latestQuickstart
Create a key in the dashboard (/dashboard/developer-api/keys) and set it as WELLFRIEND_API_KEY on your server; the client reads it, and https://wellfriend.dev/api/v2 is the default address.
npm install -g wellfriend-document-sdk@latest
wellfriend login # or set WELLFRIEND_API_KEY
wellfriend compress-pdf input.pdf -o output.pdf#!/usr/bin/env bash
# Needs the wellfriend CLI: npm install -g wellfriend-document-sdk@latest
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
set -euo pipefail
export WELLFRIEND_API_KEY="${WELLFRIEND_API_KEY:-YOUR_API_KEY}"
wellfriend compress-pdf input.pdf -o input-wellfriend.pdfTools
Every tool is a command: wellfriend <tool> <input...> -o <output> [--param name=value ...]. Results always go to a file, never to the terminal; without -o the file is named after the input and the tool. wellfriend run <toolId> runs a tool by its id.
wellfriend compress-pdf input.pdf -o small.pdf --param level=strong
wellfriend merge-pdf a.pdf b.pdf -o merged.pdf
wellfriend quote --help # price a run before you send itPipelines
Up to ten steps run on one file in one pipeline; each step reads the previous step's output on the server.
wellfriend pipeline input.pdf --step compress-pdf --step ocr-pdf -o output.pdfDocuments, operations and every other endpoint
wellfriend documents list, get and download; wellfriend operations get and wait. wellfriend api <METHOD> <path> [--data json] calls any other endpoint with your key.
wellfriend documents list --json
wellfriend operations wait "$OPERATION_ID"
wellfriend api GET /usageErrors and exit codes
Output is plain text; add --json for scripts. Progress goes to stderr.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | The API or the operation failed (a failed wait too) |
| 2 | Usage error: fix the command |
| 3 | Authentication error: check the key |
Webhooks
wellfriend webhooks verify checks a saved delivery's signature over its raw body, with a five-minute tolerance. See /docs/webhooks/signatures.
wellfriend webhooks verify --helpHelp
wellfriend --help lists the commands, wellfriend <command> --help shows one, and wellfriend --version prints the version. wellfriend login stores the key in your user's config folder, readable only by you; wellfriend logout removes it.