A Go CLI for searching and invoking services on the UnifAI network — DeFi, token data, social media, web search, news, travel, sports, and more.
Note: This Go CLI supports search and invoke only. It does not support transaction signing. For full functionality including autonomous transaction signing (Solana, EVM, Polymarket, Hyperliquid, Jito bundles, etc.), use the recommended JS CLI from the unifai-sdk-js package:
npx -p unifai-sdk unifai search --query "swap usdc to sol" npx -p unifai-sdk unifai invoke --action "Jupiter--5--swap" --payload '{"amount":100}' --signOr install globally:
npm install -g unifai-sdk unifai search --query "swap usdc to sol"See more at unifai-sdk-js.
brew tap unifai-network/homebrew-unifai-cli
brew install unifaigit clone https://github.com/unifai-network/unifai-cli.git
cd unifai-cli
make build
./bin/unifai version- Get an API key from UnifAI Console.
- Initialize configuration:
unifai config init- Edit
~/.config/unifai-cli/config.yamland add your API key. - Run your first search:
unifai search --query "swap usdc to sol"Search available blockchain services and actions.
unifai search --query "swap usdc to sol"
unifai search --query "transfer tokens" --limit 10 --offset 0
unifai search --query "defi protocols" --include-actions action1,action2Execute a blockchain action. Returns a response with an approval link for on-chain transactions. Transaction signing is not supported in this Go CLI — use the JS CLI for autonomous signing.
unifai invoke --action "Meteora--29--swap" --payload '{"amount":100}'
unifai invoke --action "MyAction--1--execute" --payload @payload.json
unifai invoke --action "MyAction--1--execute" --payload '{"x":1}' --max-retries 3 --timeout 60sManage configuration.
unifai config init # Create config template
unifai config show # Show effective config and sourcesPrint build version.
unifai versionLocation: ~/.config/unifai-cli/config.yaml
apiKey: "your-api-key"
endpoint: ""
timeoutSeconds: 50Reference template: configs/config.example.yaml
| Setting | Flag | Environment variable | Config file |
|---|---|---|---|
| API key | --api-key |
UNIFAI_AGENT_API_KEY |
apiKey |
| Endpoint | --endpoint |
UNIFAI_ENDPOINT |
endpoint |
| Timeout | --timeout |
— | timeoutSeconds |
invoke supports flexible payload handling:
- Inline JSON:
--payload '{"a":1}' - From file:
--payload @payload.json - Force mode:
--payload-format auto|object|string
| Mode | Behavior |
|---|---|
auto |
Valid JSON parsed as object; otherwise raw string |
object |
Must be valid JSON; error if not |
string |
Sent as raw string |
- Default: concise human-readable output
--json: raw API JSON responseinvokeextractspayloadfield from response when present
| Exit code | Meaning |
|---|---|
| 0 | Success |
| 1 | API / runtime error |
| 2 | Argument/usage error |
See CONTRIBUTING.md.