| Crates.io | kodegen_daemon |
| lib.rs | kodegen_daemon |
| version | 0.1.0 |
| created_at | 2025-10-29 01:20:38.744646+00 |
| updated_at | 2025-11-03 12:41:39.707986+00 |
| description | KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents. |
| homepage | https://kodegen.ai |
| repository | https://github.com/cyrup-ai/kodegen-mcp-daemon |
| max_upload_size | |
| id | 1905908 |
| size | 329,288 |
A high-performance Unix daemon library with crossbeam-based service management.
Add to your Cargo.toml:
[dependencies]
kodegen-daemon = "0.1"
Use in your application:
use kodegen_daemon::{ServiceConfig, ServiceDefinition, ServiceManager, daemonise};
use std::path::Path;
fn main() -> anyhow::Result<()> {
// Daemonize the process
let pid_file = Path::new("/var/run/mydaemon.pid");
daemonise(&pid_file)?;
// Create service configuration
let mut config = ServiceConfig::default();
config.services.push(ServiceDefinition {
name: "my-service".to_string(),
command: "/usr/bin/my-app --daemon".to_string(),
auto_restart: true,
..Default::default()
});
// Start daemon manager
let manager = ServiceManager::new(&config)?;
manager.run()?; // Runs until SIGTERM/SIGINT
Ok(())
}
Build and install:
cargo build --release
sudo ./target/release/kodegend install
Configure services in /etc/kodegend/services/:
# /etc/kodegend/services/my-app.toml
name = "my-app"
command = "/usr/local/bin/my-app --serve"
auto_restart = true
user = "www-data"
restart_delay_s = 5
[health_check]
check_type = "http"
target = "http://localhost:8080/health"
interval_secs = 30
Start the daemon:
sudo systemctl start kodegend
Cmd/Evt enumsApache-2.0