@egintegrations/bot-cli
v0.1.0
Published
CLI for managing bots in the Agent Fleet Platform
Readme
Bot CLI
Command-line interface for managing bots in the Agent Fleet Platform.
Installation
pnpm install
pnpm buildCommands
create-bot
Create a new bot from template.
bot-cli create-bot [options]
Options:
-n, --name <name> Bot name
-r, --runtime <runtime> Runtime (node or python)
-d, --dir <directory> Output directoryExample:
bot-cli create-bot --name scheduler-bot --runtime noderegister-bot
Register a bot with the orchestrator.
bot-cli register-bot [options]
Options:
-m, --manifest <path> Path to manifest.json
-u, --url <url> Bot URLExample:
cd scheduler-bot
bot-cli register-bot --url http://localhost:3000deploy-bot
Deploy bot via GitOps (creates PR).
bot-cli deploy-bot [options]
Options:
-m, --manifest <path> Path to manifest.json
-e, --env <environment> Environment (staging, production)
-r, --repo <repo> GitOps repositoryExample:
bot-cli deploy-bot --env staging --repo myorg/deploymentslist-bots
List all registered bots.
bot-cli list-bots [options]
Options:
--status <status> Filter by status (active, inactive)Example:
bot-cli list-bots --status activedoctor
Check environment and dependencies.
bot-cli doctorChecks:
- Node.js version (>= 20.0.0)
- Docker installation
- kubectl installation
- gh CLI installation (optional)
- Environment variables
- Orchestrator API connection
Configuration
Set environment variables:
export ORCHESTRATOR_API_URL=http://localhost:8000
export ORCHESTRATOR_API_KEY=your-api-key
export GITOPS_REPO=myorg/deploymentsOr create a .env file:
ORCHESTRATOR_API_URL=http://localhost:8000
ORCHESTRATOR_API_KEY=your-api-key
GITOPS_REPO=myorg/deploymentsBot Manifest
The bot manifest (manifest.json) defines bot configuration:
{
"name": "scheduler-bot",
"version": "1.0.0",
"description": "Manages calendar events and meeting scheduling",
"runtime": "node",
"image": "ghcr.io/yourorg/scheduler-bot:v1.0.0",
"resources": {
"cpu": "500m",
"memory": "512Mi",
"gpu": false
},
"scaling": {
"min": 1,
"max": 10,
"targetCPU": 70
},
"capabilities": [
{
"name": "schedule_meeting",
"description": "Create calendar event with Meet link",
"parameters": {
"title": "string",
"attendees": "string[]",
"start_time": "datetime",
"duration_minutes": "number"
}
}
],
"integrations": ["google-calendar", "google-meet"],
"policies": {
"requireApproval": false,
"maxCostPerTask": 0.50,
"rateLimit": "100/hour"
},
"endpoints": {
"health": "/healthz",
"readiness": "/readyz",
"metrics": "/metrics",
"tools": "/tools"
}
}Workflow
1. Create Bot
bot-cli create-bot --name my-bot --runtime node
cd my-bot
pnpm install2. Develop Bot
Edit src/index.ts to implement your bot's capabilities.
pnpm dev3. Register Bot
bot-cli register-bot --url http://localhost:30004. Deploy Bot
# Deploy to staging
bot-cli deploy-bot --env staging
# Review PR, get approval, merge
# Deploy to production
bot-cli deploy-bot --env productionGitOps Integration
The CLI integrates with GitHub for GitOps deployments:
- Generates Kubernetes manifests (Deployment, Service, HPA, ServiceMonitor)
- Creates feature branch in GitOps repo
- Commits manifests
- Opens pull request
- CI runs validation and security checks
- Team reviews and approves
- PR merge triggers Argo CD sync
- Bot deployed to cluster
Kubernetes Manifests
Generated manifests include:
- deployment.yaml: Pod template, resources, probes
- service.yaml: ClusterIP service for internal traffic
- hpa.yaml: Horizontal Pod Autoscaler
- servicemonitor.yaml: Prometheus metrics scraping
Testing
pnpm testDevelopment
# Watch mode
pnpm dev -- create-bot --name test-bot
# Build
pnpm build
# Run built version
node dist/index.js --helpDependencies
- commander: CLI framework
- inquirer: Interactive prompts
- axios: HTTP client
- chalk: Terminal colors
- ora: Loading spinners
- zod: Schema validation
- js-yaml: YAML generation
Related Packages
- Bot SDK Node - Bot runtime SDK
- Policy Engine - Policy validation
License
See LICENSE
