npm package: @steerprotocol/cli
Description: Steer Protocol operational CLI scaffold built with incur.
Latest version: 1.6.0

# `@steerprotocol/cli`

Read-only operational CLI for Steer Protocol.

`steer` is built for both terminal users and agents. It exposes live protocol status, chain and protocol discovery, market inspection, liquidity depth analysis, and ALM vault inspection through a single typed CLI surface.

## Install

```bash
npm install -g @steerprotocol/cli
```

Or run it without installing:

```bash
npx @steerprotocol/cli status
```

## Agent Installation

### Install as a Skill (less tokens usage)

Generate and install skill files for agents that use skills:

```bash
steer skills add
```

This lets an agent discover `steer` from generated skill documentation instead of only from shell help.

### Install as MCP

Register `steer` as an MCP server for your agent:

```bash
steer mcp add
```

Useful variants:

```bash
steer mcp add --agent cursor
steer mcp add --agent claude-code
steer mcp add --no-global
```

Start the CLI directly as an MCP stdio server:

```bash
steer --mcp
```

### Discover Command Contracts

For agents and wrappers, `steer` also exposes:

- `steer --llms --format json` for the live command manifest
- `steer <command> --schema --format json` for typed command contracts
- `steer <command> --json` for machine-readable command output

## Quick Start

```bash
steer status
steer chains --json
steer protocols --chain base --json
steer subgraphs --chain base --json
steer markets list --chain base --protocol uniswap --limit 5 --json
steer vaults list --chain base --type alm --limit 5 --json
```

For local development, create a `.env` from the example file and set your SDK key there:

```bash
cp .env.example .env
```

## Commands

### `status`

Show runtime health, environment, profile, and command-domain availability.

```bash
steer status --json --verbose
```

### `chains`

List supported chains discovered from the Steer SDK.

```bash
steer chains --json
```

### `protocols`

List supported protocol aliases, optionally narrowed to a chain.

```bash
steer protocols --chain base --json
```

### `subgraphs`

List Steer chain subgraphs and protocol-specific subgraphs, optionally filtered by chain or protocol.

```bash
steer subgraphs --json
steer subgraphs --chain base --json
steer subgraphs --chain base --protocol aerodrome --json
```

### `markets list`

List markets for a chain and protocol.

```bash
steer markets list --chain base --protocol uniswap --limit 10 --json
```

### `markets inspect`

Inspect a single market or run batch liquidity depth analysis for multiple pools.

```bash
steer markets inspect 0xd0b53d9277642d899df5c87a3966a349a798f224 --chain base --protocol uniswap --json
steer markets inspect 0xd0b53d9277642d899df5c87a3966a349a798f224 --chain base --protocol uniswap --depth --json
steer markets inspect --chain base --protocol uniswap --depth --pools 0xpoolA,0xpoolB --json
```

Depth mode supports:

```bash
steer markets inspect <pool> --chain <chain> --protocol <protocol> --depth \
  --subgraph-key your-key \
  --rpc https://base-rpc.publicnode.com \
  --percent 1,2,5,10 \
  --usd-sizes 1000,5000,10000 \
  --prices auto
```

Override the env-configured key only when needed:

```bash
steer markets inspect 0xd0b53d9277642d899df5c87a3966a349a798f224 \
  --chain base \
  --protocol uniswap \
  --subgraph-key your-key \
  --json
```

### `markets profile`

Load initialized liquidity around the live current tick for a single concentrated-liquidity pool.

```bash
steer markets profile 0xd0b53d9277642d899df5c87a3966a349a798f224 --chain base --protocol uniswap
steer markets profile 0xd0b53d9277642d899df5c87a3966a349a798f224 --chain base --protocol uniswap --words 3 --json
```

### `vaults list`

List ALM vaults for a chain, optionally filtered by protocol or active status.

```bash
steer vaults list --chain base --type alm --active --limit 10 --json
```

