use atlas_cli::{
cli::{
self,
commands::{
CCAttestationCommands, DatasetCommands, EvaluationCommands, ManifestCommands,
ModelCommands, PipelineCommands, SoftwareCommands,
},
},
error::Result,
};
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(author, version, about)]
pub struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
Dataset {
#[command(subcommand)]
command: DatasetCommands,
},
Model {
#[command(subcommand)]
command: ModelCommands,
},
Software {
#[command(subcommand)]
command: SoftwareCommands,
},
Manifest {
#[command(subcommand)]
command: ManifestCommands,
},
Evaluation {
#[command(subcommand)]
command: EvaluationCommands,
},
Pipeline {
#[command(subcommand)]
command: PipelineCommands,
},
CCAttestation {
#[command(subcommand)]
command: CCAttestationCommands,
},
}
fn main() -> Result<()> {
atlas_cli::init_logging()?;
let cli = Cli::parse();
let result = match cli.command {
Commands::Dataset { command } => cli::handlers::handle_dataset_command(command),
Commands::Model { command } => cli::handlers::handle_model_command(command),
Commands::Software { command } => cli::handlers::handle_software_command(command),
Commands::Manifest { command } => cli::handlers::handle_manifest_command(command),
Commands::Evaluation { command } => cli::handlers::handle_evaluation_command(command),
Commands::Pipeline { command } => cli::handlers::handle_pipeline_command(command),
Commands::CCAttestation { command } => {
cli::handlers::handle_cc_attestation_command(command)
}
};
if let Err(ref e) = result {
eprintln!("{}", cli::format_error(e));
}
result
}