SDK · CLI

foundry — the one-binary developer experience.

The Foundry CLI scaffolds new integrations, opens Forges from the terminal, runs smoke inferences against any Ingot, and ships machine-readable JSON for CI pipelines. It's the same SDK surface, one alias away.

Install

The CLI ships in the SDK package — no separate install.

terminalbash
pnpm add @foundryprotocol/sdk
pnpm exec foundry --help

# or globally:
pnpm add -g @foundryprotocol/sdk
foundry --help

CLI status

The CLI ships in v1.0.0. The commands below are the locked public surface; the --help output in the v1.0.0-rc.1 pre-release matches this page exactly.

foundry init

Scaffolds a starter app that calls an existing Ingot.

bash
foundry init my-foundry-app
cd my-foundry-app
pnpm install
pnpm dev

# scaffolds:
#   /pages/index.tsx        — UI that calls foundry.inference.run()
#   /lib/foundry.ts         — typed Foundry client
#   /.env.example           — INGOT_ID, FOUNDRY_API_KEY (optional)

foundry forge

Open, inspect, or close a Forge.

foundry forge create

bash
foundry forge create \
  --model-spec       ./specs/model.json \
  --eval-spec        ./specs/eval.json  \
  --eval-coordinator 0x… \
  --window-days      7

# outputs:
#   forgeId  forge:0x4a7c…
#   txHash   0x6f12…
#   explorer https://aristotle.0g.explorer/tx/0x6f12…

foundry forge list

bash
foundry forge list --state OPEN --json
# [ { id: "forge:0x…", state: 0, contributions: 4, fundedOG: "1.2" }, … ]

foundry ingot

foundry ingot show

bash
foundry ingot show ingot:0x8e2af4a…

# Konkani ↔ English translator v1
# minted     2026-06-04 14:02 UTC
# weights    0g://weights/konkani-v1.safetensors
# parent     —
# holders    9 (cap table below)
# revenue    0.42 OG distributed all-time
# explorer   https://aristotle.0g.explorer/token/0x…

foundry ingot claim

bash
# Claim revenue for the calling wallet, on every Ingot you hold shares in.
foundry ingot claim --all

# Or a specific Ingot:
foundry ingot claim ingot:0x8e2af4a…

foundry infer

One-shot inference against any Ingot.

bash
foundry infer \
  ingot:0x8e2af4a… \
  --input "Translate to Konkani: where is the train station?" \
  --stream

# streams tokens to stdout; final receipt printed to stderr:
#   {
#     "inferenceTxHash": "0x4a7c…",
#     "revenueTxHash":   "0x6f12…",
#     "latencyMs":       842
#   }

CI usage

Every command supports --json for stable machine output.

.github/workflows/foundry-smoke.ymlyaml
name: foundry-smoke
on: [pull_request]

jobs:
  call-ingot:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pnpm install
      - run: |
          pnpm exec foundry infer ingot:0x8e2af4a… \
            --input "ping" --json > out.json
      - run: jq .receipt.latencyMs out.json | xargs -I{} test {} -lt 2000