### `vaults inspect`

Inspect a vault, including its underlying pool, fees, holdings, valuation, a nested `gas` summary, tick range, positions, and live in-range status derived from the current pool tick.

```bash
steer vaults inspect 0x62e9efb617dc886c4d31633371ede096aaecc2f8 --chain base --type alm --json
```

### `vaults gas inspect`

Inspect the live gas-vault balance snapshot for a vault.

```bash
steer vaults gas inspect 0x62e9efb617dc886c4d31633371ede096aaecc2f8 --chain base --type alm --json
```

### `vaults gas history`

Inspect recent gas usage history for a vault, including spend totals, tend cadence, and runway estimates.

```bash
steer vaults gas history 0x62e9efb617dc886c4d31633371ede096aaecc2f8 --chain base --type alm --window 7d --json
```

### `vaults fees history`

Inspect historical accrued fee deltas for a vault in raw token units.

```bash
steer vaults fees history 0x62e9efb617dc886c4d31633371ede096aaecc2f8 --chain base --type alm --window 7d --json
```

Useful built-ins:

- `--json` for machine-readable command output
- `--schema` for command contracts
- `--llms` for the live command manifest
- `--mcp` for MCP server mode
- `completions` for shell completions

## Environment

The public read surface uses a small runtime env surface:

| Variable | Purpose |
| --- | --- |
| `STEER_PROFILE` | Active profile name |
| `STEER_ENVIRONMENT` | Runtime environment, defaults to `development` |
| `STEER_SUBGRAPH_STUDIO_KEY` | Primary The Graph Studio key for SDK-backed reads |

Notes:

- set `STEER_SUBGRAPH_STUDIO_KEY` in your shell or `.env` for normal local and CI usage
- `--subgraph-key` is available as a one-off override for agents and debugging
- `vaults` commands do not require a vault-specific env var
- `markets inspect --depth` uses a vendored public RPC by default
- `--rpc` overrides the depth RPC per invocation
- market fee history is intentionally deferred because the current SDK/subgraph surface does not expose exact historical market fee snapshots

## Output Model

The CLI is intentionally read-only right now and returns structured envelopes rather than ad hoc terminal text.

Notable behavior:

- `markets inspect --depth` adds a `depth` block for single-pool inspection
- batch depth returns `{ markets, failures }`
- `vaults inspect` includes nested `holdings`, `valuation`, and `gas` blocks, plus `positions`
- `vaults inspect` computes `inRange` from the live pool tick
- `vaults inspect` exposes vault-level `valuation.totalValueLockedUsd`, while `pool.totalValueLockedUsd` remains pool-level metadata from the underlying pool
- `vaults gas inspect` returns the gas-vault state for a single vault
- `vaults gas history` combines the live gas-vault balance with up to 1000 recent gas events from the Steer subgraph for the selected window
- `vaults list` stays summary-oriented and does not include positions

## Local Development

```bash
pnpm install
pnpm dev -- --help
pnpm build
pnpm test
pnpm coverage
```

Development entrypoints are split intentionally:

- `src/index.ts` is the executable bin wrapper used by `pnpm dev`, the published package bin, and shell-level smoke tests
- `src/cli.ts` exports the import-safe command graph used by programmatic tests and future `incur` tooling

Docs for the CLI live in [docs/README.md](/Users/derekbarrera/Development/SteerFinance/ferdinand/docs/README.md).

## For Maintainers

The CLI implementation is intentionally thin:

- commands own UX, examples, and schemas
- middleware owns runtime setup
- services own SDK integrations and live reads

If you need to update behavior, check these first:

- `src/cli.ts`
- `src/index.ts`
- `src/commands`
- `src/runtime.ts`
- `src/services/contracts.ts`

CLI tests intentionally isolate `STEER_*` environment variables instead of inheriting your shell state. When reproducing a test case locally, set the runtime env explicitly.