scaffold-agent logo

Open Source CLI

Build Onchain AI Agents

One command to scaffold a full-stack monorepo with smart contracts, a frontend, and agent infrastructure.

npx scaffold-agent@latest

Features

Smart Contracts

Foundry or Hardhat with auto-deploy, ABI generation, and type-safe contract hooks via Scaffold UI.

Frontend Ready

Next.js, Vite, or Python A2A with WalletConnect, Scaffold UI components, and route skeletons.

LLM Providers

OpenAI, Anthropic, Gemini, or 1Claw Shroud with 6 upstream options and token billing.

Secure by Default

HSM-backed vault, encrypted secrets, wallet generation, and multi-agent swarm mode.

Agent On-Chain Tools

Vercel AI SDK tools for contract reads, 1Claw Intents simulation, and signed transaction submission.

Unified Network Model

Single source of truth via scaffold.config.ts — switch networks with just use-network.

How It Works

  1. 1

    Scaffold

    $ npx scaffold-agent@latest my-agent

    The interactive wizard walks through project name, secrets management, agent identity, LLM provider, chain framework, and app framework. Or use -y for defaults.

  2. 2

    Chain

    $ just chain

    Start a local blockchain in a second terminal. Anvil for Foundry or Hardhat node — the local RPC must be up before deploying.

  3. 3

    Fund & Deploy

    $ just fund && just deploy

    Fund the deployer and agent wallets with 100 ETH each, then deploy contracts and auto-generate TypeScript ABI types.

  4. 4

    Start

    $ just start

    Launch the frontend dev server at localhost:3000. Your AI agent can now interact with contracts via the chat interface.

Point Your AI Here

Give your AI agent full knowledge of scaffold-agent by having it fetch the skill file. Add this to your project rules or tell your assistant directly:

Fetch https://scaffoldagent.xyz/SKILL.md

Frequently Asked Questions

What is scaffold-agent?
scaffold-agent is an open-source interactive CLI that scaffolds full-stack monorepo projects for building onchain AI agents. It generates smart contracts (Foundry or Hardhat), a frontend (Next.js, Vite, or Python), LLM integration, and agent infrastructure in one command.
How do I install it?
No global installation required — just run npx scaffold-agent@latest in your terminal. You can also pass a project name directly: npx scaffold-agent@latest my-agent. The only prerequisites are Node.js, npm, and optionally the just task runner.
What LLM providers are supported?
OpenAI, Anthropic, Google Gemini, and 1Claw Shroud. Shroud is a proxy supporting 6 upstream providers (OpenAI, Anthropic, Google/Gemini, Mistral, Cohere, OpenRouter) with token billing or bring-your-own-key mode. All chat routes use the Vercel AI SDK for streaming.
What is swarm mode?
Swarm mode (--swarm, 1–64 agents) generates multiple Ethereum wallets for multi-agent setups. Generated apps include a swarm roster page, header agent picker, and per-agent balance and identity views. Use just swarm agents=N to add more agents after scaffolding.
How does it relate to Scaffold-ETH 2?
scaffold-agent builds on Scaffold-ETH 2 patterns from the BuidlGuidl community. It uses Scaffold UI packages (@scaffold-ui/hooks, @scaffold-ui/components, @scaffold-ui/debug-contracts), the wagmi/viem stack, RainbowKit, ABI type generation, and the /debug contracts page — then adds AI agent infrastructure on top.
How do I point my AI assistant at scaffold-agent?
Have your AI fetch https://scaffoldagent.xyz/SKILL.md — it contains the full CLI reference, all flags, project structure, just commands, LLM providers, and agent tools. Add it to your project rules or tell your assistant directly.