mielin-cli
Command Line Interface - mielinctl
Control and management tool for MielinOS clusters and agents.
Features
- Node Management: Start, stop, and monitor nodes
- Agent Operations: Deploy, migrate, and terminate agents
- Mesh Inspection: View network topology and status
- Interactive & Scripting: Both CLI and programmatic usage
Installation
Build from source:
The binary will be at target/release/mielinctl.
Usage
Available Commands
Node Management
# List all nodes in the mesh
# Show detailed info about a node
# Start a node
# Stop a node
Agent Management
# List running agents
# Deploy a new agent
# Migrate an agent to another node
# Stop an agent
Mesh Operations
# Show mesh network status
# List connected peers
Examples
Deploy an Agent
# Compile your agent to WASM
# Deploy to the mesh
Migrate Agent
# Get agent ID
AGENT_ID=
# Find target node
TARGET=
# Perform migration
Monitor Mesh
# Watch mesh status
# List all peers with details
Architecture
The CLI is built with:
- clap: Command-line argument parsing
- tokio: Async runtime
- tracing: Structured logging
use *;
async
Command Reference
node Commands
| Command | Description | Example |
|---|---|---|
list |
List all nodes | mielinctl node list |
info <ID> |
Show node details | mielinctl node info abc123 |
start |
Start local node | mielinctl node start |
stop |
Stop local node | mielinctl node stop |
agent Commands
| Command | Description | Example |
|---|---|---|
list |
List agents | mielinctl agent list |
deploy <PATH> |
Deploy WASM | mielinctl agent deploy app.wasm |
migrate <ID> <NODE> |
Migrate agent | mielinctl agent migrate id123 node456 |
stop <ID> |
Stop agent | mielinctl agent stop id123 |
mesh Commands
| Command | Description | Example |
|---|---|---|
status |
Show mesh status | mielinctl mesh status |
peers |
List peers | mielinctl mesh peers |
Configuration
Future: Configuration file support:
# ~/.mielin/config.toml
[]
= "my-node-id"
= "relay"
[]
= [
"node1.example.com:7070",
"node2.example.com:7070"
]
[]
= 10
= { = 20, = 100 }
Output Formats
Future: Multiple output formats:
# JSON output
# YAML output
# Table output (default)
Scripting
Use in scripts:
#!/bin/bash
# Deploy multiple agents
for; do
done
# Check mesh health
if | ; then
else
fi
Development
The CLI is implemented as subcommands:
Future Enhancements
- Interactive TUI mode
- Configuration file support
- Multiple output formats (JSON, YAML)
- Shell completion
- Agent logs streaming
- Real-time metrics display
- Cluster orchestration
- Backup/restore operations
API Integration
Currently, the CLI provides stubs. Future integration:
async
Testing
Logging
Enable detailed logging:
RUST_LOG=debug
License
MIT OR Apache-2.0