Skip to main content

Installation Guide

Standard Agents is a Vite plugin that owns the full application surface at /. It can run locally for development and is deployed to Cloudflare Workers for production by the Standard Agents platform. The easiest way to get started is using our CLI to create a new project:
npx @standardagents/cli@latest init
This command will:
  1. Open Standard Agents in your browser for login, billing, and project creation
  2. Create and seed a platform-owned Artifact repository with the Standard Agents project template
  3. Clone that repository back to the directory where you ran the command
  4. Write local-only project credentials to .dev.vars
  5. Configure Git credentials for future pushes to the platform repository
  6. Install dependencies with the detected package manager, start the local dev server, and open it in your browser

Adding to an Existing Project

If you already have a Vite project and want to add Standard Agents:
npx @standardagents/cli@latest scaffold
The scaffold command intelligently modifies your existing project:
  • Adds or updates @standardagents/builder in package.json
  • Adds the builder() plugin to your vite.config.ts
  • Lets builder() generate the Cloudflare Worker entry, assets config, Durable Object bindings, compatibility flags, and migrations at build time
  • Creates the agents/ directory structure
Use --force flag to overwrite existing configuration if needed.

Manual Installation

If you prefer to set things up manually, follow these steps:

Step 1: Install Dependencies

npm install -D vite @standardagents/builder
AgentBuilder’s UI is pre-compiled, so there is no need to use a front end framework. However if you plan to use the Vite application to host more than just AgentBuilder, you can also install those frameworks.

Step 2: Configure the Vite Plugin

Open your vite.config.ts file and add the builder() plugin:
import { defineConfig } from 'vite'
import { builder } from '@standardagents/builder'

export default defineConfig({
  plugins: [builder()],
})
builder() injects and configures the Cloudflare Vite plugin automatically. Do not add cloudflare() beside it. It also generates the Worker entry and Cloudflare binding configuration, so new Standard Agents projects do not need wrangler.jsonc, a checked-in Worker entry, or Durable Object subclass files.

Step 3: Create Your Agent Directories

Create the following directories for your agent configuration:
mkdir -p agents/agents agents/prompts agents/models agents/tools agents/hooks agents/api

Step 4: TypeScript Configuration

Add the following to your tsconfig.json to enable type checking:
{
  "compilerOptions": {
    "types": [
      "vite/client",
      "./.agents/types.d.ts",
      "./.agents/virtual-module.d.ts"
    ]
  },
  "include": ["agents", ".agents", "vite.config.ts"]
}
AgentBuilder types are generated when running the dev command.

Step 5: Start Development

npm run dev
The development server will automatically generate types for your agents, prompts, tools, and API routes, and spin up “miniflare” which is a local simulation of the Cloudflare Worker environment.

Project Structure

After installation, your project will have this structure:
your-project/
├── agents/
│   ├── agents/             # Agent definitions
│   ├── prompts/            # Prompt/system message definitions
│   ├── models/             # AI model configurations
│   ├── tools/              # Custom tools agents can call
│   ├── hooks/              # Lifecycle hooks
│   └── api/                # Thread-specific API endpoints
├── vite.config.ts          # Uses builder()
└── tsconfig.json           # TypeScript configuration

Next Steps

Architecture

Learn how Standard Agents works

API Reference

Explore the complete API