GOAT Network
AgentKit

CLI Scaffolding

The published create-goat-agent CLI generates a complete starter project with all boilerplate pre-configured. Choose from three presets depending on your use case.

If you already have an agent or app, start with manual installation instead. The official AgentKit product page positions the CLI as the path for runnable starter projects.

Usage

Terminal
npm create goat-agent
Terminal
pnpm dlx create-goat-agent

The CLI prompts you for three inputs:

  1. Project name -- the directory name for your new project
  2. Preset -- which plugin set to include
  3. Network -- target network (goat-testnet or goat-mainnet)

Presets

Plugins: wallet (10 actions)

Best for getting started quickly or building custom agents that only need basic wallet operations.

Terminal
npm create goat-agent
# Project name: my-agent
# Preset: minimal
# Network: goat-testnet

Plugins: wallet, wgbtc, bridge, bitcoin (23 actions)

Best for DeFi-focused agents that need bridging, wrapped BTC, and Bitcoin oracle access.

Terminal
npm create goat-agent
# Project name: my-defi-agent
# Preset: defi
# Network: goat-testnet

Plugins: All 13 plugins (95 actions)

Includes everything: wallet, DEX, bridge, x402 payments, merchant portal, ERC-8004 identity, BitVM2, LayerZero, NFTs, governance, faucet, and Bitcoin.

Terminal
npm create goat-agent
# Project name: my-full-agent
# Preset: full
# Network: goat-mainnet

Generated Project Structure

Generated files
my-agent/
├── package.json       # Dependencies and scripts
├── tsconfig.json      # TypeScript configuration
├── .env.example       # Environment variable template
├── README.md          # Quick start instructions
└── src/
    └── index.ts       # Main entry point with all plugins registered

Generated Code

The generated src/index.ts includes:

  • All plugin imports for the chosen preset
  • A NoopWalletProvider (replace with EvmWalletProvider or ViemWalletProvider for production)
  • An ActionProvider with all actions registered
  • A PolicyEngine configured for the chosen network
  • An ExecutionRuntime ready to execute actions

Example: minimal preset output

src/index.ts (minimal)
import { ActionProvider } from '@goatnetwork/agentkit/providers';
import { PolicyEngine, ExecutionRuntime } from '@goatnetwork/agentkit/core';
import { NoopWalletProvider } from '@goatnetwork/agentkit/core';
import {
  walletBalanceAction,
  getDetailsAction,
  getAllowanceAction,
  contractReadAction,
  contractWriteAction,
  transferNativeAction,
  transferErc20Action,
  approveErc20Action,
  deployContractAction,
  resolveTokenAction,
  NoopWalletReadAdapter,
} from '@goatnetwork/agentkit/plugins';

// Replace NoopWalletProvider with a real provider for production use.
const wallet = new NoopWalletProvider();

const provider = new ActionProvider();
provider.register(walletBalanceAction(new NoopWalletReadAdapter()));
provider.register(getDetailsAction(wallet));
provider.register(getAllowanceAction(wallet));
provider.register(contractReadAction(wallet));
provider.register(contractWriteAction(wallet));
provider.register(transferNativeAction(wallet));
provider.register(transferErc20Action(wallet));
provider.register(approveErc20Action(wallet));
provider.register(deployContractAction(wallet));
provider.register(resolveTokenAction());

const policy = new PolicyEngine({
  allowedNetworks: ['goat-testnet'],
  maxRiskWithoutConfirm: 'low',
  writeEnabled: true,
});

const runtime = new ExecutionRuntime(policy, {
  maxRetries: 2,
  retryDelayMs: 200,
});

console.log('Agent ready - minimal preset, 1 plugin(s)');
console.log('Registered actions:', provider.list().map((a) => a.name));

Running the Project

Terminal
cd my-agent
pnpm install   # or npm install
pnpm start     # runs: tsx src/index.ts

Customizing After Scaffolding

After generating your project:

Replace the wallet provider

Swap NoopWalletProvider for a real implementation:

src/index.ts
import { JsonRpcProvider, Wallet } from 'ethers';
import { EvmWalletProvider } from '@goatnetwork/agentkit/core';

const ethersProvider = new JsonRpcProvider('https://rpc.testnet3.goat.network');
const signer = new Wallet(process.env.PRIVATE_KEY!, ethersProvider);
const wallet = new EvmWalletProvider(signer, ethersProvider, 'goat-testnet');

Add custom actions

Use customActionProvider or implement ActionDefinition to add your own tools. See Custom Tools.

Connect to your AI framework

Export tools for your framework of choice:

src/index.ts
const tools = provider.openAITools();
// Or: provider.langChainToolDefs(), provider.mcpTools(), etc.

See the Frameworks guide for details.

Configure for production

  • Set up Redis idempotency for distributed deployments
  • Add Prometheus metrics for observability
  • Configure execution hooks for audit logging

See Runtime Configuration for details.

The CLI is published as the create-goat-agent npm package and generates projects that depend on @goatnetwork/agentkit.

The latest CLI scaffold writes GOAT_TESTNET_RPC_URL=https://rpc.testnet3.goat.network into .env.example, matching the upstream goat-testnet network config.

On this page