1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Shared CLI plumbing for the oboron-protocol CLIs (`ob` and `obc`).
//!
//! Both binaries share a config directory at `~/.oboron/`:
//!
//! ```text
//! ~/.oboron/
//! ├── config.json # active profile + per-binary defaults
//! ├── profiles/<name>.json # per-profile key + metadata
//! └── bkp/<name>-<ts>.json # automatic backups on overwrite/delete
//! ```
//!
//! This crate provides:
//!
//! - **Path resolution** — `config_path`, `profile_dir`, `profile_path`, `backup_dir`.
//! - **Name validation** — `validate_profile_name`.
//! - **Key normalization** — `normalize_key_to_hex` accepts the canonical
//! 128-char hex form *or* the legacy 86-char base64 form (during the
//! base64 deprecation period) and returns canonical hex.
//! - **Config / profile I/O** — `load_config`, `save_config`, `load_profile`,
//! `save_profile`, `list_profiles`, `delete_profile`, `rename_profile`.
//! File writes preserve unknown JSON fields so the two binaries don't
//! clobber each other's metadata.
//! - **Backups** — `backup_profile` saves a timestamped copy before
//! overwrite/delete.
//! - **Command handlers** — `commands::*` implements the user-facing
//! `init` / `config` / `profile` / `key` subcommands shared by both
//! binaries, parameterized over a [`commands::CliInfo`] supplying the
//! per-binary defaults and the binary name used in error hints.
//! - **Legacy-dir migration** — `migration::ensure_config_root_migrated`
//! moves a leftover `~/.ob/` to `~/.oboron/` on first run of the
//! current tooling, leaving a symlink so any older binary still
//! on the system keeps working against the same data.
pub use ;
pub use ;
pub use ;
pub use ;