What Is an Agent-First CLI? (And Why It Matters for DeFi)
DeFi was built for humans clicking buttons. AI Agents need something different.
Earlier this week, Gustavo Gonzalez wrote about building defi-cli and why he started the project. This follow-up zooms out on the concept underneath it: what an agent-first CLI actually is, why it’s a different beast from a regular command-line tool and why DeFi needs this category to exist at all.
Most CLIs were built for humans. You type a command, read the output, decide what to do next. That workflow breaks the moment an AI Agent is the one typing.
AI Agents don’t read help text. They don’t eyeball a table of numbers and “get the gist.” They need structured output, predictable errors and a way to discover what’s possible without guessing. An agent-first CLI is a command-line tool designed from the ground up for machines to operate. Not adapted. Not patched. Built.
This matters more than it sounds. The entire DeFi stack today assumes a human is driving. Frontends are visual. APIs are fragmented across chains and protocols. There’s no universal way for an AI Agent to say “swap 100 USDC for ETH on the cheapest route” and get a deterministic, parseable answer back. Every protocol speaks its own dialect. Every chain has its own quirks. An agent trying to navigate this landscape hits the same wall a developer did five years ago, except the agent can’t improvise around bad documentation.
defi-cli: What It Actually Does
defi-cli is an open-source command-line tool built by Taiko’s Head of Engineering, Gustavo Gonzalez. It consolidates DeFi operations across multiple protocols and blockchains into a single, machine-readable interface.
That means lending, borrowing, swapping, bridging, yield strategies and balance queries all run through one tool. Aave, Morpho, Moonwell, 1inch, Uniswap, Jupiter, Across, LiFi and more. Ethereum, Optimism, Base, Arbitrum, Taiko and a growing list of L2s. One interface. One output format.
But the real point isn’t convenience. It’s architecture.
Why “Agent-First” Isn’t a Buzzword Here
Three things make defi-cli fundamentally different from a regular CLI that happens to have a --json flag.
Structured everything. Every response is JSON. Every error returns a deterministic exit code (there are 24 of them, each mapping to a specific failure type). An AI Agent doesn’t have to parse prose to figure out what went wrong. It reads a code, decides whether to retry, escalate or abort.
Discoverability by machines. Run defi schema and the tool returns a complete, machine-readable description of every command, every parameter, every expected input and output. An AI Agent can learn the entire tool’s capabilities in a single call. No documentation crawling. No guessing at flags.
No implicit defaults. Human-friendly CLIs love defaults. They assume you probably mean mainnet, you probably want the cheapest route, you probably don’t need a dry run. Agent-first design strips that out. Everything is explicit because agents that assume things lose money.
The Two-Phase Safety Net
defi-cli uses a plan-then-execute model. First the agent requests a dry run: “Here’s what would happen if you executed this swap.” Fees, routes, expected outputs. Then, only if the result looks right, it submits the transaction. This is critical for AI Agents operating with real capital. The two-phase approach means an agent can validate its own plan before committing funds, and a human can audit the agent’s reasoning at the plan stage without blocking execution entirely.
Why This Matters Beyond One Tool
defi-cli isn’t just a product. It’s a signal of where the stack is heading.
Right now, most AI Agent projects in DeFi bolt an LLM onto an existing interface and call it “AI-powered.” The agent is a wrapper. defi-cli inverts that. The tool is built assuming an agent is the primary user and a human is the occasional auditor. That’s a fundamentally different design philosophy, and it’s the one that scales.
As AI Agents move from demos to production, the infrastructure they depend on needs to be native to how they operate. Structured outputs. Predictable errors. Explicit parameters. Machine-readable schemas. The shift from human-first to agent-first tooling isn’t a nice-to-have. It’s the bottleneck.
defi-cli is open source. You can find it at github.com/ggonzalez94/defi-cli.
This post is exploratory and does not represent a specific roadmap.



