Skip to main content

Virtual Machine Commands

NikCLI provides comprehensive virtual machine and container management for isolated development environments. These commands enable you to create, manage, and interact with containerized development environments.

Core VM Commands

/vm [action]

Main VM management command with multiple sub-actions. Syntax:
Available Actions:
  • list - List all VMs
  • create - Create new VM
  • start - Start VM
  • stop - Stop VM
  • remove - Remove VM
  • connect - Connect to VM
  • status - Show VM status
  • logs - Show VM logs
Examples:

/vm-create [config]

Create a new virtual machine with specified configuration. Syntax:
Parameters:
  • image - Base Docker image or predefined template
  • options - VM configuration options
Predefined Templates:
  • node - Node.js development environment
  • python - Python development environment
  • go - Go development environment
  • rust - Rust development environment
  • java - Java development environment
  • php - PHP development environment
  • ruby - Ruby development environment
  • full-stack - Complete development stack
Examples:
Configuration Options:
  • --name <name> - VM name
  • --port <host:container> - Port mapping
  • --volume <host:container> - Volume mounting
  • --env <key=value> - Environment variables
  • --memory <size> - Memory limit
  • --cpu <count> - CPU limit
  • --network <network> - Network configuration

/vm-list

List all virtual machines with detailed information. Syntax:
Options:
  • --all - Show all VMs (including stopped)
  • --running - Show only running VMs
  • --json - Output in JSON format
Examples:
Output Format:

/vm-connect [id]

Connect to a running virtual machine. Syntax:
Parameters:
  • vm-name - Name or ID of the VM to connect to
Options:
  • --shell <shell> - Shell to use (bash, zsh, sh)
  • --user <user> - User to connect as
  • --workdir <path> - Working directory
Examples:
Interactive Features:
  • Full terminal emulation
  • File system access
  • Port forwarding
  • Environment synchronization
  • Session persistence

/vm-stop [id]

Stop a running virtual machine. Syntax:
Options:
  • --force - Force stop (kill)
  • --timeout <seconds> - Graceful shutdown timeout
Examples:

/vm-remove [id]

Remove a virtual machine and its data. Syntax:
Options:
  • --force - Skip confirmation
  • --volumes - Remove associated volumes
  • --images - Remove associated images
Examples:

Advanced VM Commands

/vm-logs [id]

View logs from a virtual machine. Syntax:
Options:
  • --follow - Follow logs in real-time
  • --tail <lines> - Show last N lines
  • --since <time> - Show logs since timestamp
Examples:

/vm-status [id]

Show detailed status information for a VM. Syntax:
Options:
  • --json - Output in JSON format
  • --detailed - Show detailed information
Examples:
Status Information:
  • Container state and health
  • Resource usage (CPU, memory, disk)
  • Network configuration
  • Volume mounts
  • Environment variables
  • Process list
  • Port mappings

/vm-exec [id] [command]

Execute commands inside a virtual machine. Syntax:
Options:
  • --user <user> - Execute as specific user
  • --workdir <path> - Set working directory
  • --env <key=value> - Set environment variables
  • --interactive - Interactive mode
Examples:

/vm-dashboard

Show a comprehensive dashboard of all VMs. Syntax:
Options:
  • --refresh <seconds> - Auto-refresh interval
  • --compact - Compact view
Examples:
Dashboard Features:
  • Real-time resource usage
  • VM status overview
  • Network activity
  • Performance metrics
  • Quick action buttons

VM Management Commands

/vm-mode

Switch to VM development mode. Syntax:
Features:
  • Automatic VM selection
  • Context switching
  • Resource optimization
  • Session management
Examples:

/vm-switch

Switch between different VMs. Syntax:
Examples:

/vm-select [args]

Select and configure active VM. Syntax:
Examples:

VM Utility Commands

/vm-ls [id]

List files in VM filesystem. Syntax:
Examples:

/vm-broadcast [message]

Send message to all running VMs. Syntax:
Examples:

/vm-health

Check health of all VMs. Syntax:
Examples:

/vm-backup [id]

Create backup of VM state. Syntax:
Options:
  • --name <backup-name> - Backup name
  • --compress - Compress backup
  • --exclude <patterns> - Exclude patterns
Examples:

/vm-stats [id]

Show VM statistics and metrics. Syntax:
Options:
  • --real-time - Real-time monitoring
  • --history - Historical data
  • --export - Export data
Examples:

VM Templates and Presets

Predefined Templates

Node.js Development:
Python Data Science:
Full-Stack Web:
Mobile Development:

Custom Templates

Create custom VM templates:

VM Networking

Port Management

Network Configuration

VM Storage

Volume Management

File Synchronization

Performance Optimization

Resource Limits

Performance Monitoring

Integration Examples

Development Workflow

Team Collaboration

CI/CD Integration

Troubleshooting

Common Issues

VM won’t start:
Connection issues:
Performance issues:

Debug Commands

Best Practices

VM Management

  • Use descriptive VM names
  • Regular backup of important VMs
  • Monitor resource usage
  • Clean up unused VMs regularly

Development

  • Use appropriate base images
  • Mount source code as volumes
  • Use environment variables for configuration
  • Implement proper logging

Security

  • Use non-root users when possible
  • Limit resource usage
  • Regular security updates
  • Network isolation when needed

Performance

  • Optimize Docker images
  • Use appropriate resource limits
  • Monitor and profile regularly
  • Use caching strategies