mod commands;
mod manifest;
mod oci;
use anyhow::Result;
use clap::{Parser, Subcommand};
use tracing_subscriber::EnvFilter;
#[derive(Debug, Parser)]
#[command(name = "portaki", version, about = "Portaki module SDK CLI")]
struct Cli {
#[command(subcommand)]
command: Command,
}
#[derive(Debug, Subcommand)]
enum Command {
Init(commands::init::InitArgs),
Dev(commands::dev::DevArgs),
Build(commands::build::BuildArgs),
Lint(commands::lint::LintArgs),
Test(commands::test::TestArgs),
Publish(commands::publish::PublishArgs),
Docs(commands::docs::DocsArgs),
Catalog(commands::catalog::CatalogArgs),
Inspect(commands::inspect::InspectArgs),
}
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.init();
let cli = Cli::parse();
match cli.command {
Command::Init(args) => commands::init::run(args),
Command::Dev(args) => commands::dev::run(args).await,
Command::Build(args) => commands::build::run(args).await,
Command::Lint(args) => commands::lint::run(args),
Command::Test(args) => commands::test::run(args),
Command::Publish(args) => commands::publish::run(args).await,
Command::Docs(args) => commands::docs::run(args),
Command::Catalog(args) => commands::catalog::run(args),
Command::Inspect(args) => commands::inspect::run(args).await,
}
}