Skip to main content

krypt_core/
lib.rs

1//! `krypt-core` — the engine.
2//!
3//! Everything that does real work lives here, behind a stable Rust API.
4//! The `krypt` binary (in `krypt-cli`) is a thin shell around this crate.
5//!
6//! Current modules:
7//!
8//! - [`config`]      — `.krypt.toml` schema, parser, validator (issue #9)
9//! - [`paths`]       — `${VAR}` resolution with XDG defaults + platform gating
10//!   (issue #11)
11//! - [`include`]     — `include = [...]` glob expansion and config merging
12//!   (issue #10)
13//! - [`copy`]        — plan + atomic deploy of [[link]] and [[template]]
14//!   entries to their resolved destinations (issue #12)
15//! - [`manifest`]    — versioned record of what was deployed, with sha256
16//!   hashes for drift detection (issue #13)
17//! - [`deploy`]      — high-level link / unlink / relink orchestration
18//!   over the other modules (issue #15)
19//! - [`tool_config`] — `${XDG_CONFIG}/krypt/config.toml` schema + I/O
20//!   (issue #14)
21//! - [`init`]        — `krypt init` orchestration: clone + write tool config
22//!   (issue #14)
23//! - [`update`]      — `krypt update` orchestration: pull repo + re-deploy
24//!   (issue #17)
25//! - [`adopt`]       — `krypt adopt` / `krypt adopt-edits`: import existing
26//!   dotfiles into the repo and sync in-place edits back (issue #16)
27//! - [`doctor`]      — `krypt doctor` diagnostic health-check: prints one
28//!   status line per check and serializes to JSON for `--json` (issue #20)
29//!
30//! - [`setup`]       — `krypt setup` interactive wizard: reads `[prompts]`
31//!   sections, asks questions, and applies one of four built-in writers
32//!   (gitconfig, hypr_vars, env, generic_template) (issue #18).
33
34#![forbid(unsafe_code)]
35#![warn(missing_docs)]
36
37pub mod adopt;
38pub mod config;
39pub mod copy;
40pub mod deploy;
41pub mod doctor;
42pub mod include;
43pub mod init;
44pub mod manifest;
45pub mod paths;
46pub mod setup;
47pub mod tool_config;
48pub mod update;
49
50pub use include::{expand_includes, load_with_includes};
51
52/// Crate version, exposed for `krypt --version` aggregation.
53pub const VERSION: &str = env!("CARGO_PKG_VERSION");