| Crates.io | mielin-cli |
| lib.rs | mielin-cli |
| version | 0.1.0-rc.1 |
| created_at | 2026-01-18 02:34:54.009797+00 |
| updated_at | 2026-01-18 02:34:54.009797+00 |
| description | Command-line interface and control plane for MielinOS distributed agent mesh |
| homepage | |
| repository | https://github.com/cool-japan/mielin |
| max_upload_size | |
| id | 2051628 |
| size | 603,883 |
Command Line Interface - mielinctl
Control and management tool for MielinOS clusters and agents.
Build from source:
cargo build --release -p mielin-cli
The binary will be at target/release/mielinctl.
mielinctl <COMMAND>
# List all nodes in the mesh
mielinctl node list
# Show detailed info about a node
mielinctl node info <NODE_ID>
# Start a node
mielinctl node start
# Stop a node
mielinctl node stop
# List running agents
mielinctl agent list
# Deploy a new agent
mielinctl agent deploy <WASM_PATH>
# Migrate an agent to another node
mielinctl agent migrate <AGENT_ID> <TARGET_NODE>
# Stop an agent
mielinctl agent stop <AGENT_ID>
# Show mesh network status
mielinctl mesh status
# List connected peers
mielinctl mesh peers
# Compile your agent to WASM
rustc --target wasm32-unknown-unknown myagent.rs
# Deploy to the mesh
mielinctl agent deploy myagent.wasm
# Get agent ID
AGENT_ID=$(mielinctl agent list | grep myagent | cut -d' ' -f1)
# Find target node
TARGET=$(mielinctl mesh peers | head -1 | cut -d' ' -f1)
# Perform migration
mielinctl agent migrate $AGENT_ID $TARGET
# Watch mesh status
watch -n 1 mielinctl mesh status
# List all peers with details
mielinctl mesh peers --verbose
The CLI is built with:
use mielin_cli::*;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
match cli.command {
Commands::Node { action } => handle_node_command(action).await,
Commands::Agent { action } => handle_agent_command(action).await,
Commands::Mesh { action } => handle_mesh_command(action).await,
}
}
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 |
Future: Configuration file support:
# ~/.mielin/config.toml
[node]
id = "my-node-id"
role = "relay"
[mesh]
bootstrap_nodes = [
"node1.example.com:7070",
"node2.example.com:7070"
]
[agents]
max_concurrent = 10
default_policy = { min_battery = 20, max_latency = 100 }
Future: Multiple output formats:
# JSON output
mielinctl agent list --output json
# YAML output
mielinctl node info <ID> --output yaml
# Table output (default)
mielinctl mesh peers
Use in scripts:
#!/bin/bash
# Deploy multiple agents
for agent in agents/*.wasm; do
mielinctl agent deploy "$agent"
done
# Check mesh health
if mielinctl mesh status | grep -q "Healthy"; then
echo "Mesh is healthy"
else
echo "Mesh has issues"
exit 1
fi
The CLI is implemented as subcommands:
#[derive(Subcommand)]
enum Commands {
Node {
#[command(subcommand)]
action: NodeCommands,
},
Agent {
#[command(subcommand)]
action: AgentCommands,
},
Mesh {
#[command(subcommand)]
action: MeshCommands,
},
}
Currently, the CLI provides stubs. Future integration:
async fn handle_agent_deploy(path: String) -> anyhow::Result<()> {
let wasm = std::fs::read(&path)?;
let agent = Agent::new(wasm);
let client = MielinClient::connect("localhost:7070").await?;
let agent_id = client.deploy_agent(agent).await?;
println!("Deployed agent: {}", agent_id);
Ok(())
}
cargo test -p mielin-cli
Enable detailed logging:
RUST_LOG=debug mielinctl agent deploy myagent.wasm
MIT OR Apache-2.0