agentcn
v0.2.1
Published
A CLI for adding AI agents to your project
Maintainers
Readme
agentcn
A CLI for adding AI agents to your project.
Install reusable, editable agent source — prompts, tools, and runtime logic — directly into your Next.js app. You own the code.
add
Use the add command to install an agent into your project.
The add command fetches the agent from the AgentCN registry, installs missing dependencies, writes source files under ai/agents/, updates .env.example, and configures TypeScript path aliases.
npx agentcn@latest add web-agentExample
pnpm dlx agentcn@latest add web-agentPreview changes without writing files:
npx agentcn@latest add web-agent --dry-run --yesOptions
-r, --registry <path|url>— Registry path or URL (default:https://agentcn.dev/r)--dry-run— Preview the install plan--yes— Non-interactive mode--overwrite— Overwrite existing files--verbose— Verbose output--cwd <path>— Target project directory
list
Use the list command to view available agents in the registry.
npx agentcn@latest listinfo
Use the info command to show details for a specific agent (dependencies, env vars, files).
npx agentcn@latest info web-agentAfter install
- Copy required keys from
.env.exampleto.env.local - Import the agent in your chat API route:
import { webAgent } from "@/agents/web";
export async function POST(req: Request) {
const { messages } = await req.json();
const result = webAgent(messages);
return result.toUIMessageStreamResponse();
}Documentation
Visit https://agentcn.dev/docs to view the documentation.
Registry: https://agentcn.dev/r
License
Licensed under the MIT license. See LICENSE.
