Skip to main content

Install

Or run without installing:

Configuration

The CLI resolves credentials in this order (highest priority first):
  1. --api-key / --api-url flags on the command line
  2. SAFEFETCH_API_KEY / SAFEFETCH_API_URL environment variables
  3. A .safefetch config file in your home directory (~/.safefetch) or the current directory (./.safefetch)

Environment variables

.safefetch config file

Per-command flag override

Commands

send

Send an action to a target URL.
Examples: Send a basic action:
Send with a JSON body and retries:
Require human approval before delivery:
Wait for the result synchronously:
Prevent duplicate actions with a deduplication key:
Use an idempotency key to safely retry the request:

get

Retrieve a single action by its ID.
Example:

list

List actions with optional filters.
Examples: List the 20 most recent actions:
List failed actions:
Paginate through results:

approve

Approve an action that is waiting for human approval.
Example:

cancel

Cancel a pending or awaiting_approval action.
Example:

retry

Retry a failed or cancelled action.
Example:

health

Check that the SafeFetch API is reachable.

Global options

These flags apply to every command and override environment/config values:

Output

All commands print their response as pretty-printed JSON.