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
| Field | Description | Example |
|---|---|---|
| Name | Display name in the marketplace | Customer Support Bot |
| Agent ID | URL-safe identifier | customer-support-bot |
| Description | Short description for listings | AI-powered support agent with RAG and ticket escalation |
| Price | One-time purchase price (USD) | 9.99 |
| Category | Marketplace category | Productivity, Development, Business |
| Documentation URL | Link to your docs | https://github.com/you/repo#readme |
Deployment configuration
| Field | Value | Description |
|---|---|---|
| Deploy Runtime | edge | Agent runs as a Cloudflare Worker (recommended) |
| Hosting Compatible | true | Buyers 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:
| Provider | Example model |
|---|---|
| OpenRouter | openai/gpt-4o-mini |
| Anthropic | anthropic/claude-3-sonnet |
google/gemini-flash | |
| Groq | groq/llama-3.1-70b |
Features
Add feature tags based on your agent's capabilities:
streaming— UsescreateChatAgent()with WebSocket streamingstateful— UsescreateAgent()with SQLite storagescheduled— Uses scheduled tasks (scheduleEvery,schedule)tools— UsesdefineTool()for tool callingmcp— Connects external MCP serversmulti-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
- Click Connect GitHub App and authorize
- Select your repository
- Click Scan Repository — runs gitleaks, semgrep, OSV, prompt injection, permission analysis
- 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:
- Go to your template's Edge tab
- Your latest deployed version appears
- Click Publish
- Your template is live on the marketplace
Template visibility
| State | Visible? | Buyers can purchase? |
|---|---|---|
| Draft | No | No |
| Published (no scan) | No | No |
| Published (scan C+) | Yes | Yes |
| Published (scan A/B) | Yes, with badge | Yes |
| Yanked | No | Existing 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.