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:
list- List all VMscreate- Create new VMstart- Start VMstop- Stop VMremove- Remove VMconnect- Connect to VMstatus- Show VM statuslogs- Show VM logs
/vm-create [config]
Create a new virtual machine with specified configuration.
Syntax:
image- Base Docker image or predefined templateoptions- VM configuration options
node- Node.js development environmentpython- Python development environmentgo- Go development environmentrust- Rust development environmentjava- Java development environmentphp- PHP development environmentruby- Ruby development environmentfull-stack- Complete development stack
--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:
--all- Show all VMs (including stopped)--running- Show only running VMs--json- Output in JSON format
/vm-connect [id]
Connect to a running virtual machine.
Syntax:
vm-name- Name or ID of the VM to connect to
--shell <shell>- Shell to use (bash, zsh, sh)--user <user>- User to connect as--workdir <path>- Working directory
- Full terminal emulation
- File system access
- Port forwarding
- Environment synchronization
- Session persistence
/vm-stop [id]
Stop a running virtual machine.
Syntax:
--force- Force stop (kill)--timeout <seconds>- Graceful shutdown timeout
/vm-remove [id]
Remove a virtual machine and its data.
Syntax:
--force- Skip confirmation--volumes- Remove associated volumes--images- Remove associated images
Advanced VM Commands
/vm-logs [id]
View logs from a virtual machine.
Syntax:
--follow- Follow logs in real-time--tail <lines>- Show last N lines--since <time>- Show logs since timestamp
/vm-status [id]
Show detailed status information for a VM.
Syntax:
--json- Output in JSON format--detailed- Show detailed 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:
--user <user>- Execute as specific user--workdir <path>- Set working directory--env <key=value>- Set environment variables--interactive- Interactive mode
/vm-dashboard
Show a comprehensive dashboard of all VMs.
Syntax:
--refresh <seconds>- Auto-refresh interval--compact- Compact view
- 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:
- Automatic VM selection
- Context switching
- Resource optimization
- Session management
/vm-switch
Switch between different VMs.
Syntax:
/vm-select [args]
Select and configure active VM.
Syntax:
VM Utility Commands
/vm-ls [id]
List files in VM filesystem.
Syntax:
/vm-broadcast [message]
Send message to all running VMs.
Syntax:
/vm-health
Check health of all VMs.
Syntax:
/vm-backup [id]
Create backup of VM state.
Syntax:
--name <backup-name>- Backup name--compress- Compress backup--exclude <patterns>- Exclude patterns
/vm-stats [id]
Show VM statistics and metrics.
Syntax:
--real-time- Real-time monitoring--history- Historical data--export- Export data
VM Templates and Presets
Predefined Templates
Node.js 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: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