# A Rust CLI for Crypto Portfolio Data

> Query multi-chain portfolios, transactions and NAV from the terminal with a single Rust binary — built for shell pipelines, CI jobs and sandboxed AI agents.

- **URL:** https://octav.fi/blog/octav-cli-rust
- **Published:** 2026-03-30
- **Author:** Octav Team — Portfolio Intelligence for Digital Assets
- **Topic:** AI Agents
- **Tags:** cli, developers, tooling
- **Source:** Octav, Practical guides on crypto NAV reporting, multi-chain portfolio management and digital asset APIs, from the team behind Octav.

---
[octav-cli](https://github.com/Octav-Labs/octav-cli) exposes the full Octav API
from the terminal. It is written in Rust, which matters for one practical
reason: it is a single static binary with no runtime to install.

That is the difference between "add a dependency, pin a version, keep an SDK in
sync" and "drop a binary in the container".

## Basic use

```bash
export OCTAV_API_KEY="your-key"

octav portfolio 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
octav nav 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
octav transactions 0xYourAddress --limit 50 --chain ethereum
```

Output is JSON, which is the point — it composes with everything else.

## Where a CLI beats an SDK

**Shell pipelines.** Exposure by chain, with no application code:

```bash
octav portfolio 0xYourAddress \
  | jq -r '.positions[] | "\(.chain)\t\(.value)"' \
  | awk -F'\t' '{s[$1]+=$2} END {for (c in s) printf "%-12s %12.2f\n", c, s[c]}' \
  | sort -k2 -nr
```

**Scheduled jobs.** A cron entry that writes a daily NAV to a file is three
lines and needs no project scaffolding:

```bash
0 0 * * * octav nav $ADDRESSES >> /var/log/nav-$(date +\%F).json
```

**CI checks.** Fail a pipeline if a treasury address drifts outside expected
bounds — a shell script with `jq` and an exit code, not a service.

**Sandboxed AI agents.** An agent with shell access can call the CLI without
you writing tool definitions. No SDK to install in the sandbox, no language
runtime assumption, and the same invocation works from any language's
subprocess call. This is why it sits in the
[agent toolkit](/ai-agent-tools-crypto-data) alongside the
[MCP server](/crypto-portfolio-mcp-server).

## Batching matters

The single biggest cost lever is passing multiple addresses to one invocation
rather than looping:

```bash
# One credit, three wallets, one round trip
octav portfolio 0xAddressOne,0xAddressTwo,0xAddressThree

# Three credits, three round trips — avoid
for a in 0xOne 0xTwo 0xThree; do octav portfolio "$a"; done
```

Rate limiting is 360 requests per minute per key and is shared across every
access method, so a CLI loop and a running application draw on the same budget.

## What it returns

The same decoded data as the REST API — tokens plus every DeFi position,
including [Solana](/solana-defi-portfolio-tracking),
[perps](/hyperliquid-perps-portfolio-tracking) and
[options](/derive-options-portfolio-tracking) — in one response shape. Full
surface in the
[endpoint reference](/crypto-portfolio-api-endpoint-reference).

## Choosing between the front doors

| You are | Use |
| --- | --- |
| Writing a backend service | The [REST API](/crypto-portfolio-api-endpoint-reference) |
| Scripting, in CI, or at a prompt | The CLI |
| Running an agent in Claude or Codex | The [MCP server](/crypto-portfolio-mcp-server) |
| Running an unprovisioned autonomous agent | [x402](/x402-pay-per-call-api) |

All four read the same data. See
[Every Octav Tool and When to Use It](/octav-tools-overview).
