Build

Wellfriend CLI reference

Install the wellfriend command, compress a PDF in one line, then run any tool or pipeline and call any endpoint from a terminal or CI job.

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.

Install the CLI
npm install -g wellfriend-document-sdk@latest

Quickstart

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.

CLI: compress a PDF to a file
npm install -g wellfriend-document-sdk@latest
wellfriend login   # or set WELLFRIEND_API_KEY
wellfriend compress-pdf input.pdf -o output.pdf
The same job as a complete program
#!/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.pdf

Tools

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.

Compress with a setting, merge two files
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 it

Pipelines

Up to ten steps run on one file in one pipeline; each step reads the previous step's output on the server.

Compress, then OCR
wellfriend pipeline input.pdf --step compress-pdf --step ocr-pdf -o output.pdf

Documents, 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.

Lists and any endpoint
wellfriend documents list --json
wellfriend operations wait "$OPERATION_ID"
wellfriend api GET /usage

Errors and exit codes

Output is plain text; add --json for scripts. Progress goes to stderr.

CodeMeaning
0Success
1The API or the operation failed (a failed wait too)
2Usage error: fix the command
3Authentication 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.

The options it takes
wellfriend webhooks verify --help

Help

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.