
DeFi CLI
github.com/ggonzalez94/defi-cli- Category
- Developer Tools
- Rank
- No. 1645Tools index
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Business & Commerce
- Interfaces
- CLI
- Builder
- @ggonzalez94
- GitHub
- 57 stars
- Latest release
- v0.5.0
- Date
About
A command-line interface for interacting with DeFi protocols across multiple chains, enabling lending, yield farming, bridging, and swapping operations. Built specifically for AI agents and automation with JSON output and deterministic exit codes.
What it does
DeFi CLI gives scripts one vocabulary for researching markets and preparing on-chain transactions. It normalizes chains, assets, amounts, provider responses, and action records before a separate submission step sends approved work to a signer.
Why it's ranked here
The tool combines broad market coverage with unusually serious automation controls. Typed output envelopes, command schemas, canonical asset identifiers, action persistence, caching, retries, and separate planning and submission make it credible for unattended workflows. Execution support remains narrower and less uniform than quote coverage.
What's good
The strongest work sits at the boundaries. Structured inputs can replace long flag lists, field selection trims responses, and exported schemas describe constraints and authentication. Amount conversion uses arbitrary-precision integers. Provider failures receive typed errors, while cache policy can preserve stale data during temporary outages.
Tradeoffs
Provider breadth does not mean equal execution support. Some integrations only quote or query, while transaction support covers selected protocols. Certain commands require external API keys. OWS signing needs another installed command-line tool, Tempo follows a separate signing path, and local signing leaves key handling with the operator.
How to use it well
Use it for agent jobs that compare opportunities, resolve assets, create transaction plans, estimate actions, and submit through controlled wallets. Start with provider metadata and read-only queries, then inspect plans before submission. It does not remove the need for provider credentials, reliable RPC access, or deliberate signing policy.
Technical notes+
go.mod defines a Go 1.24 module built around Cobra, go-ethereum, Tempo support, YAML, file locking, and pure-Go SQLite. internal/app/runner.go assembles provider registries, the command tree, configuration, cache, action store, schema output, and typed exit handling. internal/model/types.go defines a versioned JSON envelope with request, provider, cache, warning, and partial-result metadata. internal/cache/cache.go uses SQLite WAL mode, process locking, busy retries, TTLs, and bounded stale fallback. internal/httpx/client.go maps timeouts, rate limits, authentication failures, server errors, retries, and jittered backoff into CLI errors. internal/id/id.go and internal/id/amount.go canonicalize CAIP identifiers and convert token amounts with big integers. internal/ows/cli.go shells out to OWS, passes the token as a child-process passphrase, validates returned transaction hashes, and distinguishes policy denial from signer failure. Coverage examples appear in internal/id/id_test.go and internal/ows/cli_test.go; the Makefile exposes standard, race, vet, formatting, build, and release-check targets.
Observed
- Primary language
- Go, with module metadata declaring Go 1.24.
- Interface
- Command-line application with JSON and plain-text output modes plus machine-readable command schemas.
- Installation
- Shell installer, Go install, source build, and downloadable release archives.
- Platform support
- Release instructions cover macOS, Linux, and Windows archives.
- Persistence
- SQLite-backed cache and action storage are described, with file locking used for cache coordination.
- Testing structure
- Go unit tests are present for identifier handling and OWS command integration; build targets include standard and race-enabled test runs.
Read from README.md, go.mod, Makefile, internal/id/id.go, internal/ows/cli.go, internal/id/amount.go, internal/ows/vault.go, internal/app/runner.go, internal/id/id_test.go, internal/cache/cache.go, internal/fsutil/path.go, internal/model/types.go, internal/httpx/client.go, internal/ows/cli_test.go, internal/registry/rpc.go.
What it can do
Execute lending operations on DeFi protocols
Lending parameters and protocol specifications → Transaction results and lending position data in JSON format
Perform yield farming operations across multiple chains
Yield farming strategy parameters and target protocols → Farming transaction results and yield data in JSON format
Bridge assets between different blockchain networks
Source chain, destination chain, asset type, and amount → Bridge transaction status and cross-chain transfer results in JSON format
Execute token swaps across DeFi protocols
Token pair, swap amount, and protocol preferences → Swap transaction results and exchange rates in JSON format
Query DeFi protocol data and positions
Protocol identifiers and query parameters → Protocol data and user positions in structured JSON format
Automate DeFi operations with deterministic responses
Automation scripts and operation parameters → Execution results with deterministic exit codes and JSON output
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.