atlas_cli/
lib.rs

1//! # Atlas CLI
2//!
3//! Machine Learning (ML) Lifecycle & Transparency Manager
4//!
5//! A command-line interface tool for creating, managing, and verifying Content Provenance
6//! and Authenticity (C2PA) manifests for machine learning models, datasets, and related artifacts.
7//!
8//! ## Installation
9//!
10//! ```bash
11//! cargo install atlas-cli
12//! ```
13//!
14//! ## Quick Start
15//!
16//! Create a model manifest:
17//! ```bash
18//! atlas-cli model create \
19//!     --paths=model.onnx \
20//!     --ingredient-names="Main Model" \
21//!     --name="My Model" \
22//!     --author-org="My Organization" \
23//!     --author-name="My Name" \
24//!     --print
25//! ```
26//!
27//! For more examples and detailed documentation, see:
28//! - [User Guide](https://github.com/IntelLabs/atlas-cli/blob/main/docs/USER_GUIDE.md)
29//! - [Examples](https://github.com/IntelLabs/atlas-cli/blob/main/docs/EXAMPLES.md)
30//! - [Development Guide](https://github.com/IntelLabs/atlas-cli/blob/main/docs/DEVELOPMENT.md)
31
32#![doc(html_root_url = "https://docs.rs/atlas-cli/0.1.0")]
33
34pub mod cc_attestation;
35pub mod cli;
36pub mod error;
37pub mod hash;
38pub mod manifest;
39pub mod signing;
40pub mod storage;
41#[cfg(test)]
42mod tests;
43pub mod utils;
44
45use std::path::PathBuf;
46use storage::config::StorageConfig;
47
48// Re-export error types
49pub use error::{Error, Result};
50
51/// CLI configuration options
52#[derive(Debug, Clone)]
53pub struct Config {
54    /// Path to private key for signing
55    pub key_path: Option<PathBuf>,
56    /// Storage backend configuration
57    pub storage_config: StorageConfig,
58    /// Whether to show progress bars
59    pub show_progress: bool,
60}
61
62impl Default for Config {
63    fn default() -> Self {
64        Self {
65            key_path: None,
66            storage_config: StorageConfig::default(),
67            show_progress: true,
68        }
69    }
70}
71
72/// Initialize logging for the CLI
73///
74/// # Examples
75///
76/// ```
77/// use atlas_cli::init_logging;
78///
79/// // Initialize with default settings
80/// let result = init_logging();
81/// // Note: This might fail if already initialized
82/// assert!(result.is_ok() || result.is_err());
83/// ```
84pub fn init_logging() -> Result<()> {
85    env_logger::try_init().map_err(|e| Error::InitializationError(e.to_string()))
86}
87
88// Re-export commonly used types and traits
89pub use storage::traits::StorageBackend;