@agentforge/cli
Command-line tool for project management and development.
Installation
# Global installation
pnpm add -g @agentforge/cli
# Or use with npx
npx @agentforge/cli <command>Commands
create
Create a new AgentForge project.
agentforge create <project-name> [options]Options
--template <name>- Project template (minimal, full, api, cli)--package-manager <pm>- Package manager (pnpm, npm, yarn)--no-install- Skip dependency installation--no-git- Skip git initialization
Examples
# Create minimal project
agentforge create my-agent
# Create with specific template
agentforge create my-api --template api
# Create CLI project
agentforge create my-cli --template cli
# Create without installing dependencies
agentforge create my-agent --no-installdev
Start development server with hot reload.
agentforge dev [options]Options
-p, --port <number>- Server port (default: 3000)--no-open- Do not open browser automatically
Examples
# Start dev server
agentforge dev
# Custom port
agentforge dev --port 8080
# Don't open browser
agentforge dev --no-openbuild
Build project for production.
agentforge build [options]Options
--no-minify- Skip minification--no-sourcemap- Skip sourcemap generation
Examples
# Build for production (with minification and sourcemaps)
agentforge build
# Build without minification
agentforge build --no-minify
# Build without sourcemaps
agentforge build --no-sourcemaptest
Run tests.
agentforge test [options]Options
--watch- Watch mode--coverage- Generate coverage report--ui- Open Vitest UI
Examples
# Run tests
agentforge test
# Watch mode with coverage
agentforge test --watch --coverageagent
Manage agents in your project.
agentforge agent <command> [options]Commands
create <name>- Create a new agentcreate-reusable <name>- Create a reusable agent (production template)list- List all agentstest <name>- Test a specific agentdeploy <name>- Deploy an agent (not yet implemented)
Examples
# Create a new agent
agentforge agent create research-agent
# Create with specific pattern
agentforge agent create my-agent --pattern plan-execute
# Create reusable agent
agentforge agent create-reusable my-agent --description "A reusable agent"
# List all agents
agentforge agent list
# Test an agent
agentforge agent test research-agenttool
Manage tools in your project.
agentforge tool <command> [options]Commands
create <name>- Create a new toollist- List all toolstest <name>- Test a specific toolpublish <name>- Publish a tool to npm
Examples
# Create a new tool
agentforge tool create web-search
# Create with category
agentforge tool create my-tool --category web
# List all tools
agentforge tool list
# Test a tool
agentforge tool test web-search
# Publish a tool
agentforge tool publish my-tool --tag latestagent deploy
Deploy an agent (currently not implemented - use manual deployment).
agentforge agent deploy <name> [options]Options
--environment <env>- Deployment environment (default: production)--dry-run- Dry run without actual deployment
Note
Automated agent deployment is not yet implemented. Please use one of the following deployment methods:
1. Docker Deployment:
- See
templates/deployment/docker/for Dockerfile and docker-compose.yml - Run:
docker build -t my-agent . && docker run my-agent
2. Kubernetes Deployment:
- See
templates/deployment/kubernetes/for manifests - Run:
kubectl apply -f templates/deployment/kubernetes/
3. Serverless Deployment:
- AWS Lambda: Use SAM or Serverless Framework
- Vercel: Use
vercel deploy - Google Cloud Run: Use
gcloud run deploy
4. Manual Deployment:
- Build:
npm run build - Test:
npm test - Deploy to your platform of choice
For detailed deployment guides, see the deployment documentation.
Environment Variables
The CLI respects these environment variables:
NODE_ENV- Environment (development, production)PORT- Development server port (for dev command)NO_MINIFY- Skip minification (for build command)NO_SOURCEMAP- Skip sourcemap generation (for build command)
Examples
Complete Workflow
# Create project
agentforge create my-agent
# Navigate to project
cd my-agent
# Start development
agentforge dev
# Run tests
agentforge test --watch
# Build for production
agentforge buildFor deployment, see the deployment guide for platform-specific instructions (Docker, Kubernetes, Serverless, etc.).
Troubleshooting
Command Not Found
If agentforge command is not found:
# Install globally
pnpm add -g @agentforge/cli
# Or use npx
npx @agentforge/cli <command>Permission Errors
On Unix systems, you may need to use sudo:
sudo pnpm add -g @agentforge/cliProgrammatic API
The CLI can also be used programmatically:
import { program, run } from '@agentforge/cli';
// Run the CLI programmatically
await run();
// Or access the Commander.js program instance directly
// to add custom commands or modify behavior
program
.command('custom')
.description('Custom command')
.action(() => {
console.log('Custom command executed');
});