Skip to main content

Creating a Template

Templates are your product listing on the AgentDeploy marketplace. This guide covers the SDK-based workflow for creating, publishing, and managing templates.

SDK-first workflow​

ad init → build agent → ad deploy → create template listing → publish

With the SDK, your agent code and template configuration live in the same project:

my-agent/
├── .agentdeploy/
│ └── config.json # Template metadata, secrets, model config
├── src/
│ ├── server.ts # Agent entry point
│ └── tools.ts # Tool definitions
├── package.json
├── tsconfig.json
└── wrangler.jsonc

Step 1: Configure your project​

Edit .agentdeploy/config.json:

{
"projectId": "customer-support-bot",
"name": "Customer Support Bot",
"template": "chat-agent",
"entrypoint": "src/server.ts",
"model": "openai/gpt-4o-mini",
"secrets": [
{
"key": "KNOWLEDGE_BASE_API_KEY",
"required": true,
"description": "API key for the knowledge base service"
},
{
"key": "TICKETING_WEBHOOK",
"required": false,
"description": "Webhook URL for ticket escalation"
}
]
}

Step 2: Deploy​

ad deploy

The CLI bundles your TypeScript, uploads it, validates, and publishes a new edge version.

Step 3: Create marketplace listing​

After your first deploy, go to Dashboard > Seller > Templates > Create Template:

Basic info​

FieldDescriptionExample
NameDisplay name in the marketplaceCustomer Support Bot
Agent IDURL-safe identifiercustomer-support-bot
DescriptionShort description for listingsAI-powered support agent with RAG and ticket escalation
PriceOne-time purchase price (USD)9.99
CategoryMarketplace categoryProductivity, Development, Business
Documentation URLLink to your docshttps://github.com/you/repo#readme

Deployment configuration​

FieldValueDescription
Deploy RuntimeedgeAgent runs as a Cloudflare Worker (recommended)
Hosting CompatibletrueBuyers can deploy on AgentDeploy hosting

When using the SDK, your agent is always edge runtime with nodejs_compat flag. The platform auto-detects Durable Object classes and creates appropriate bindings.

Supported LLM providers​

Select which LLM providers your agent supports. All providers use OpenAI-compatible endpoints via the platform gateway:

ProviderExample model
OpenRouteropenai/gpt-4o-mini
Anthropicanthropic/claude-3-sonnet
Googlegoogle/gemini-flash
Groqgroq/llama-3.1-70b

Features​

Add feature tags based on your agent's capabilities:

  • streaming — Uses createChatAgent() with WebSocket streaming
  • stateful — Uses createAgent() with SQLite storage
  • scheduled — Uses scheduled tasks (scheduleEvery, schedule)
  • tools — Uses defineTool() for tool calling
  • mcp — Connects external MCP servers
  • multi-agent — Multiple agent classes in one worker

Step 4: Security scan​

Connect a GitHub repo for automated scanning, or rely on the platform's built-in code validation during deploy:

GitHub-connected scanning​

  1. Click Connect GitHub App and authorize
  2. Select your repository
  3. Click Scan Repository — runs gitleaks, semgrep, OSV, prompt injection, permission analysis
  4. Need a C rating or higher to publish

CLI-only validation​

  • The platform validates your bundled script during ad deploy
  • Checks for dangerous patterns (eval(), process.env, etc.)
  • Verifies Durable Object class declarations are valid
  • Validates script size (3MB limit for SDK-bundled agents)

Step 5: Publish​

Once scanning passes:

  1. Go to your template's Edge tab
  2. Your latest deployed version appears
  3. Click Publish
  4. Your template is live on the marketplace

Template visibility​

StateVisible?Buyers can purchase?
DraftNoNo
Published (no scan)NoNo
Published (scan C+)YesYes
Published (scan A/B)Yes, with badgeYes
YankedNoExisting deployments unaffected

Updating your agent​

To push an update:

# Make changes to your code, then:
ad deploy --version 1.1.0

The CLI creates a new edge version. New deployments automatically use the latest version. Existing deployments stay on their current version until the buyer updates.

Managing multiple agents​

If you have multiple agent templates:

# Each project has its own .agentdeploy/config.json
~/projects/support-bot/ # Template: customer-support
~/projects/sales-agent/ # Template: sales-assistant
~/projects/billing-bot/ # Template: billing-specialist

Each project deploys independently to its own template on the marketplace.