Talk to Your Treasury: The Zerion CLI Agent That Sweeps, Sorts, and Consolidates
The consolidation skill for Zerion CLI gives your AI agent the ability to manage portfolio, sweeping dust tokens and consolidating them into an asset of your choice.
Every time someone swaps or bridges on Zerion, we take a small fee in whatever token they happen to be using. Multiply that by thousands of transactions, and our treasury ends up full of this: random memecoins, dust-sized balances, scattered across dozens of different chains.
Cleaning that up manually would take hours. You'd need to check prices, figure out gas costs on each chain, and decide what's even worth swapping versus what's not worth the gas to touch. So instead, we built a treasury management agent to do it for us.
The CLI does the work. The agent decides what to run.
Zerion CLI is an open-source toolkit that gives AI agents the ability to manage portfolios, swap tokens, and sign transactions across 40+ chains. The consolidation skill inside it is one command, zerion consolidate <chain> <to-token>, with flags for thresholds, exclusions, and slippage. That command is the entire execution layer: it's the thing that reads your live positions, quotes the swaps, and eventually signs and broadcasts transactions.
What sits in front of that command isn't a separate product of ours. It's whichever coding agent you've installed the Zerion skill into (we use Claude Code; Codex and Gemini CLI work the same way). That agent never touches chain state: no keys, no execution. It just translates your plain-English request into the right CLI invocation, on the right chain, and reads back what the CLI reports before anything is confirmed.
| You say | The agent runs |
|---|---|
| "Clear dust tokens on base for my default wallet" | zerion consolidate base USDC --max-value 10 |
| "Convert all my base tokens to ETH and keep some for gas" | zerion consolidate base ETH --include-native --gas-reserve 0.002 |
| "Consolidate my solana wallet into SOL" | zerion consolidate solana SOL --include-native |
Two things worth being precise about in that table:
- "Convert my base tokens" doesn't mean literally every token in the wallet. It means every token the CLI's threshold and exclusion rules consider eligible, after the gas reserve is set aside and after anything you've explicitly excluded is skipped. The agent won't silently sweep a position you didn't mean to touch; it runs the same rules the CLI command always runs.
- "Dust" isn't a fixed category. It's whatever falls under the threshold you set. A $10 max-value catches genuine fee-token debris. Set it to $500 and "dust" now includes real positions you might not want swept. The agent applies whatever threshold you give it (or the CLI's default); it doesn't have its own opinion about what counts as dust.
Every invocation still runs as a dry run first. The CLI reports back the plan: how many positions are ready, how many got blocked for losing too much value on the swap, how many were skipped as dust under the threshold, all before anything gets signed. --execute only happens once you've seen that plan and said go.
That dry-run step is what makes this useful as an agent interaction rather than just a wrapped script: the agent reasons about your intent and translates it faithfully, and the CLI reasons about your treasury and explains itself before it acts. Neither layer skips that step.
How we use it
We run this ourselves for treasury management, sweeping the fee tokens we accumulate on a given chain into a single target token, using a max-value threshold to draw the line between dust worth clearing and positions we actually want to hold onto.
One demonstration of this was a recent sweep across all eligible tokens on Ethereum. The same command works the same way regardless of chain, so it's the tool we reach for whenever fee-token debris has built up enough on a given chain to be worth clearing, whether that's Ethereum, Base, or Solana.

You can use it too
Any business collecting fees onchain ends up with the same mess: exchanges, other protocols, wallets, all of it. If you're accumulating dust across chains, this same agent is just as useful pointed at your own treasury, and you talk to it the same way. No flags to memorize, no chain-by-chain bookkeeping, just tell it what you want cleaned up.
Getting started
- Install the CLI.
npx -y zerion-cli init -y --browsersets up everything in one step: installs the CLI globally, opens dashboard.zerion.io so you can grab an API key, and installs the agent skill across any coding agents it detects. Requires Node.js 20+. - Add the skill to your agent.
zerion setup skillsinstalls it globally; add-agent claude-code(or another supported agent) to scope it to one. Claude Code users can also run/plugin marketplace add zeriontech/zerion-aifollowed by/plugin install zerion-agent@zerion. - Talk to it. Point it at a wallet and say what you want cleared. The agent maps your request to a
zerion consolidatedry run and reports back before touching anything.
FAQ
What's the difference between the agent and the CLI?
The CLI is the execution layer: it reads your positions, quotes swaps, and signs and broadcasts transactions via zerion consolidate. The agent is a thin translation layer in front of it, turning a plain-English request into the correct CLI invocation and reading back what the CLI reports. The agent doesn't hold keys or execute anything on its own; every action still runs through the same CLI command, with the same rules, whether you type it yourself or ask the agent to.
Does "convert all my tokens" really mean every token in the wallet?
No. It means every token that's currently eligible under the threshold and exclusion rules in effect, after any gas reserve is set aside and anything you've excluded is skipped. The agent applies the same filters the CLI command always applies; it doesn't sweep positions outside those rules just because you said "all."
What counts as "dust"?
Whatever falls below the max-value threshold you set (or the CLI's default, if you don't set one). It's relative, not a fixed list of token types: a low threshold catches only genuine fee debris, while a high one will treat larger positions as dust too. Setting the threshold correctly is what keeps this from sweeping something you meant to keep.
Does it execute trades automatically?
No. Every request runs as a dry run first. The CLI reports how many positions are ready, how many were blocked for losing too much value on the swap, and how many were skipped as dust under the current threshold. Nothing is signed until you've reviewed that plan and explicitly run it again with --execute.
Can I keep some funds aside for gas?
Yes. --gas-reserve lets you specify an amount of the native token to leave untouched, so a full consolidation into that native token doesn't leave the wallet unable to pay for its next transaction.
Which chains does this work on?
Any chain the Zerion CLI supports for swaps. zerion chains lists the current set, which spans 40+ EVM chains plus Solana.
Do I need to know the CLI syntax to use it?
No. That's the point of the agent layer. You describe the outcome you want, and it maps that to the right zerion consolidate invocation and flags. If you'd rather run it directly yourself, the same command is there and works exactly the same way.
How do I install it?
Run npx -y zerion-cli init -y --browser for a one-step setup (CLI, API key, and agent skill install), or npm install -g zerion-cli for just the CLI. Then add the agent skill to your coding agent with zerion setup skills, or via your agent's own plugin/extension system (Claude Code, Codex, Gemini CLI, and others are supported). Requires Node.js 20 or later.