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.2.0")]
33
34pub mod cc_attestation;
35pub mod cli;
36pub mod error;
37pub mod hash;
38pub mod in_toto;
39pub mod manifest;
40pub mod signing;
41pub mod slsa;
42pub mod storage;
43#[cfg(test)]
44mod tests;
45pub mod utils;
46
47use std::path::PathBuf;
48use storage::config::StorageConfig;
49
50// Re-export error types
51pub use error::{Error, Result};
52
53/// CLI configuration options
54#[derive(Debug, Clone)]
55pub struct Config {
56    /// Path to private key for signing
57    pub key_path: Option<PathBuf>,
58    /// Storage backend configuration
59    pub storage_config: StorageConfig,
60    /// Whether to show progress bars
61    pub show_progress: bool,
62}
63
64impl Default for Config {
65    fn default() -> Self {
66        Self {
67            key_path: None,
68            storage_config: StorageConfig::default(),
69            show_progress: true,
70        }
71    }
72}
73
74/// Initialize logging for the CLI
75///
76/// # Examples
77///
78/// ```
79/// use atlas_cli::init_logging;
80///
81/// // Initialize with default settings
82/// let result = init_logging();
83/// // Note: This might fail if already initialized
84/// assert!(result.is_ok() || result.is_err());
85/// ```
86pub fn init_logging() -> Result<()> {
87    env_logger::try_init().map_err(|e| Error::InitializationError(e.to_string()))
88}
89
90// Re-export commonly used types and traits
91pub use storage::traits::StorageBackend;