MCPcopy Index your code
hub / github.com/blockjoy/firec

github.com/blockjoy/firec @0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.2.0 ↗ · + Follow
87 symbols 175 edges 8 files 50 documented · 57%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

firec

firec (pronounced "fyrek") is Rust client library to interact with Firecracker. It allows you to create, manipulate, query and stop VMMs.

Examples

```rust,no_run use std::path::Path; use firec::{ Machine, config::{Config, Drive, Jailer, Machine as MachineCfg, network::Interface}}; use tokio::time::{sleep, Duration};

[tokio::main]

async fn main() -> Result<(), Box> { let kernel_args = "console=ttyS0 reboot=k panic=1 pci=off random.trust_cpu=on";

let iface = Interface::new("eth0", "tap0");

let config = Config::builder(None, Path::new("debian-vmlinux"))
    .jailer_cfg()
        .chroot_base_dir(Path::new("/srv"))
        .exec_file(Path::new("/usr/bin/firecracker"))
        .build()
    .kernel_args(kernel_args)
    .machine_cfg()
        .vcpu_count(2)
        .mem_size_mib(1024)
        .build()
    .add_drive("root", Path::new("debian.ext4"))
        .is_root_device(true)
        .build()
    .add_network_interface(iface)
    .socket_path(Path::new("/tmp/firecracker.socket"))
    .build();
let mut machine = Machine::create(config).await?;

machine.start().await?;

// Let the machine run for a bit before we KILL IT :)
sleep(Duration::from_secs(15)).await;

machine.force_shutdown().await?;

Ok(())

} ```

status

Currently heavily in development and therefore expect a lot of API breakage for a while.

Having said that, we'll be following Cargo's SemVer rules so breaking changes will be released in new minor releases. However, we will only support the latest release.

Core symbols most depended-on inside this repo

vm_id
called by 14
src/config/mod.rs
host_socket_path
called by 7
src/config/mod.rs
workspace_dir
called by 6
src/config/jailer.rs
send_request
called by 5
src/machine.rs
jailer
called by 5
src/config/mod.rs
jailer_cfg
called by 3
src/config/mod.rs
build
called by 3
src/config/mod.rs
exec_file
called by 3
src/config/jailer.rs

Shape

Method 68
Class 12
Enum 5
Function 2

Languages

Rust100%

Modules by API surface

src/config/mod.rs29 symbols
src/machine.rs19 symbols
src/config/jailer.rs14 symbols
src/config/machine.rs10 symbols
src/config/drive.rs9 symbols
src/config/network.rs5 symbols
src/error.rs1 symbols

For agents

$ claude mcp add firec \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact