spiko-cli
v0.4.1
Published
Effect-native CLI for Spiko's APIs.
Downloads
664
Readme
spiko-cli
Command-line access to every Operation in the committed Spiko Public, Investor, and Distributor OpenAPI documents.
This is an independent project and is not an official Spiko product.
Installation
npm install --global spiko-cli
spiko --helpCommands
spiko call <family> <resource> <action> [flags]
spiko operations list <family>
spiko operations describe <family> <operation-id>
spiko --wizardUse discovery instead of guessing names:
spiko operations list public
spiko operations describe investor "accounts.createAccount"Inputs, enum values, requiredness, and descriptions come from OpenAPI:
spiko call public funds get \
--fund-id 00000000-0000-4000-8000-000000000001
spiko call investor accounts create \
--payload ./account.json \
--confirm
spiko call distributor investor-documents upload \
--investor-id 00000000-0000-4000-8000-000000000001 \
--type official-id \
--file ./identity.pdf \
--confirmJSON request bodies always use --payload <file>. Payload files are validated and re-encoded against the OpenAPI schema before sending, so unknown properties and JSON formatting are not forwarded byte-for-byte. Multipart Operations expose typed form and file flags instead. Every method except GET and HEAD requires --confirm; the wizard's final run prompt does not replace it.
The wizard requires interactive stdin and stdout:
spiko --wizardConfiguration
Public calls need no credentials. Optional base URL overrides:
SPIKO_PUBLIC_API_BASE_URL
SPIKO_INVESTOR_API_BASE_URL
SPIKO_DISTRIBUTOR_API_BASE_URLInvestor authentication uses either:
SPIKO_INVESTOR_ACCESS_TOKENor both:
SPIKO_INVESTOR_CLIENT_ID
SPIKO_INVESTOR_CLIENT_SECRETDistributor authentication requires:
SPIKO_DISTRIBUTOR_CLIENT_ID
SPIKO_DISTRIBUTOR_CLIENT_SECRETOutput and exits
A successful invocation writes one JSON document to stdout:
{
"ok": true,
"operation": "Get Fund",
"data": {}
}Failures write one JSON document to stderr. Exit statuses are:
0: success1: configuration, remote, or internal failure2: invalid command/input, missing confirmation, or non-interactive wizard130: wizard cancellation
Binary results are represented as { "encoding": "base64", "value": "..." } inside data.
License
MIT
