mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-12 19:40:31 +00:00
Cloud-native multi-protocol artifact registry in Rust. - Docker Registry v2 - Maven (+ proxy) - npm (+ proxy) - Cargo, PyPI - Web UI, Swagger, Prometheus - Local & S3 storage - 32MB Docker image Created by DevITWay https://getnora.io
53 lines
1.1 KiB
Rust
53 lines
1.1 KiB
Rust
use clap::{Parser, Subcommand};
|
|
|
|
#[derive(Parser)]
|
|
#[command(name = "nora-cli")]
|
|
#[command(about = "CLI tool for Nora registry")]
|
|
struct Cli {
|
|
#[command(subcommand)]
|
|
command: Commands,
|
|
}
|
|
|
|
#[derive(Subcommand)]
|
|
enum Commands {
|
|
/// Login to a registry
|
|
Login {
|
|
#[arg(long)]
|
|
registry: String,
|
|
#[arg(short, long)]
|
|
username: String,
|
|
},
|
|
/// Push an artifact
|
|
Push {
|
|
#[arg(long)]
|
|
registry: String,
|
|
path: String,
|
|
},
|
|
/// Pull an artifact
|
|
Pull {
|
|
#[arg(long)]
|
|
registry: String,
|
|
artifact: String,
|
|
},
|
|
}
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let cli = Cli::parse();
|
|
|
|
match cli.command {
|
|
Commands::Login { registry, username } => {
|
|
println!("Logging in to {} as {}", registry, username);
|
|
// TODO: implement
|
|
}
|
|
Commands::Push { registry, path } => {
|
|
println!("Pushing {} to {}", path, registry);
|
|
// TODO: implement
|
|
}
|
|
Commands::Pull { registry, artifact } => {
|
|
println!("Pulling {} from {}", artifact, registry);
|
|
// TODO: implement
|
|
}
|
|
}
|
|
}
|