wasmer_cli/commands/app/
info.rs1use super::util::AppIdentOpts;
4use crate::{commands::AsyncCliCommand, config::WasmerEnv};
5
6#[derive(clap::Parser, Debug)]
10pub struct CmdAppInfo {
11 #[clap(flatten)]
12 env: WasmerEnv,
13 #[clap(flatten)]
14 ident: AppIdentOpts,
15}
16
17#[async_trait::async_trait]
18impl AsyncCliCommand for CmdAppInfo {
19 type Output = ();
20
21 async fn run_async(self) -> Result<(), anyhow::Error> {
22 let client = self.env.client()?;
23 let (_ident, app) = self.ident.load_app(&client).await?;
24
25 let app_url = app.url;
26 let versioned_url = app
27 .active_version
28 .as_ref()
29 .map_or("n/a", |version| &version.url);
30 let dashboard_url = app.admin_url;
31
32 println!(" App Info ");
33 println!("→ Name: {}", app.name);
34 println!("→ Owner: {}", app.owner.global_name);
35 println!("→ URL: {app_url}");
36 println!("→ Unique URL: {versioned_url}");
37 println!("→ Dashboard: {dashboard_url}");
38
39 Ok(())
40 }
41}