import{a,b as p,c as A,d as i,e as r,f as l,g as h,h as c,i as v}from"./chunk-M7FUOKXS.mjs";import{Command as d}from"commander";function S(o){console.log(o.data.map(n=>`${n.name} ${n.id} ${n.createdAt} ${n.updatedAt}`).join(`
`))}var L,u,f=p(()=>{"use strict";r();L=new d("list").description("list your applications").option("-c, --count <count>","the number of applications to list","100").action(async o=>{let{count:n}=o;console.log("executing:",n);let e=await i().apps.list({pageSize:parseInt(n)});S(e)}),u=new d("apps").description("manage your applications").addCommand(L)});import{Command as b}from"commander";function j(o,n){n==="text"?console.log(o.map(t=>`${t.severity} ${t.timestamp} ${t.textPayload}`).join(`
`)):n==="json"&&console.log(JSON.stringify(o,null,2))}var g,C=p(()=>{"use strict";r();g=new b("logs").description("get the logs from your application").option("-f, --format <format>","the format of the logs [text,json]","text").option("-c, --log-count <log count>","the number of logs lines to pull","100").requiredOption("-n, --name <name>","the application name").action(async o=>{let{format:n,logCount:t,name:e}=o;console.log("executing:",n,t,e);let m=i(),s=await m.apps.lookup({appName:e});if(!s){console.error(`App not found for ${e}`);return}let $=await m.apps.logs({appId:s.id,logCount:parseInt(t)});j($,n)})});import{Command as I}from"commander";var y,x=p(()=>{"use strict";r();y=new I("undeploy").description("undeploy your application").requiredOption("-n, --name <name>","the application name").action(async o=>{let{name:n}=o;console.log("undeploying:",n);let t=i(),e=await t.apps.lookup({appName:n});if(!e){console.error(`App not found for ${n}`);return}await t.deployments.undeploy({id:e.id})})});var q=A((H,w)=>{f();v();C();x();h();if(a.main===w){let{program:o}=a("commander");o.name("continual").description("CLI utility for Continual operations").version(l),o.addCommand(c),o.addCommand(y),o.addCommand(g),o.addCommand(u),o.parse(process.argv)}});export default q();
//# sourceMappingURL=continual.mjs.map