lipafy CLI

The lipafy CLI stores a Lipafy API key locally and wraps curl.

When a command targets your configured Lipafy API host, the CLI injects the Authorization header. It does not inject the token for other hosts.

Install

$npm install -g lipafy

The published package is lipafy.

Configure

$lipafy login --api-base https://api.lipafy.xyz

For CI or scripts:

$LIPAFY_TOKEN=lip_live_xxx LIPAFY_API_BASE=https://api.lipafy.xyz lipafy whoami

Credentials are stored at ~/.lipafy/credentials.json. Environment variables LIPAFY_TOKEN and LIPAFY_API_BASE override the stored file.

Commands

CommandWhat it does
lipafy login [--token <token>] [--api-base <url>]Store credentials locally
lipafy logoutRemove stored credentials
lipafy whoamiShow the logged-in account
lipafy balanceShow wallet balance
lipafy curl <args...>Pass through to curl and inject the bearer token for Lipafy URLs
lipafy --versionPrint the CLI version
lipafy --helpPrint help

How token injection works

The CLI compares hosts with new URL(arg).host === new URL(apiBase).host.

URLAPI baseInjects?
https://api.lipafy.xyz/v1/wallethttps://api.lipafy.xyzYes
https://api.lipafy.xyz/gateway/xhttps://api.lipafy.xyzYes
https://evil.example/api.lipafy.xyz/https://api.lipafy.xyzNo
https://api.github.com/...https://api.lipafy.xyzNo

Example

$lipafy curl https://api.lipafy.xyz/gateway/demo.echo/ \
> -H "content-type: application/json" \
> -d '{"hello":"world"}'

This sends the same request as curl, with your Lipafy bearer token added.