mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 06:06:02 +09:00
- Added comprehensive hook system with GitHub checkpoints - Implemented neural optimization and memory persistence - Created performance monitoring and optimization scripts - Designed multi-LLM provider architecture for agentic-flow - Created EPIC issue #421 for agentic-flow implementation - Added 10-20x performance improvements through caching and parallelization
603 lines
16 KiB
Markdown
603 lines
16 KiB
Markdown
# Agentic Flow CLI Design & Command Structure
|
|
|
|
## CLI Architecture Overview
|
|
|
|
### Design Principles
|
|
1. **Intuitive**: Commands follow natural language patterns
|
|
2. **Consistent**: Uniform syntax across all commands
|
|
3. **Powerful**: Advanced features accessible via flags
|
|
4. **Extensible**: Plugin architecture for custom commands
|
|
5. **Enterprise-Ready**: Built-in security and compliance
|
|
|
|
## Complete Command Reference
|
|
|
|
### Core Commands
|
|
|
|
#### 1. Initialization & Setup
|
|
```bash
|
|
# Initialize new project
|
|
agentic-flow init [options]
|
|
--template <name> # Use template: api, web, ml, enterprise
|
|
--mastra # Enable Mastra integration
|
|
--enterprise # Enable enterprise features
|
|
--wizard # Interactive setup wizard
|
|
|
|
# Examples
|
|
agentic-flow init --template api --mastra
|
|
agentic-flow init --wizard --enterprise
|
|
```
|
|
|
|
#### 2. Server & Runtime Management
|
|
```bash
|
|
# Start server with various modes
|
|
agentic-flow serve [options]
|
|
--ui # Enable web UI (default: true)
|
|
--port <number> # Server port (default: 8080)
|
|
--mode <type> # Mode: development, production, enterprise
|
|
--cluster # Enable cluster mode
|
|
--metrics # Enable Prometheus metrics
|
|
--secure # Enable TLS/mTLS
|
|
|
|
# Examples
|
|
agentic-flow serve --ui --port 3000
|
|
agentic-flow serve --mode production --cluster --secure
|
|
```
|
|
|
|
#### 3. Agent Orchestration
|
|
```bash
|
|
# Orchestrate agents for objectives
|
|
agentic-flow orchestrate <objective> [options]
|
|
--strategy <type> # Strategy: parallel, sequential, adaptive
|
|
--agents <number> # Max agents (default: auto)
|
|
--timeout <seconds> # Execution timeout
|
|
--dry-run # Preview without execution
|
|
--monitor # Real-time monitoring
|
|
--cost-limit <amount> # Token cost limit
|
|
|
|
# Examples
|
|
agentic-flow orchestrate "Build REST API" --strategy parallel --monitor
|
|
agentic-flow orchestrate "Analyze codebase" --dry-run --agents 3
|
|
```
|
|
|
|
#### 4. Agent Management
|
|
```bash
|
|
# Manage individual agents
|
|
agentic-flow agent <action> [options]
|
|
|
|
# Actions:
|
|
create # Create new agent
|
|
--type <type> # Agent type: developer, analyst, tester, etc.
|
|
--name <name> # Custom name
|
|
--capabilities <list> # Comma-separated capabilities
|
|
--sandbox # Enable sandboxing
|
|
|
|
list # List all agents
|
|
--filter <query> # Filter by status, type, etc.
|
|
--format <type> # Output format: table, json, yaml
|
|
|
|
inspect <agent-id> # Detailed agent info
|
|
--metrics # Include performance metrics
|
|
--history # Include execution history
|
|
|
|
terminate <agent-id> # Stop agent
|
|
--force # Force termination
|
|
--cleanup # Clean up resources
|
|
|
|
# Examples
|
|
agentic-flow agent create --type developer --name "API Builder"
|
|
agentic-flow agent list --filter "status:active"
|
|
agentic-flow agent inspect agent-123 --metrics
|
|
```
|
|
|
|
#### 5. Methodology Commands (SPARC & Beyond)
|
|
```bash
|
|
# Execute development methodologies
|
|
agentic-flow methodology <method> <task> [options]
|
|
--method # Method: sparc, agile, tdd, ddd, clean
|
|
--phase <name> # Specific phase to execute
|
|
--parallel # Run phases in parallel
|
|
--quality-gates # Enable quality checks
|
|
|
|
# SPARC-specific shortcuts
|
|
agentic-flow sparc <phase> <task> [options]
|
|
spec # Specification phase
|
|
pseudocode # Algorithm design
|
|
architect # Architecture design
|
|
refine # Implementation & refinement
|
|
complete # Integration & completion
|
|
|
|
# Examples
|
|
agentic-flow methodology sparc "Build auth system" --quality-gates
|
|
agentic-flow sparc architect "Design microservices"
|
|
```
|
|
|
|
#### 6. State & Memory Management
|
|
```bash
|
|
# Manage distributed state
|
|
agentic-flow state <action> [options]
|
|
|
|
# Actions:
|
|
store <key> <value> # Store data
|
|
--namespace <name> # Namespace (default: global)
|
|
--ttl <seconds> # Time to live
|
|
--encrypt # Encrypt data
|
|
|
|
get <key> # Retrieve data
|
|
--namespace <name> # Namespace
|
|
--decrypt # Decrypt if encrypted
|
|
|
|
search <pattern> # Search by pattern
|
|
--namespace <name> # Search namespace
|
|
--limit <number> # Result limit
|
|
--regex # Use regex pattern
|
|
|
|
sync # Synchronize state
|
|
--source <location> # Source location
|
|
--target <location> # Target location
|
|
--bidirectional # Two-way sync
|
|
|
|
# Examples
|
|
agentic-flow state store "api.config" '{"version": "2.0"}' --encrypt
|
|
agentic-flow state search "api.*" --limit 10
|
|
```
|
|
|
|
#### 7. Version Control Integration
|
|
```bash
|
|
# Multi-VCS support
|
|
agentic-flow vcs <action> [options]
|
|
|
|
# Actions:
|
|
analyze # Analyze repository
|
|
--metrics # Code metrics
|
|
--security # Security scan
|
|
--quality # Quality assessment
|
|
|
|
pr # Pull request operations
|
|
create # Create PR
|
|
review # AI review
|
|
merge # Smart merge
|
|
|
|
release # Release management
|
|
prepare # Prepare release
|
|
deploy # Deploy release
|
|
rollback # Rollback if needed
|
|
|
|
# Examples
|
|
agentic-flow vcs analyze --security --quality
|
|
agentic-flow vcs pr review --auto-fix
|
|
```
|
|
|
|
### Cluster & Distributed Commands
|
|
|
|
#### 8. Cluster Management
|
|
```bash
|
|
# Manage agent clusters
|
|
agentic-flow cluster <action> [options]
|
|
|
|
# Actions:
|
|
init # Initialize cluster
|
|
--size <number> # Initial size
|
|
--topology <type> # mesh, star, hierarchical
|
|
--region <name> # Deployment region
|
|
|
|
deploy <objective> # Deploy to cluster
|
|
--strategy <type> # Deployment strategy
|
|
--rolling # Rolling deployment
|
|
--canary # Canary deployment
|
|
|
|
scale # Scale cluster
|
|
--size <number> # Target size
|
|
--auto # Enable autoscaling
|
|
--metrics <list> # Scaling metrics
|
|
|
|
status # Cluster status
|
|
--detailed # Detailed view
|
|
--watch # Real-time updates
|
|
|
|
# Examples
|
|
agentic-flow cluster init --size 5 --topology mesh
|
|
agentic-flow cluster deploy "Process data" --canary
|
|
```
|
|
|
|
#### 9. Consensus & Coordination
|
|
```bash
|
|
# Distributed consensus
|
|
agentic-flow consensus <action> [options]
|
|
|
|
# Actions:
|
|
propose <decision> # Propose decision
|
|
--quorum <number> # Required quorum
|
|
--timeout <seconds> # Decision timeout
|
|
|
|
vote <proposal-id> # Vote on proposal
|
|
--choice <value> # yes, no, abstain
|
|
--reason <text> # Vote reasoning
|
|
|
|
status <proposal-id> # Check consensus status
|
|
|
|
# Examples
|
|
agentic-flow consensus propose "Switch to microservices" --quorum 3
|
|
agentic-flow consensus vote prop-123 --choice yes
|
|
```
|
|
|
|
### Intelligence & Learning Commands
|
|
|
|
#### 10. Training & ML Operations
|
|
```bash
|
|
# Machine learning operations
|
|
agentic-flow train <model-type> [options]
|
|
--data <source> # Training data source
|
|
--epochs <number> # Training epochs
|
|
--validation <split> # Validation split
|
|
--gpu # Enable GPU training
|
|
--distributed # Distributed training
|
|
|
|
# Model management
|
|
agentic-flow model <action> [options]
|
|
deploy <model-id> # Deploy model
|
|
evaluate <model-id> # Evaluate performance
|
|
compare <models> # Compare models
|
|
optimize <model-id> # Optimize model
|
|
|
|
# Examples
|
|
agentic-flow train task-predictor --data ./dataset --gpu
|
|
agentic-flow model deploy model-v2 --canary --monitor
|
|
```
|
|
|
|
#### 11. Analysis & Insights
|
|
```bash
|
|
# Advanced analysis
|
|
agentic-flow analyze <target> [options]
|
|
--type <analysis> # Type: performance, security, quality
|
|
--depth <level> # Analysis depth: shallow, normal, deep
|
|
--ai-insights # Generate AI insights
|
|
--recommendations # Include recommendations
|
|
|
|
# Examples
|
|
agentic-flow analyze ./src --type security --depth deep
|
|
agentic-flow analyze cluster-123 --ai-insights
|
|
```
|
|
|
|
### Automation & Workflow Commands
|
|
|
|
#### 12. Workflow Management
|
|
```bash
|
|
# Create and manage workflows
|
|
agentic-flow workflow <action> [options]
|
|
|
|
# Actions:
|
|
create <name> # Create workflow
|
|
--template <name> # Use template
|
|
--visual # Open visual designer
|
|
|
|
run <workflow-id> # Execute workflow
|
|
--params <json> # Parameters
|
|
--async # Asynchronous execution
|
|
--monitor # Real-time monitoring
|
|
|
|
schedule <workflow-id> # Schedule workflow
|
|
--cron <expression> # Cron expression
|
|
--timezone <tz> # Timezone
|
|
|
|
# Examples
|
|
agentic-flow workflow create "Daily Build" --visual
|
|
agentic-flow workflow run wf-123 --params '{"env": "prod"}'
|
|
```
|
|
|
|
#### 13. Automation Rules
|
|
```bash
|
|
# Define automation rules
|
|
agentic-flow automate <action> [options]
|
|
|
|
# Actions:
|
|
rule create # Create automation rule
|
|
--trigger <event> # Trigger event
|
|
--condition <expr> # Condition expression
|
|
--action <command> # Action to execute
|
|
|
|
policy set # Set automation policy
|
|
--scope <target> # Policy scope
|
|
--rules <file> # Rules file
|
|
|
|
# Examples
|
|
agentic-flow automate rule create --trigger "pr.opened" --action "run tests"
|
|
agentic-flow automate policy set --scope project --rules ./policies.yaml
|
|
```
|
|
|
|
### Enterprise Commands
|
|
|
|
#### 14. Security & Compliance
|
|
```bash
|
|
# Security operations
|
|
agentic-flow security <action> [options]
|
|
|
|
# Actions:
|
|
scan # Security scan
|
|
--target <path> # Scan target
|
|
--profile <name> # Security profile
|
|
--fix # Auto-fix issues
|
|
|
|
audit # Compliance audit
|
|
--standard <name> # Standard: SOC2, HIPAA, GDPR
|
|
--report # Generate report
|
|
|
|
encrypt # Encrypt data
|
|
--data <input> # Data to encrypt
|
|
--key <id> # Encryption key
|
|
|
|
# Examples
|
|
agentic-flow security scan --target . --profile strict --fix
|
|
agentic-flow security audit --standard SOC2 --report
|
|
```
|
|
|
|
#### 15. Multi-Tenancy
|
|
```bash
|
|
# Tenant management
|
|
agentic-flow tenant <action> [options]
|
|
|
|
# Actions:
|
|
create <name> # Create tenant
|
|
--tier <level> # Tier: starter, pro, enterprise
|
|
--region <name> # Deployment region
|
|
|
|
switch <tenant-id> # Switch context
|
|
configure <tenant-id> # Configure tenant
|
|
isolate <tenant-id> # Ensure isolation
|
|
|
|
# Examples
|
|
agentic-flow tenant create "AcmeCorp" --tier enterprise
|
|
agentic-flow tenant switch tenant-123
|
|
```
|
|
|
|
### Monitoring & Operations
|
|
|
|
#### 16. Monitoring Commands
|
|
```bash
|
|
# System monitoring
|
|
agentic-flow monitor <target> [options]
|
|
--metrics <list> # Metrics to monitor
|
|
--interval <seconds> # Update interval
|
|
--dashboard # Open dashboard
|
|
--alerts # Configure alerts
|
|
|
|
# Examples
|
|
agentic-flow monitor cluster --metrics cpu,memory --dashboard
|
|
agentic-flow monitor costs --alerts --interval 60
|
|
```
|
|
|
|
#### 17. Debugging & Diagnostics
|
|
```bash
|
|
# Debug operations
|
|
agentic-flow debug <target> [options]
|
|
--trace # Enable tracing
|
|
--profile # Performance profiling
|
|
--breakpoint <loc> # Set breakpoints
|
|
--replay <session> # Replay session
|
|
|
|
# Diagnostics
|
|
agentic-flow diagnose [options]
|
|
--component <name> # Specific component
|
|
--deep # Deep diagnostics
|
|
--fix # Attempt auto-fix
|
|
|
|
# Examples
|
|
agentic-flow debug agent-123 --trace --profile
|
|
agentic-flow diagnose --component memory --fix
|
|
```
|
|
|
|
### Utility Commands
|
|
|
|
#### 18. Configuration Management
|
|
```bash
|
|
# Manage configurations
|
|
agentic-flow config <action> [options]
|
|
|
|
# Actions:
|
|
get <key> # Get config value
|
|
set <key> <value> # Set config value
|
|
validate # Validate configuration
|
|
export # Export configuration
|
|
import <file> # Import configuration
|
|
|
|
# Examples
|
|
agentic-flow config set api.timeout 30
|
|
agentic-flow config validate --strict
|
|
```
|
|
|
|
#### 19. Plugin Management
|
|
```bash
|
|
# Manage plugins
|
|
agentic-flow plugin <action> [options]
|
|
|
|
# Actions:
|
|
install <name> # Install plugin
|
|
--version <ver> # Specific version
|
|
--source <url> # Custom source
|
|
|
|
list # List plugins
|
|
enable <name> # Enable plugin
|
|
disable <name> # Disable plugin
|
|
|
|
# Examples
|
|
agentic-flow plugin install @mastra/advanced-analytics
|
|
agentic-flow plugin list --enabled
|
|
```
|
|
|
|
#### 20. Help & Documentation
|
|
```bash
|
|
# Get help
|
|
agentic-flow help [command]
|
|
agentic-flow <command> --help
|
|
agentic-flow docs <topic>
|
|
agentic-flow tutorial <name>
|
|
|
|
# Interactive mode
|
|
agentic-flow interactive
|
|
agentic-flow shell
|
|
```
|
|
|
|
## Advanced Features
|
|
|
|
### 1. Batch Operations
|
|
```bash
|
|
# Execute batch operations
|
|
agentic-flow batch <file> [options]
|
|
--parallel <number> # Parallel execution
|
|
--on-error <action> # Error handling: stop, continue, rollback
|
|
--progress # Show progress
|
|
|
|
# Example batch file
|
|
# batch.yaml
|
|
operations:
|
|
- orchestrate: "Build API"
|
|
strategy: parallel
|
|
- analyze: "./src"
|
|
type: security
|
|
- test: all
|
|
coverage: 80
|
|
```
|
|
|
|
### 2. Pipeline Definitions
|
|
```bash
|
|
# Define CI/CD pipelines
|
|
agentic-flow pipeline <action> [options]
|
|
|
|
# Example pipeline
|
|
# pipeline.yaml
|
|
name: "Production Deploy"
|
|
stages:
|
|
- name: "Test"
|
|
commands:
|
|
- test: all
|
|
- analyze: security
|
|
- name: "Build"
|
|
commands:
|
|
- build: production
|
|
- name: "Deploy"
|
|
commands:
|
|
- deploy: canary
|
|
- monitor: 300
|
|
- deploy: full
|
|
```
|
|
|
|
### 3. Interactive Shell
|
|
```bash
|
|
# Enter interactive shell
|
|
agentic-flow shell
|
|
|
|
# Shell commands
|
|
AF> orchestrate "Build feature"
|
|
AF> agent list
|
|
AF> monitor --dashboard
|
|
AF> exit
|
|
```
|
|
|
|
## Environment Variables
|
|
|
|
```bash
|
|
# Core configuration
|
|
AGENTIC_FLOW_HOME=/opt/agentic-flow
|
|
AGENTIC_FLOW_CONFIG=/etc/agentic-flow/config.yaml
|
|
AGENTIC_FLOW_LOG_LEVEL=info
|
|
|
|
# Mastra integration
|
|
MASTRA_API_KEY=your-api-key
|
|
MASTRA_ENDPOINT=https://api.mastra.ai
|
|
|
|
# Enterprise features
|
|
AF_ENTERPRISE_LICENSE=license-key
|
|
AF_TENANT_ID=tenant-123
|
|
AF_REGION=us-east-1
|
|
|
|
# Performance tuning
|
|
AF_MAX_WORKERS=16
|
|
AF_CACHE_SIZE=1024
|
|
AF_TIMEOUT=300
|
|
```
|
|
|
|
## Configuration File
|
|
|
|
```yaml
|
|
# ~/.agentic-flow/config.yaml
|
|
version: "1.0"
|
|
|
|
# Core settings
|
|
core:
|
|
mode: production
|
|
region: us-east-1
|
|
timeout: 300
|
|
|
|
# Mastra integration
|
|
mastra:
|
|
enabled: true
|
|
api_key: ${MASTRA_API_KEY}
|
|
features:
|
|
- workflows
|
|
- integrations
|
|
- analytics
|
|
|
|
# Agent configuration
|
|
agents:
|
|
max_concurrent: 10
|
|
default_timeout: 120
|
|
sandbox: true
|
|
resource_limits:
|
|
cpu: "2"
|
|
memory: "4Gi"
|
|
|
|
# Security settings
|
|
security:
|
|
encryption: true
|
|
audit_logging: true
|
|
compliance:
|
|
- SOC2
|
|
- HIPAA
|
|
|
|
# Monitoring
|
|
monitoring:
|
|
metrics:
|
|
enabled: true
|
|
port: 9090
|
|
tracing:
|
|
enabled: true
|
|
sampling_rate: 0.1
|
|
```
|
|
|
|
## Shell Completion
|
|
|
|
```bash
|
|
# Bash completion
|
|
agentic-flow completion bash > /etc/bash_completion.d/agentic-flow
|
|
|
|
# Zsh completion
|
|
agentic-flow completion zsh > "${fpath[1]}/_agentic-flow"
|
|
|
|
# Fish completion
|
|
agentic-flow completion fish > ~/.config/fish/completions/agentic-flow.fish
|
|
|
|
# PowerShell completion
|
|
agentic-flow completion powershell > $PROFILE
|
|
```
|
|
|
|
## Migration from Claude Flow
|
|
|
|
```bash
|
|
# One-command migration
|
|
curl -fsSL https://get.agentic-flow.mastra.ai/migrate | bash
|
|
|
|
# Or manual migration
|
|
agentic-flow migrate from-claude-flow [options]
|
|
--backup # Create backup
|
|
--dry-run # Preview changes
|
|
--config <file> # Claude Flow config
|
|
--output <dir> # Output directory
|
|
```
|
|
|
|
## Conclusion
|
|
|
|
The Agentic Flow CLI provides a comprehensive, intuitive interface that:
|
|
1. **Maintains familiarity** for Claude Flow users
|
|
2. **Adds enterprise features** for production use
|
|
3. **Integrates Mastra** capabilities seamlessly
|
|
4. **Scales efficiently** for any workload
|
|
5. **Ensures security** and compliance |