Warden Code
Overview
Warden Code is a CLI for scaffolding production-ready AI Agents compatible with Warden.
Generated Agents also support open standards such as athe A2A protocol, x402 payments, and ERC-8004 identity, which allows them to function across the broader Agent ecosystem.
This article is a reference covering the main features of Warden Code. For getting started with Agent development, see Build an Agent with Warden Code.
Warden Code is available on GitHub: warden-code.
Key features
Agents generated with Warden Code support the following key capabilities:
- Compatibility with Warden
- Discoverability outside of Warden through ERC-8004 identity registries
- Interaction with other Agents through the A2A protocol
- Monetization through x402 payments
- Endpoints compatible with the LangGraph Agent Server API
- Built-in chat UI that automatically loads the A2A Agent Card and x402 wallets
To learn more, see Warden Agent capabilities.
In addition, Warden Code provides the AI-powered build mode allowing you to implement custom Agent logic with an AI assistant.
Basics
Installation
Use the npm commands below to install, update, and run Warden Code. This requires Node.js 18 or higher.
Install globally:
npm install -g warden-code
Update:
npm install -g warden-code
Run:
warden
CLI commands
With Warden Code, you can use the command line to generate a project, edit your code with an AI assistant, configure your Agent, and much more.
Run warden to initiate Warden Code and use the following commands:
| Command | Description | Guides |
|---|---|---|
/new | Create a new Agent interactively | |
/build | Enter the AI-powered mode to build your Agent | |
/chat | Chat with a running Agent using A2A or LangGraph | |
/config | View and edit the Agent configuration | |
/register | Register the Agent onchain (ERC-8004) | |
/activate | Activate a registered Agent onchain (ERC-8004) | |
/deactivate | Deactivate a registered Agent onchain (ERC-8004) | |
/help | Show available commands | N/A |
/clear | Clear the terminal screen | N/A |
/exit | Exit the CLI | N/A |
Project structure
When you create a new Agent, Warden Code generates the following project structure:
my-agent/
├── src/
│ ├── agent.ts # Your Agent's logic: the handler function
│ ├── server.ts # Server setup, static file serving, protocol routing
│ └── payments.ts # x402 payment setup (created only if you enable x402)
├── public/
│ ├── index.html # The chat frontend: auto-loads the A2A Agent Card, x402 wallets
│ └── .well-known/
│ ├── agent-card.json # The A2A Agent Card: the identity, capabilities, skills
│ └── agent-registration.json # ERC-8004 registration metadata
├── package.json
├── tsconfig.json
├── Dockerfile
├── .env.example
└── .gitignore
Agent models
Depending on the choices you make when creating an Agent, Warden Code uses one of the supported Agent models:
- OpenAI + Streaming: A GPT-powered Agent with streaming responses
- OpenAI + Multi-turn: A GPT-powered Agent with conversation history
- Blank + Streaming: A minimal streaming Agent that echoes input
- Blank + Multi-turn: A minimal multi-turn conversation agent
Running the Agent
The npm commands below allow you to build and initiate your Agent. Navigate to your project's root directory and run them in a separate terminal window.
Build:
npm run build
Run:
npm start
API
Authentication
Coming soon.
A2A endpoints
Coming soon.
LangGraph endpoints
LangGraph Agent Server API
All Warden Agents are immediately compatible with the LangGraph Agent Server API.
Warden Code exposes this API only partially. Below, you can find a full list of supported endpoints with links to the LangGraph API reference.
You can test them when running your Agent locally or in production.
Assistants
| Name | Method | Endpoint |
|---|---|---|
| Search Assistants | POST | /assistants/search |
| Get Assistant | GET | /assistants/{assistant_id} |
Threads
| Name | Method | Endpoint |
|---|---|---|
| Create Thread | POST | /threads |
| Search Threads | POST | /threads/search |
| Get Thread | GET | /threads/{thread_id} |
| Get Thread State | GET | /threads/{thread_id}/state |
| Get Thread History | GET | /threads/{thread_id}/history |
| Delete Thread | DELETE | /threads/{thread_id} |
Thread runs
| Name | Method | Endpoint |
|---|---|---|
| Create Background Run | POST | /threads/{thread_id}/runs |
| Create Run, Stream Output | POST | /threads/{thread_id}/runs/stream |
| Create Run, Wait for Output | POST | /threads/{thread_id}/runs/wait |
Stateless runs
| Name | Method | Endpoint |
|---|---|---|
| Create Run, Stream Output | POST | /runs/stream |
| Create Run, Wait for Output | POST | /runs/wait |
System
| Name | Method | Endpoint |
|---|---|---|
| Server Information | GET | /info |
| Health Check | GET | /ok |
Functions
Coming soon.