Start with a minimal TypeScript LangChain CLI agent, then grow it into an API or chat app.
pnpm dlx @bell_008/create-agent-app my-agentpnpm dlx @bell_008/create-agent-app my-agent
cd my-agent
cp .env.example .env
pnpm install
pnpm run typecheck
pnpm run test
pnpm run dev "What's the weather in San Francisco?"Set OPENAI_API_KEY in .env before running the agent.
LangChain and LangGraph already provide strong TypeScript SDKs, examples, and a LangGraph Server template via npm create langgraph.
create-agent-app focuses on a different path: app-first TypeScript agent projects. Start with a minimal CLI createAgent core, then choose whether you want an HTTP API, a Next.js chat shell, or a deployable single-user product shell.
Use npm create langgraph when you want a LangGraph Server project first. Use create-agent-app when you want a TypeScript agent app that can start small and grow into a product shape.
Generate a deployable single-user chat product shell with local Markdown RAG:
pnpm dlx @bell_008/create-agent-app my-chat \
--template agent-chat-product \
--capability rag \
--provider openai \
--package-manager pnpm \
--yes
cd my-chat
cp .env.example .env
pnpm install
pnpm run ingest
pnpm run devOpen http://localhost:3000. The generated project includes data/company-handbook.md, a search_knowledge_base tool, and Sources in the Web UI when the agent uses retrieved context.
| Template | Shape | Use it for |
|---|---|---|
basic-agent |
CLI agent core | Learning createAgent, typed tools, env setup, tests |
api-agent |
HTTP API | Calling the agent from an existing frontend or backend |
web-chat-agent |
Next.js chat app | Teaching, demos, and lightweight prototypes |
agent-chat-product |
Next.js product shell | A deployable single-user chat app starting point |
Capabilities add agent behavior without changing the product shell.
| Capability | What it adds |
|---|---|
rag |
Local Markdown knowledge base, sample handbook, search_knowledge_base tool, and pnpm run ingest |
Example:
pnpm dlx @bell_008/create-agent-app my-agent --template agent-chat-product --capability rag --provider openai --package-manager pnpm --yespnpm dlx @bell_008/create-agent-app my-chat --template agent-chat-product --provider openai --package-manager pnpm --yes
cd my-chat
cp .env.example .env
pnpm install
pnpm run devOpen http://localhost:3000.
The product shell includes:
- Next.js app router
- Streaming
/api/chatroute - Browser message history
- Loading, error, clear, and abort states
- Vercel deployment notes
- LangSmith-ready env variables
It intentionally does not include auth, billing, a database, or multi-user conversation persistence.
pnpm dlx @bell_008/create-agent-app my-rag-chat --template agent-chat-product --capability rag --provider openai --package-manager pnpm --yes
cd my-rag-chat
cp .env.example .env
pnpm install
pnpm run ingest
pnpm run devReplace src/rag/retrieve.ts when you are ready to use pgvector, Pinecone, Supabase, or another vector store.
pnpm dlx @bell_008/create-agent-app my-agent \
--template web-chat-agent \
--capability rag \
--provider openai \
--package-manager pnpm \
--yesThe generator composes templates from reusable parts:
templates/parts/agent-core
templates/parts/cli-shell
templates/parts/api-shell
templates/parts/next-chat-shell
templates/parts/product-chat-shell
templates/capabilities/ragThis keeps every template on the same agent core while allowing different product shells.
pnpm install
pnpm run typecheck
pnpm test
pnpm run test:generatedtest:generated builds the CLI and verifies that every public template can generate the expected files. To also install and test each generated project, run:
VERIFY_GENERATED_INSTALL=1 pnpm run test:generatednpm_config_cache=/private/tmp/create-agent-app-npm-cache pnpm run pack:checkThe temporary npm cache avoids local npm cache permission issues.
This package is published as @bell_008/create-agent-app.
The unscoped npm package name create-agent-app is already published by another owner, so the README uses pnpm dlx @bell_008/create-agent-app as the stable invocation.
MIT