@perflo/cli
v2.8.0
Published
Perflo — one CLI for your money (gold) and your agent (pay-per-use services). Routes to the Perfolio backend and the Agent-mode backend behind a single, plain-language surface.
Readme
Perflo CLI (perflo)
One CLI for your money (gold, via the Perfolio backend) and your agent (pay-per-use services, via the Agent-mode backend). Two engines, one wallet, one identity — behind a single plain-language surface. The user never sees which backend answered.
Published on npm as @perflo/cli; installs both the perflo bin and the legacy
grant alias. (Formerly @agentgrant.cash/cli — env vars under the old
GRANTCASH_* prefix and credentials at ~/.grant-cash/ still work.)
Built on the Perfolio CLI's structure (Commander + modular cli/commands +
lib/*), merged with the agent CLI's LLM-friendly output and verb set.
Quick start
npm install
cp .env.example .env # set the backend URLs (optional — prod defaults shipped)
npm run dev -- status # run from source
npm run build && ./dist/cli/index.js statusHow routing works
| Surface | Routes to | Auth |
|---|---|---|
| money: portfolio, price, buy, sell, activity | Perfolio backend (PERFLO_API_URL) | Authorization: Bearer <accessJwt> |
| agent: search, check, fetch, transfer, revoke | Agent-mode backend (PERFLO_AGENT_URL) | Authorization: Bearer <accessJwt> |
| cards: card create/list/pay/… | Card-issuance service (PERFLO_CARDS_URL, ms-card-issuance) | perfolio-authorization: Bearer <accessJwt> |
perflo login runs ONE perfolio device handshake (browser sign-in + limit
approval) and stores a single credential — the perfolio-signed access JWT plus
the opaque pfr_ refresh token, in ~/.perflo/credentials.json (auto-migrated
from ~/.grant-cash/ on first run). That one JWT is sent to ALL THREE backends;
a 401 from any silently refreshes it once. The card service authenticates the
same JWT via the perfolio-authorization header its middleware prioritizes —
there is no separate card login and no cp_ API key.
The cards surface (virtual Mastercards for autonomous agent spending) is the
full command set merged in from the standalone PayLLM CLI: issue/fund/freeze/
close cards, watch deposits, view balance/transactions/activity, withdraw, and
pay real merchant checkouts headlessly (card pay, via Playwright). card pay
requires a one-time npx playwright install chromium.
Configuration
All URLs are env-driven — see .env.example. PERFLO_* is the
documented prefix; the legacy GRANTCASH_* names keep working as fallbacks.
Skill file
skills/perflo/SKILL.md documents the full
command surface, workflow, and error playbook for an AI assistant.
Status
Scaffold of the merged architecture with a working command set across both
engines. Money side is gold-focused by design; borrow/earn/perps endpoints are a
one-method-each extension on MoneyClient. Unified auth (CONTRACT v1): one
perfolio login mints one access JWT that both backends verify locally against
perfolio's JWKS — the CLI holds a single credential and sends it everywhere.
