Expand description
§devops-toolkit
All-in-one DevOps toolkit for Rust: typed serde models + offline YAML validation and auto-repair.
This is a meta-crate that re-exports:
- devops-models — typed
serdemodels for Kubernetes, Docker Compose, GitLab CI, GitHub Actions, Prometheus, Alertmanager, Helm, Ansible, OpenAPI, and LLM types. - devops-validate — YAML type detection, structural + semantic validation, JSON Schema registry, declarative rule engine, and 6-stage auto-repair pipeline.
§Quick start
[dependencies]
devops-toolkit = "0.1"§Validate with auto-detection
ⓘ
use devops_toolkit::validate::validate_auto;
let result = validate_auto(yaml_str);
if !result.valid {
for err in &result.errors {
eprintln!("Error: {}", err);
}
}
for warn in &result.warnings {
println!("Warning: {}", warn);
}§Parse typed models
ⓘ
use devops_toolkit::models::{
k8s::K8sDeployment,
docker_compose::DockerCompose,
};
// serde_yaml is a transitive dependency — add it to your Cargo.toml
let deployment: K8sDeployment = serde_yaml::from_str(yaml).unwrap();
let compose: DockerCompose = serde_yaml::from_str(yaml).unwrap();§Auto-repair
ⓘ
use devops_toolkit::repair::repair_yaml;
let result = repair_yaml(yaml_str, &schema);
println!("{}", result.repaired_yaml);§Schema registry
use devops_toolkit::schema::SchemaRegistry;
let mut registry = SchemaRegistry::new();
let schema = registry.get_schema_sync("k8s/deployment").unwrap();
assert!(schema.is_object());§Rule engine
use devops_toolkit::rules::load_builtin_rules;
use serde_json::json;
let engine = load_builtin_rules();
let data = json!({ "spec": { "replicas": 1 } });
let diagnostics = engine.evaluate(&data);
assert!(!diagnostics.is_empty());§Feature flags
| Feature | Description |
|---|---|
wasm | Enable WASM-compatible getrandom backend (forwarded to devops-validate/wasm). |
§Why separate crates?
| Use case | Recommended crate |
|---|---|
| Only need the data types (models) | devops-models |
Need validation but already have devops-models | devops-validate |
| New project, want everything | devops-toolkit |
§License
Licensed under either of MIT or Apache-2.0, at your option.
Modules§
- error
- Unified error type for devops-models.
- llm
- LLM client types and provider abstractions.
- models
- Data structures for DevOps configuration formats.
- repair
- 6-stage YAML auto-repair pipeline.
- rules
- Declarative rule engine for semantic validation.
- schema
- JSON Schema registry and validation module.
- validate
- Validation functions — re-exported from
devops_validate::validator.
Enums§
- Devops
Error - Unified error type for DevOps model operations.
Type Aliases§
- Result
- Convenience alias for
Result<T, DevopsError>.