CLIs
AgentKit ships three command-line interfaces:
| CLI | Audience | Purpose |
|---|---|---|
create-goat-agent | Developers | Scaffold a starter project (minimal / defi / full preset) |
agentkit-gns | End users | Register, renew, and look up .goat names — on-chain or paid cross-chain via x402 |
agentkit-giftcard | End users | Browse brands, place giftcard orders, pay cross-chain in USDC/USDT, poll for fulfillment |
The end-user CLIs ship as binaries on the main @goatnetwork/agentkit npm package and are invokable directly via npx -p @goatnetwork/agentkit <cli>. They do not require a generated project.
Project Scaffolder — create-goat-agent
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
The CLI prompts you for three inputs:
- Project name -- the directory name for your new project
- Preset -- which plugin set to include
- Network -- target network (
goat-testnetorgoat-mainnet)
Presets
Plugins: wallet (10 actions)
Best for getting started quickly or building custom agents that only need basic wallet operations.
Plugins: wallet, wgbtc, bridge, bitcoin (23 actions)
Best for DeFi-focused agents that need bridging, wrapped BTC, and Bitcoin oracle access.
Plugins: All 15 plugins (118 actions)
Includes everything: wallet, DEX, bridge, x402 payments, merchant portal, ERC-8004 identity, BitVM2, LayerZero, NFTs, governance, faucet, Bitcoin, GNS (.goat names), and x402 giftcard purchase.
Generated Project Structure
Generated Code
The generated src/index.ts includes:
- All plugin imports for the chosen preset
- A
NoopWalletProvider(replace withEvmWalletProviderorViemWalletProviderfor production) - An
ActionProviderwith all actions registered - A
PolicyEngineconfigured for the chosen network - An
ExecutionRuntimeready to execute actions
Example: minimal preset output
Running the Project
Customizing After Scaffolding
After generating your project:
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:
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.
End-User CLI — agentkit-gns
Register, renew, and look up .goat names without writing any code. Runs against GOAT mainnet by default.
Common Commands
x402-register Flags
| Flag | Default | Description |
|---|---|---|
--years <n> | 1 | Registration term in years (1-10) |
--pay-chain <chainId> | 8453 (Base) | Numeric source chain id |
--pay-token <symbol> | USDC | Source token symbol (USDC / USDT) |
--pay-token-contract <address> | required | Source-chain ERC-20 contract address |
--wait-timeout <sec> | 180 | Max seconds to poll for the on-chain commit reveal window (minCommitmentAge is 60s on GOAT) |
--poll-interval <sec> | 10 | Seconds between commit-readiness polls |
Required Environment Variables
| Variable | Required | Description |
|---|---|---|
GOAT_PRIVATE_KEY | Always | Wallet key for the GOAT-side wallet (owner of the registered name) |
PAYMENT_CHAIN_RPC_URL | x402-register only | RPC URL of the source chain you're paying from (e.g., BSC) |
PAYMENT_CHAIN_PRIVATE_KEY | x402-register, optional | Source-chain signer key. Defaults to GOAT_PRIVATE_KEY when omitted (the CLI's pre-flight error message lists it among required vars, but the runtime fallback at cli-gns.ts makes it functionally optional when GOAT_PRIVATE_KEY is set) |
GNS_API_BASE_URL | Optional | Override default https://gns-api.goat.network/api |
Run agentkit-gns doctor for a full env diagnostic.
See the GNS reference for the full action surface, security model, and orchestration sequence.
End-User CLI — agentkit-giftcard
Browse giftcard brands, place orders, pay cross-chain in USDC/USDT, and poll until the order is fulfilled. Supports source chains Polygon, Base, Arbitrum, Optimism, BSC, and Metis.
Common Commands
The CLI bundles create-order, pay-order, and the fulfillment poll into a single buy subcommand. Use status / list-orders to inspect existing orders.
buy Flags
| Flag | Default | Description |
|---|---|---|
--brand <id> | none | Brand UUID (skip if you pass --product directly) |
--product <id> | none | Product UUID (skips brand lookup) |
--face-value <amount> | 50 | Face value in the brand's local currency |
--pay-chain <chainId> | 2345 (GOAT) when non-interactive; interactive picker otherwise | Numeric source chain id |
--pay-token <symbol> | USDC | Payment token symbol (USDC or USDT) |
--poll-timeout-sec <n> | 60 | Max seconds to poll for fulfillment |
Safety Posture
The buy subcommand hard-refuses to run with a NoopWalletProvider outside of --dry-run / DEMO_MOCK=true. A real signer is mandatory for any production purchase. The chain-bound check verifies wallet.getChainId() matches the selected --pay-chain — refuses to broadcast on a chain mismatch.
Required Environment Variables
| Variable | Required | Description |
|---|---|---|
GOAT_PRIVATE_KEY | Always | Wallet key (signs EIP-712 auth + broadcasts source-chain transfer when paying on GOAT) |
PAYMENT_CHAIN_RPC_URL | When --pay-chain is non-GOAT | RPC URL of the source chain you're paying from |
PAYMENT_CHAIN_ID | When --pay-chain is non-GOAT | Numeric chain id sanity-check for the source-chain wallet |
PAYMENT_CHAIN_PRIVATE_KEY | Optional | Source-chain signer key; falls back to GOAT_PRIVATE_KEY when omitted |
GIFTCARD_API_BASE_URL | Optional | Override default https://giftcard-api.goat.network |
DEMO_MOCK | Optional | true allows buy --dry-run against a NoopWalletProvider for shape demos only |
Run agentkit-giftcard doctor for env validation.
See the Giftcard reference for the full action surface and the cross-chain payment flow.