Skip to main content

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.

GitHub

Warden Code is available on GitHub: warden-code.

Key features

Agents generated with Warden Code support the following key capabilities:

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:

CommandDescriptionGuides
/newCreate a new Agent interactively

Create a new Agent

/buildEnter the AI-powered mode to build your Agent

Implement custom logic

/chatChat with a running Agent using A2A or LangGraph

Test the Agent locally

/configView and edit the Agent configuration

Configure the Agent

/registerRegister the Agent onchain (ERC-8004)

Register on ERC-8004

/activateActivate a registered Agent onchain (ERC-8004)
/deactivateDeactivate a registered Agent onchain (ERC-8004)
/helpShow available commandsN/A
/clearClear the terminal screenN/A
/exitExit the CLIN/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

NameMethodEndpoint
Search AssistantsPOST/assistants/search
Get AssistantGET/assistants/{assistant_id}

Threads

NameMethodEndpoint
Create ThreadPOST/threads
Search ThreadsPOST/threads/search
Get ThreadGET/threads/{thread_id}
Get Thread StateGET/threads/{thread_id}/state
Get Thread HistoryGET/threads/{thread_id}/history
Delete ThreadDELETE/threads/{thread_id}

Thread runs

NameMethodEndpoint
Create Background RunPOST/threads/{thread_id}/runs
Create Run, Stream OutputPOST/threads/{thread_id}/runs/stream
Create Run, Wait for OutputPOST/threads/{thread_id}/runs/wait

Stateless runs

NameMethodEndpoint
Create Run, Stream OutputPOST/runs/stream
Create Run, Wait for OutputPOST/runs/wait

System

NameMethodEndpoint
Server InformationGET/info
Health CheckGET/ok

Functions

Coming soon.